İki görünüm var Bir tokatlamak stil geçiş geçiş yapmak istiyorum ve bunu yapmak için bir ibne olduğunda bunu yaptım ama burada bir tane yok animasyon sınıfımı nasıl uygulayacağımı bilmiyorum. Benim sınıfta tek şey ise:Özel Görünüm Geçiş Yapmadan Geçiş Yapmak Storyboard segues (Swift)
Ben aşağıdaki özel segue uygulamak uygulamak istediğinizlet stb = UIStoryboard(name: "Walkthrough", bundle: nil)
let walkthrough = stb.instantiateViewControllerWithIdentifier("walk") as! BWWalkthroughViewController
self.presentViewController(walkthrough, animated: true, completion: nil)
:
class CustomSegue: UIStoryboardSegue {
override func perform() {
// Assign the source and destination views to local variables.
var firstVCView = self.sourceViewController.view as UIView!
var secondVCView = self.destinationViewController.view as UIView!
// Get the screen width and height.
let screenWidth = UIScreen.mainScreen().bounds.size.width
let screenHeight = UIScreen.mainScreen().bounds.size.height
// Specify the initial position of the destination view.
secondVCView.frame = CGRectMake(0.0, screenHeight, screenWidth, screenHeight)
// Access the app's key window and insert the destination view above the current (source) one.
let window = UIApplication.sharedApplication().keyWindow
window?.insertSubview(secondVCView, aboveSubview: firstVCView)
// Animate the transition.
UIView.animateWithDuration(0.2, animations: {() -> Void in
firstVCView.frame = CGRectOffset(firstVCView.frame, -screenWidth, 0.0)
secondVCView.frame = CGRectOffset(secondVCView.frame, -screenWidth, 0.0)
}) { (Finished) -> Void in
self.sourceViewController.presentViewController(self.destinationViewController as! UIViewController,
animated: false,
completion:nil)
}
}
}
Ben herhangi işaretçiler lütfen çalışmak olamıyorum?
Not. Ayrıca, animasyonu 4 saniyeliğine yavaşlatırsanız istenmeyen resimlerin ortaya çıkacağını unutmayın. – SwiftArchitect