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

Diversity is Good

nakajijapan
October 23, 2015
370

Diversity is Good

Shibuya Swift #01

nakajijapan

October 23, 2015
Tweet

Transcript

  1. Talk about • ެ։ • ͳͥ࡞੒ͨ͠ͷ͔ • ӡ༻ϑΣʔζ • εϫΠϓͰ࡟আͰ͖ΔΑ͏ʹͳΔ·Ͱ

    • Ճ଎౓ͷௐ੔ • ΋ͬͱؾ࣋ͪྑ͘ • ެ։͔ͯ͠Βͷ൓Ԡ
  2. PhotoSlider • OSSʹࣅͨΑ͏ͳ΋ͷ͸ͳ͍΋ͷ͔ • IDMPhotoBrowser • Facebook, TwitterͷΠϯλϥΫγϣϯΛऔΓೖΕͯྑͦ͞͏ • MWPhotoBrowserͷ೿ੜܥ

    • εϫΠϓͰ࡟আ͢ΔඍົͳΞχϝʔγϣϯ͕ؾʹ৯Θͳ͍ • ϝϯς͞Ε͍ͯͳ͍… • ྑ͍ײ͡ͷ΋ͷ͕ͳ͍
  3. εΫϩʔϧͷ଎౓Ͱ࡟আ public func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { if

    self.scrollMode == .Vertical { let velocity = scrollView.panGestureRecognizer .velocityInView(scrollView) if velocity.y < -500 { self.scrollView.frame = scrollView.frame self.closePhotoSlider(true) } else if velocity.y > 500 { self.scrollView.frame = scrollView.frame self.closePhotoSlider(false) } } }
  4. ViewController Transitions 7JFX$POUSPMMFS "OJNBUPS6*7JFX$POUSPMMFS"OJNBUFE5SBOTJUJPOJOH 7JFX$POUSPMMFS public protocol UIViewControllerAnimatedTransitioning : NSObjectProtocol

    { public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval public func animateTransition(transitionContext: UIViewControllerContextTransitioning) optional public func animationEnded(transitionCompleted: Bool) }
  5. ViewController Transitions "OJNBUPS6*7JFX$POUSPMMFS"OJNBUFE5SBOTJUJPOJOH public class ZoomingAnimationController: NSObject, UIViewControllerAnimatedTransitioning { var

    present = true public var sourceTransition: ZoomingAnimationControllerTransitioning? public var destinationTransition: ZoomingAnimationControllerTransitioning? public init(present: Bool) { super.init() self.present = present } public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { return 0.2 } public func animateTransition(transitionContext: UIViewControllerContextTransitioning) { if self.present { self.animatePresenting(transitionContext) } else { self.animateDismiss(transitionContext) } } }
  6. ViewController Transitions 4PVSDF7JFX$POUSPMMFS // Using transition let photoSlider = PhotoSlider.ViewController(imageURLs:

    self.imageURLs) photoSlider.delegate = self photoSlider.currentPage = indexPath.row photoSlider.transitioningDelegate = self self.presentViewController(photoSlider, animated: true) { () -> Void in // Something }
  7. ViewController Transitions 4PVSDF7JFX$POUSPMMFS // MARK: UIViewControllerTransitioningDelegate func animationControllerForDismissedController(dismissed: UIViewController) ->

    UIViewControllerAnimatedTransitioning? { let animationController = PhotoSlider.ZoomingAnimationController(present: false) animationController.sourceTransition = dismissed as? ZoomingAnimationControllerTransitioning animationController.destinationTransition = self return animationController } func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? { let animationController = PhotoSlider.ZoomingAnimationController(present: true) animationController.sourceTransition = source as? ZoomingAnimationControllerTransitioning animationController.destinationTransition = presented as? ZoomingAnimationControllerTransitioning return animationController }
  8. Versioning • Versioning͢Δͱ͖ͷ࡞ۀ • xxx.podspecͷόʔδϣϯมߋ • git tag x.x.x •

    ҙ֎ͱͩΔ͍ͷͰbumpͷpodspec൛࡞ͬͨ(RubyͰ) • ࣮͸ɻɻɻ
  9. Versioning • Versioning͢Δͱ͖ͷ࡞ۀ • xxx.podspecͷόʔδϣϯมߋ • git tag x.x.x •

    ҙ֎ͱͩΔ͍ͷͰbumpͷpodspec൛࡞ͬͨ(RubyͰ) • RubyͰ͋ͬͯ΋͍͍΍Μ