Comments (5)
That worked - thank you!
from kuipopover.
@edcousins
You have to showPopOver it before dismissPopOver
from kuipopover.
Hi @Kofktu
The popover has already been shown in a previous function. Basically I am showing the popover upon pressing a UIBarButtonItem, and then when pressing a button within the popover view controller, I want to subsequently hide the popover (as it's function is complete at this point). Here is the code I am using to show/hide:
@objc func showFilter(sender: UIBarButtonItem) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let filterVC = storyboard.instantiateViewController(
withIdentifier: "filterViewController") as! FilterViewController
filterVC.showPopover(barButtonItem: sender)
}
func dismissFilter() {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let filterVC = storyboard.instantiateViewController(
withIdentifier: "filterViewController") as! FilterViewController
filterVC.dismissPopover(animated: true, completion: {
print("CustomPopOverViewController.dismiss.completion")
})
}
Appreciate the assistance.
from kuipopover.
@edcousins
Ah,
You can call dismissPopOver inside the FilterViewController
Don't new instance, called dismissPopover
let viewController = FilterViewController()
...
viewController.showPopover()
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0) {
viewController.dismissPopover(animated: true, completion: {
print("CustomPopOverViewController.dismiss.completion")
})
}
class FilterViewController: UIViewController, KUIPopOverUsable {
..
func dismiss() {
self.dismissPopover(animated: ,completion:)
}
}
from kuipopover.
Good!
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
- Completion handler being called immediately... HOT 5
- 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
- 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.