Comments (2)
hey do you know how to hide dropdown on viewWillDisappear?
from easydropdown.
i made some changes to set the selection
let titleView = TitleView ( navigationController: navigationController!, title: "", items: items, defaultIndex: 0)
the last value is the selection, and the class is
`public init?(navigationController: UINavigationController, title: String, items: [String], defaultIndex: Int) {
super.init(frame: CGRect.zero)
// Button
button = ArrowButton()
button.label.text = title
button.label.text = items[defaultIndex]
button.addTarget(self, action: #selector(buttonTouched(_:)), for: .touchUpInside)
addSubview(button)
self.layoutSubviews()
// Content
let contentController = TableController(items: items, initialIndex: defaultIndex )
// Dropdown
guard let dropdown = DropdownController(contentController: contentController, navigationController: navigationController)
else { return nil }
self.dropdown = dropdown
contentController.action = { [weak self, weak dropdown] index in
self?.button.label.text = items[index]
self?.action?(index)
self?.layoutSubviews()
dropdown?.hide()
}
contentController.dismiss = { [weak dropdown] in
dropdown?.hide()
}
dropdown.animationBlock = { [weak self] showing in
self?.button.arrow.transform = showing
? CGAffineTransform(rotationAngle: CGFloat.pi) : CGAffineTransform.identity
}
}`
from easydropdown.
Related Issues (19)
- [!] Unable to find a specification for `Dropdown` HOT 1
- have the problem in dropdown ( thread ) HOT 1
- Add possibility to config title icon image
- How to hide it in viewwilldisappear HOT 2
- Incompatible with Swift 4.1?
- Layout issue iOS 11 xCode 9.4
- Problem on iOS 10.3 or low HOT 1
- Detecting when dropdown is showing HOT 1
- Cant find Pod Dropdown HOT 1
- too long text issues
- Does this support swift 4.2? HOT 1
- app dies on orientation changing
- background colour
- Memory Leak on Background
- Swift 4 / Xcode 9 - Out of date HOT 2
- example not working HOT 1
- Invalid layout on iOS 10 HOT 5
- Can't set initial index parameter HOT 3
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 easydropdown.