버튼을 누른 다음 뷰 컨트롤러가 슬라이드 할 수있는 커스텀 세그를 만드는 가장 좋은 방법은 무엇입니까? 나는 왼쪽에서 오른쪽으로 세그 (segue)를 만들었지 만 나는 다른 방향으로 가고 싶다. 일부 Youtube 개의 동영상과 this question을 보았지만 내가 원하는 것을 보여주지 못했습니다.커스텀 슬라이드 Segue - Xcode 8.0 Swift 3.0
내 코드 :
import UIKit
class SegueFromLeft: UIStoryboardSegue
{
override func perform()
{
let src = self.sourceViewController
let dst = self.destinationViewController
src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)
dst.view.transform = CGAffineTransformMakeTranslation(-src.view.frame.size.width, 0)
UIView.animateWithDuration(0.25,
delay: 0.0,
options: UIViewAnimationOptions.CurveEaseInOut,
animations: {
dst.view.transform = CGAffineTransformMakeTranslation(0, 0)
},
completion: { finished in
src.presentViewController(dst, animated: false, completion: nil)
}
)
}
}
는 기본적으로, 오른쪽에서 왼쪽으로가는 SEGUE을 만들려고합니다.
감사
나는
당신은이 일을 성공 했습니까? 내 대답을 시도 했니? –