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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
今時のフルスタック主導の iOSアプリ開発
nakajijapan
0
360
サービスにおける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
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Why Our Code Smells
bkeepers
PRO
340
58k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
370
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
420
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Music & Morning Musume
bryan
48
7.4k
WENDY [Excerpt]
tessaabrams
14
39k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Cost Of JavaScript in 2023
addyosmani
55
10k
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.