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

added popTo(item:orDismiss:) #165

Merged
merged 1 commit into from
Oct 4, 2019
Merged

added popTo(item:orDismiss:) #165

merged 1 commit into from
Oct 4, 2019

Conversation

eliburke
Copy link
Contributor

Checklist

Motivation and Context

This is loosely related to my issue #103. It resolves a situation where a Page can be used either standalone or as part of a combined workflow.
e.g. a pair of Pages used to Select an Album and Select an Image in an Album could be used:
AppUI -> Send Image -> SelectAlbumPage -> SelectImagePage -> action dismisses
vs
AppUI -> ViewAccountPage -> EditAccountPage -> Edit Avatar -> SelectAlbumPage -> SelectImagePage -> action should pop to EditAccountPage

A page constructor can be created that takes an optional "intermediate root":

    @objc func cancelTapped(sender: UIButton) {
        if let myRoot = myRoot {
            self.manager?.popTo(item: myRoot, orDismiss: true)
        } else {
            self.manager?.dismissBulletin(animated: true)
        }
    }

Description

Created new popTo(item:orDismiss:) method. It takes an item and searches the internal itemsStack for an exact match to the supplied item. If the item is found, it is set as current and redraw is triggered. Subsequent items on the stack are then torn down.

@alexisakers alexisakers merged commit 804f3b2 into alexisakers:master Oct 4, 2019
@eliburke eliburke deleted the poptoitem branch October 4, 2019 14:47
ghost pushed a commit to mobisecitalia/BulletinBoard that referenced this pull request Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants