Combobox component for Swift (failed with DownPicker)

时光怂恿深爱的人放手 提交于 2019-12-06 10:52:09

DownPicker is working fine with Swift. I just tried it and use it in my project. The problem I see is that you init DownPicker to local variable. There are two ways how you can use DownPicker in your project and it looks you choose Control Wrapper. So you should have in your controller these controls:

@IBOutlet weak var personTextField: UITextField!
var personDownPicker: DownPicker!

The first one is outlet connected to UITextField added in storyboard. DownPicker I Initialized in viewDidLoad:

override func viewDidLoad() {
        super.viewDidLoad()

        let persons: NSMutableArray = ["Architect", "Designer"]
        self.personDownPicker = DownPicker(textField: self.personTextField, withData:persons)
}  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!