Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Diversity is Good
Search
nakajijapan
October 23, 2015
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Diversity is Good
Shibuya Swift #01
nakajijapan
October 23, 2015
More Decks by nakajijapan
See All by nakajijapan
サービスにおけるDesign Systemの構築
nakajijapan
11
4.2k
Markdownをリアルタイムに解析する
nakajijapan
5
4.8k
Firebase Authorization
nakajijapan
0
350
Intoducing Izumo
nakajijapan
1
2.1k
Practical CloudKit
nakajijapan
1
1.9k
Introducing to Ajimi - プロダクトを味見していこう
nakajijapan
0
2.4k
Shari
nakajijapan
1
3.1k
Japan Apple Pay Development
nakajijapan
0
350
業務で絶対必要にならない技術
nakajijapan
0
910
Featured
See All Featured
Scaling GitHub
holman
464
140k
Designing for Performance
lara
611
70k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
420
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Skip the Path - Find Your Career Trail
mkilby
1
230
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
The Invisible Side of Design
smashingmag
301
52k
Music & Morning Musume
bryan
47
7.4k
GitHub's CSS Performance
jonrohan
1033
470k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Transcript
Diversity is Good Shibuya.swift #1 @nakajijapan Introducing to PhotoSlider for
swift
About Me
@nakajijapan Software Engineer GMO PEPABO inc. iOS / Web /
OS X
None
GitHub
Talk about
PhotoSlider
Talk about • ެ։ • ͳͥ࡞ͨ͠ͷ͔ • ӡ༻ϑΣʔζ • εϫΠϓͰআͰ͖ΔΑ͏ʹͳΔ·Ͱ
• Ճͷௐ • ͬͱؾ࣋ͪྑ͘ • ެ։͔ͯ͠ΒͷԠ
Why?
PhotoSlider • ༷ʑͳձࣾͰར༻͞Ε͍ͯΔը૾ʹϑΥʔΧεͨ͠ɺݟΔઐ༻ͷը໘ • ͚ͦͬͳ͍ • ଞͱมΘΒͳ͍ • ͬͱྑ͍ײ͡ʹ͍ͨ͠
PhotoSlider • OSSʹࣅͨΑ͏ͳͷͳ͍ͷ͔
PhotoSlider 193
PhotoSlider 30
PhotoSlider • OSSʹࣅͨΑ͏ͳͷͳ͍ͷ͔ • IDMPhotoBrowser • Facebook, TwitterͷΠϯλϥΫγϣϯΛऔΓೖΕͯྑͦ͞͏ • MWPhotoBrowserͷੜܥ
• εϫΠϓͰআ͢ΔඍົͳΞχϝʔγϣϯ͕ؾʹ৯Θͳ͍ • ϝϯς͞Ε͍ͯͳ͍… • ྑ͍ײ͡ͷͷ͕ͳ͍
SwiftͰʂ
Release as OSS
Maintenance • ΠϯλϥΫγϣϯͷվળ • CollectionView • εΫϩʔϧͷͰը໘Λআ͍ͨ͠ • PhotoSliderʹը໘ભҠ࣌ͷΞχϝʔγϣϯ(Transition) •
؆୯ͳUI Testingಋೖ • ϦϦʔε࣌ͷόʔδϣχϯά
CollectionView ಋೖࣦഊ
*NBHF CollectionViewಋೖࣦഊ • ࣮؆୯ʹͰ͖ͨ • εΫϩʔϧ࣌ʹࢦͱϏϡʔʹ͕ࠩग़͖ͯͨ *NBHF
CollectionViewಋೖࣦഊ
CollectionViewಋೖࣦഊ • ScrollViewͰ࡞Γ͠ • ͨͩ͜Ε͚ͩͩͱCollectionViewͱಉ͡ݱʹͳΔ *NBHF *NBHF *NBHF *NBHF *NBHF
*NBHF CollectionViewಋೖࣦഊ • ScrollViewΛ͛Δ • ҧײͳ͍εΫϩʔϧ͕࣮ݱͰ͖Δ *NBHF *NBHF *NBHF *NBHF
ScrollView ্ԼʹεϫΠϓͰ͖Δ͔ͷΑ͏ʹ͢Δ
CollectionViewಋೖࣦഊ • ͔ͨ͠͠ΒUIPangestureRecognizerར༻͢ΕUIScrollView͛ͳ͘ ࣮ͯݱͰ͖͔ͨ͠Εͳ͍ɻɻɻ
ScrollViewʹมߋ
εΫϩʔϧͷ ՃͰClose
εΫϩʔϧͷͰআ • ΑΓײతͳΠϯλϥΫγϣϯ͕͍ͨ͠ • UIScrollView͕ϓϩύςΟͱͯ͠UIPanGestureRecognizerΛ͍࣋ͬͯΔ scrollView.panGestureRecognizer.velocityInView(scrollView) GVODWFMPDJUZ*O7JFX @WJFX6*7JFX $(1PJOU 6*1BO(FTUVSF3FDPHOJ[FS
εΫϩʔϧͷͰআ • ΑΓײతͳΠϯλϥΫγϣϯ͕͍ͨ͠ • UIScrollView͕ϓϩύςΟͱͯ͠UIPanGestureRecognizerΛ͍࣋ͬͯΔ let velocity = scrollView.panGestureRecognizer.velocityInView(scrollView) GVODWFMPDJUZ*O7JFX
@WJFX6*7JFX $(1PJOU 6*1BO(FTUVSF3FDPHOJ[FS
εΫϩʔϧͷͰআ 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) } } }
ViewController Transitions
ViewController Transitions 7JFX$POUSPMMFS "OJNBUPS6*7JFX$POUSPMMFS"OJNBUFE5SBOTJUJPOJOH 7JFX$POUSPMMFS
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) }
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) } } }
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 }
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 }
RMPZoomTransitionAnimator
ViewController Transitions • @_mpon͞Μ͔Βհ͞Εͯ࡞Γͨ͘ͳͬͨ • ͲͬΓࢀߟʹ͍͖ͤͯͨͩ͞·ͨ͠
Versioning
Versioning • Versioning͢Δͱ͖ͷ࡞ۀ • xxx.podspecͷόʔδϣϯมߋ • git tag x.x.x •
ҙ֎ͱͩΔ͍ͷͰbumpͷpodspec൛࡞ͬͨ(RubyͰ) • ࣮ɻɻɻ
@azu͞Μ͕npmͰग़͍ͯͨ͠
Versioning • Versioning͢Δͱ͖ͷ࡞ۀ • xxx.podspecͷόʔδϣϯมߋ • git tag x.x.x •
ҙ֎ͱͩΔ͍ͷͰbumpͷpodspec൛࡞ͬͨ(RubyͰ) • RubyͰ͍͍͋ͬͯΜ
Subsequently
Subsequently • ެ։͔ͯ͠ΒΆͪΆͪStar͕૿͑࢝Ίͨ • ཁ͕དྷΔΑ͏ʹͳͬͨ • ϲ݄ͯ͠pull request͕དྷΔΑ͏ʹͳͬͨ • ಓʹमਖ਼ΒճΒ
• ͬͯ͘Ε͍ͯΔͱ͍͏ϞνϕʔγϣϯͰܧଓத
Subsequently • Test • UI Testingͷ͓͔͛ͰUI ܥͷϓϥάΠϯͰςετ͕Ͱ͖Δʂ • Travis CIͰ͚͜Δͷ͕Α͘Θ͔ͬͯͳ͍
Conclusion
Diversity is Good
Enjoy OSS
We are hiring!!! http://pepabo.com/recruit/career/#jobs ⚠ ⚠
Thanks.