Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to v1.1.0 (Responder-Based Model) #10

Closed
aheze opened this issue Jan 5, 2022 · 0 comments
Closed

Updating to v1.1.0 (Responder-Based Model) #10

aheze opened this issue Jan 5, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@aheze
Copy link
Owner

aheze commented Jan 5, 2022

Version 1.1.0 has some breaking changes, but they're easily resolvable.

Changes in UIKit presentation (where self is a view controller)

Action Older Versions Version 1.1.0
Presenting Popovers.present(popover) self.present(popover) or popover.present(in: window)
Replacing Popovers.replace(oldPopover, with: newPopover) self.replace(oldPopover, with: newPopover) or oldPopover.replace(with: newPopover)
Dismissing Popovers.dismiss(popover) self.dismiss(popover) or popover.dismiss()

Changes in SwiftUI frame tags

Frame tags now support windows automatically.

Action Older Versions Version 1.1.0
Saving frame tags

.frameTag("Your Tag", in: currentWindowScene)

.frameTag("Your Tag")

Retrieving frame tags
/// where `currentWindowScene` is the current window scene
let savedFrame = Popovers.frameTagged("Your Tag", in: currentWindowScene)

/// If outside a popover
WindowReader { window in
    let savedFrame = window.frameTagged("Your Tag")
}

/// If inside a popover's view or background
PopoverReader { context in
    let savedFrame = context.window.frameTagged("Your Tag")
}

Removed methods

  • Popovers.prepare is no longer needed and has been removed.

Removed properties

  • Popover.Attributes.windowScene is no longer needed and has been removed.
@aheze aheze pinned this issue Jan 5, 2022
@aheze aheze added the documentation Improvements or additions to documentation label Jan 5, 2022
@aheze aheze changed the title Updating to v1.1.0 Updating to v1.1.0 (Responder-Based Model) Jan 5, 2022
@aheze aheze closed this as completed Jan 6, 2022
@aheze aheze unpinned this issue Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant