Comments (5)
Thank you for taking the time to explain that so well. This is/was my first foray into the popOver, and indeed my wires were crossed. I had already gone old-school with an unwind as i usually do, but will convert to the block passing as time permits, thanks!
from kuipopover.
it would seem i misunderstood the "completion" portion of the signature, and was thinking async. It really should be renamed "didAppear" as it surely isn't a completed showing of a popup. I know this is not the repo's issue, but a swift thing.
from kuipopover.
@wdcurry
When calling the UIViewController's presenter, pass completion to the parameter.
It's the same as the iOS system.
from kuipopover.
I don’t think you understood my point and follow up. I was expecting the completion to act as the completion of the presention, ie when the pop up was finished, not to when it was completed in instantion and now showing. In the context of passing control to a pseudo-modal view, the current logic from Apple is incorrect. The completion should run when the pop up disappears.
from kuipopover.
@wdcurry Hello, I think we have different point of view.
In UIKit, The completion closure of the present function is called when the present animation ends. In the same way, the dismiss function also calls the completion closure when the dismiss animation finishes.
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621380-present
func present(_ viewControllerToPresent: UIViewController,
animated flag: Bool,
completion: (() -> Void)? = nil)
completion
The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621505-dismiss
func dismiss(animated flag: Bool,
completion: (() -> Void)? = nil)
completion
The block to execute after the view controller is dismissed. This block has no return value and takes no parameters. You may specify nil for this parameter.
Therefore, If you want to run the closure after the pop up disappears on screen, you can use
public func dismissPopover(animated: Bool, completion: DismissPopoverCompletion?)
from kuipopover.
Related Issues (14)
- Change arrow position HOT 2
- How to use this in Objective-C ? HOT 3
- Migration to Swift 4.2 HOT 1
- shouldDismissOnTap bug fix HOT 2
- blur background VC or otherwise help popOver be more apparent? HOT 3
- Unable to find a specification for `KUIPopOver` HOT 2
- assigning delegate? HOT 3
- Visibility of navbar in popover not accounted for. HOT 4
- Dismissing popover on command HOT 5
- SPM support HOT 2
- Transparent background for popover HOT 1
- Can I hide the arrow? HOT 2
- Fill UITableView?? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kuipopover.