私は2つのVCを持っています。 1つはnavigationController、もう1つはモーダルビューです。 モーダルビューを表示するためにsegueを使用しています。私はそれをロードするために約3秒かかり1回目のためにVCことを開封しております。このUIPickerViewの起動が非常に遅い
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
}
}
よう
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.performSegueWithIdentifier("openFilterSegue", sender: nil)
});
と開口部の何か。それから私はそれを閉じ、それはより速く開くでしょう。
私はそこにREALM
オブジェクトDBを使用していますが、私は問題ではないと思います。 そのストーリーボードとDelegate +データソースが接続されています
あなたは何がそんなに長くかかるのかを見るために楽器を使いましたか? – EmilioPelaez
こんにちは、私はあなたがFilterVCでviewDidLoadメソッドのスーパーコールを忘れたと思います。 –
私はsuper.viewdidloadを呼び出しました。何も改善されません。 –