我有两个VC。一个作为navigationController,另一个作为模态视图。 我正在使用segue来显示模态视图。
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.performSegueWithIdentifier("openFilterSegue", sender: nil)
});
并打开这样的东西
class FilterVC: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource, AlertMessage {
override func viewDidLoad() {
pickerView.dataSource = self
pickerView.delegate = self
}
func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView!) -> UIView {
let pickerLabel = UILabel()
pickerLabel.textColor = UIColor.blackColor()
pickerLabel.text = arrShopCentrum[row].nazev
pickerLabel.font = UIFont(name: "Roboto-Regular", size: 15)
pickerLabel.textAlignment = NSTextAlignment.Center
return pickerLabel
}
func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return arrPlace.count
}
}
当我第一次打开VC时,需要加载大约3个SECONDS。然后我关闭它,它会更快打开。
BTW我在那里使用REALM
对象DB,但我认为这不是问题。
它的故事板和Delegate +数据源是连接的