Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Diversity is Good
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
nakajijapan
October 23, 2015
430
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.1k
Markdownをリアルタイムに解析する
nakajijapan
5
4.6k
Firebase Authorization
nakajijapan
0
330
Intoducing Izumo
nakajijapan
1
2k
Practical CloudKit
nakajijapan
1
1.9k
Introducing to Ajimi - プロダクトを味見していこう
nakajijapan
0
2.4k
Shari
nakajijapan
1
3k
Japan Apple Pay Development
nakajijapan
0
330
業務で絶対必要にならない技術
nakajijapan
0
890
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
7k
Speed Design
sergeychernyshev
33
1.8k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
420
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
250
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Statistics for Hackers
jakevdp
799
230k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
The Spectacular Lies of Maps
axbom
PRO
1
800
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
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.