Skip to content

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

@aheze

Description

@aheze

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions