This is how my story board currently looks私のセグエは、私は縦置きボタン付きビュー上のボタンをクリックすると
、私は戻ってくつろぐとき、私は終わるすべての道を行く、しかし、正しい対応するビューを開くことができますあまりにも遠く遡りますボタンのあるページではなく、サインインページに戻ります。私は適切な場所に巻き戻しセグを持っています、なぜそれがそれほど遠くに行くのか分かりません。
これは、ボタン
@IBOutlet weak var menuButton: UIButton!
@IBOutlet weak var clubButton: UIButton!
@IBOutlet weak var announcemnetsButton: UIButton!
@IBOutlet weak var eventButton: UIButton!
var transition = QZCircleSegue()
override func viewDidLoad() {
super.viewDidLoad()
menuButton.layer.cornerRadius = menuButton.frame.size.width/2
clubButton.layer.cornerRadius = menuButton.frame.size.width/2
announcemnetsButton.layer.cornerRadius = menuButton.frame.size.width/2
eventButton.layer.cornerRadius = menuButton.frame.size.width/2
menuButton.layer.masksToBounds = true
clubButton.layer.masksToBounds = true
announcemnetsButton.layer.masksToBounds = true
eventButton.layer.masksToBounds = true
}
override var prefersStatusBarHidden : Bool {
return true;
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "NewVC") {
self.transition.animationChild = menuButton
self.transition.animationColor = UIColor(red: 255/255, green: 0/255, blue: 0/255, alpha: 1.0)
} else if (segue.identifier == "ClubVC") {
self.transition.animationChild = clubButton
self.transition.animationColor = UIColor(red: 81/255, green: 172/255, blue: 246/255, alpha: 1.0)
} else if (segue.identifier == "AnnouncementVC") {
self.transition.animationChild = announcemnetsButton
self.transition.animationColor = UIColor(red: 255/255, green: 179/255, blue: 109/255, alpha: 1.0)
} else if segue.identifier == "EventVC" {
self.transition.animationChild = eventButton
self.transition.animationColor = UIColor(red: 63/255, green: 255/255, blue: 176/255, alpha: 1.0)
}
let toViewController = segue.destination as! NewViewController
/* Set both, the origin and destination to your transition manager*/
self.transition.fromViewController = self
self.transition.toViewController = toViewController
/* Add the transition manager to your transitioningDelegate View Controller*/
toViewController.transitioningDelegate = transition
}
/* Specify the destination view controller to enable the unwind segue*/
@IBAction func unwindToMainViewController (sender: UIStoryboardSegue){
self.dismiss(animated: true, completion: nil)
}}
あなたのコードを投稿してください。特に、ストーリーボードのビューコントローラー接続で巻き戻してください。 –
私のコード –
を書きました。コードは大丈夫ですが、ストーリーボードの接続が見えないと何が起こっているのかは分かりません。また、prepare()の機能を減らすことで、問題を特定することもできます。 – Totoro