Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift愛好会合宿 in 笹川

Sato Takeshi
December 04, 2016

Swift愛好会合宿 in 笹川

【1周年・合宿】集まれSwift好き!Swift愛好会 vol13
https://love-swift.connpass.com/event/43865/
の発表資料です。
カスタムトランジションを作りました。

Sato Takeshi

December 04, 2016
Tweet

More Decks by Sato Takeshi

Other Decks in Technology

Transcript

  1. ϋϚϦϙΠϯτ • frameࢦఆ͸UIViewͷίϯόʔτΛ࢖͏ɻ func createImageView() -> UIImageView? { guard let

    detailImageView = self.imageView else { return nil } let imageView = UIImageView(image: self.image) imageView.contentMode = .scaleAspectFill imageView.frame = detailImageView.convert(detailImageView.frame, to: self.view) //imageView.frame = detailImageView.frame <-͜Ε͸ͩΊɻ return imageView } Swiftϓϩάϥϛϯάษڧձ 2016/11/10 15
  2. ࠷ॳʹίϯςφϏϡʔͷαϒϏϡʔʹରͯ͠ɺ removeFromSuperview()ͯ͠ରԠͨ͠ //pop࣌ͷΞχϝʔγϣϯ fileprivate func backwardTransition(_ transitionContext: UIViewControllerContextTransitioning) { //

    PushͱٯͷΞχϝʔγϣϯ guard let fromeVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from) else { return } guard let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) else { return } let containerView = transitionContext.containerView //લճભҠ͍ͨ͠͞ͷImageView͕࢒͍ͬͯΔͷͰҰ౓શͯΛ֎͢ containerView.subviews.forEach { view in view.removeFromSuperview() } Swiftϓϩάϥϛϯάษڧձ 2016/11/10 18