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
460
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
今時のフルスタック主導の iOSアプリ開発
nakajijapan
0
380
サービスにおけるDesign Systemの構築
nakajijapan
11
4.2k
Markdownをリアルタイムに解析する
nakajijapan
5
4.8k
Firebase Authorization
nakajijapan
0
360
Intoducing Izumo
nakajijapan
1
2.1k
Practical CloudKit
nakajijapan
1
1.9k
Introducing to Ajimi - プロダクトを味見していこう
nakajijapan
0
2.5k
Shari
nakajijapan
1
3.1k
Japan Apple Pay Development
nakajijapan
0
350
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Raft: Consensus for Rubyists
vanstee
142
7.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
GitHub's CSS Performance
jonrohan
1033
470k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
860
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
610
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
610
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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.