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
黒魔術AutoLayoutとiPhone 6/6 Plus
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shoby
October 03, 2014
Technology
4.3k
13
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
黒魔術AutoLayoutとiPhone 6/6 Plus
iOS 8 & iPhone6/6 Plus 開発知見共有会での発表資料です。
shoby
October 03, 2014
More Decks by shoby
See All by shoby
フリルのCMを支える分析 (メディアバイイング編)
shoby
0
510
FirebaseとBigQueryによるアプリのKPI分析(CMの効果検証編)
shoby
2
2.7k
ユーザーに受け入れられ、問題を起こしづらい大規模リニューアルの進め方
shoby
60
14k
ReactiveCocoaで作る快適な登録フォーム
shoby
0
380
フリルの商品を色で検索できるようにした話
shoby
5
4.4k
Search fashion items by colors
shoby
0
230
iOS 7をサポート対象外にして開発を健全化する
shoby
3
4.1k
Apple Watch Tips
shoby
0
4.4k
WWDC 2015で 発表された新機能と サービスへの活かし方
shoby
2
7.5k
Other Decks in Technology
See All in Technology
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
5
1.4k
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
210
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
270
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
190
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.2k
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
220
価値について
gree_tech
PRO
0
130
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
130
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
450
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
190
Metadata - Section 1: HTML Basics
mohab1
0
130
Running Kotlin + Quarkus with Lambda
nealle
1
4.1k
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Everyday Curiosity
cassininazir
0
360
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Prompt Engineering for Job Search
mfonobong
0
520
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Transcript
ࠇຐज़"VUP-BZPVUͱ J1IPOF1MVT @shobyshoby
ࣗݾհ pixivͰΞϓϦͭͬͯ͘·͢
ຊ
iOS 7 ࣌
Before
After
Storyboard͕ഁͨ͠ͷͰ ཧͯ͠AutoLayoutԽͨ͠ ৄࡉʮStoryboard + AutoLayoutόουϊϋʯͷεϥΠυ https://speakerdeck.com/shoby/storyboard-plus-autolayout-bad-knowhow
iOS 8
ʮXcode Beta 6 Ͱ͏·͘ಈ͍ͯΔ͠ɺ iOS 8 ָউͬ͢Θʔ ը໘େ͖͘ͳΔͬͯᷚ͋Δ͚Ͳɺ AutoLayoutରԠͯ͠Δ͠ɺ༨༟ͬ͠ΐʯ
iPhone 6/6 Plus ൃද
͏Θ͋͋͋͋
ࠇຐज़"VUP-BZPVUͱ J1IPOF1MVT
ը໘αΠζมߋͷରԠ͕ ͭΒ͔ͬͨ෦Λڞ༗͠·͢ ! Α͘ߟ͓͑ͯ͏ AutoLayout
֓ཁ
"VUP-BZPVUΞχϝʔγϣϯ "VUP-BZPVU 6*4DSPMM7JFX "VUP-BZPVUͷϝϯςφϯείετ
"VUP-BZPVU Ξχϝʔγϣϯ
AutoLayoutΞχϝʔγϣϯ "VUP-BZPVUͷ$POTUSBJOUΛ *#0VUMFUͰଓ $POTUSBJOUΛ6*7JFXͷ BOJNBUJPO#MPDLதͰมԽͤ͞Δ
Ξχϝʔγϣϯ
Ξχϝʔγϣϯͷίʔυ [UIView animateWithDuration:duration animations:^{ self.detailViewTopConstraint.constant = height; [self.view layoutIfNeeded]; }];
ϝϦοτ ίʔυྔ͕ݮΔ ୯Ұͷ7JFX͚ͩͳΒγϯϓϧ Ͱ͔Γ͍͢
σϝϦοτ ґଘؔΛ࣋ͬͨ7JFX͕ෳಉ࣌ʹมԽ͠ ͯ͠·͏ ґଘؔͷ͋Δผ7JFXͷϢʔβʔૢ࡞͕ ݪҼͰαΠζ͕มΘΔ͜ͱʜ BOJNBUJPO#MPDL֎ͰϨΠΞτͷ࠶ߏ ͕ߦΘΕΔͱΞχϝʔγϣϯ͠ͳ͍
"VUP-BZPVU 6*4DSPMM7JFX
6*4DSPMM7JFXͷϝϦοτɾ σϝϦοτ .JYFE"QQSPBDIͱ1VSF "VUP-BZPVU"QQSPBDI ԣ෯ґଘίʔυ
UIScrollViewͷ ϝϦοτɾσϝϦοτ
UIScrollView AutoLayoutʹ͍ͯͳ͍
ཧ༝͕ແ͚Ε UIPageViewController UICollectionViewΛΘΓʹ ͏ࣄΛߟ͑ͨํ͕ྑ͍
UIScrollViewͷϝϦοτ εΫϩʔϧɺϖʔδϯάɺζʔ ϜΛ݉Ͷඋ͑ͨଟػೳੑ εΫϩʔϧঢ়گʹ߹Θͤͨ ࡉ͔͍ϑΟʔυόοΫ͕Մೳ
UIScrollViewͷσϝϦοτ 6*4DSPMM7JFXͷ֎෦ͱ෦ͷ࠲ඪͷ Έ͕ҟͳΔͨΊɺ"VUP-BZPVU ʹΑͬͯԿ͕ى͔ͨ͜ཧղͮ͠Β͍ ෦ͷίϯςϯπΛಈతʹมԽͤ͞ Δ͜ͱ͕ଟ͘ɺ੩తʹ੍ΛՃ͢ Δ"VUP-BZPVUͱ૬ੑ͕ѱ͍
UIScrollViewͷ༻్ ଟ͘ͷใͷҰ෦ΛݟͤΔʢεΫϩʔϧʣ จ຺ಉ͚ͩ͡ͲɺͦΕͧΕҧ͏ίϯςϯ πΛͭͭݟͤΔʢϖʔδϯάʣ ͭͷڊେͳίϯςϯπͷҰ෦ΛݟͤΔ ʢζʔϜʣ
UIScrollViewͷସ ଟ͘ͷใͷҰ෦ΛݟͤΔʢεΫϩʔϧʣ ˠ6*5BCMF7JFXɺ6*$PMMFDUJPO7JFX จ຺ಉ͚ͩ͡ͲɺͦΕͧΕҧ͏ίϯςϯπΛͭ ͭݟͤΔʢϖʔδϯάʣ ˠ6*1BHF7JFX$POUSPMMFSɺ6*$PMMFDUJPO7JFX ͭͷڊେͳίϯςϯπͷҰ෦ΛݟͤΔʢζʔϜʣ ˠ͖͋ΒΊͯ6*4DSPMM7JFX͓͏ʜ
pixivΞϓϦͷ߹ ΠϥετӾཡͷͨΊͷ շదੑΛٻͨ݁͠Ռɺ UIScrollViewΛ͍ଓ͚͍ͯΔ
Mixed Approachͱ Pure Auto Layout Approach
UIScrollView And Autolayout https://developer.apple.com/library/ios/technotes/tn2154/_index.html ͍߹Θ͕ͤଟ͔ͬͨͷ͔ UIScrollViewˍAutoLayoutͷ ઐ༻υΩϡϝϯτ͕͋Δ
Mixed Approach TDSPMM7JFXͷ֎ଆʹ੍ TDSPMM7JFXͷDPOUFOU4J[FखಈͰઃఆ DPOUFOU7JFXBVUPSFTJ[JOH.BTL DPOUFOU7JFXΛಈతʹՃআͨ͠Γɺ ෳͷDPOUFOU7JFXΛѻ͏߹ͬͪ͜
Pure Auto Layout Approach TDSPMM7JFXͷ֎ଆͱɺதʹ੍ TDSPMM7JFXͷDPOUFOU4J[F੍ʹΑΓܾ ·ͬͨDPOUFOU7JFXͷαΠζʹͳΔ DPOUFOU7JFXͷαΠζɺTDSPMM7JFXͱ ֎ଆͱWJFXͷ੍ʴDPOUFOU7JFXͱ TDSPMM7JFXͱͷ੍ͷෳ߹݅Ͱܾ·Δͨ
ΊɺཧղࠔΛۃΊΔ
contentView scrollView contentView scrollView Mixed Approach Pure Auto Layout Approach
UIScrollViewͱ ԣ෯ґଘίʔυ
UIScrollViewͰ ԣํʹϖʔδϯά͢Δͱ σόΠεͷԣ෯ґଘʹͳΔ
Mixed Approachͷ߹ɺ contentViewੜޙ scrollViewͷԣ෯͕มΘΔͱ ද่͕ࣔΕΔ
2 1 3 4 pixivΞϓϦͷߏ
2 1 3 4 CGFloat offset = 2 * self.scrollView.frame.size.width;
self.scrollView.contentOffset = CGPointMake(offset, 0); 2ϖʔδʹඈͿͱ͖
2 1 3 4 scrollViewͷԣ෯͕มΘΔ CGFloat offset = 2 *
self.scrollView.frame.size.width; self.scrollView.contentOffset = CGPointMake(offset, 0);
ԣ෯ґଘίʔυͷղܾࡦ WJFXͷԣ෯͕มΘΔʹશͯ ͷDPOUFOU7JFXͷGSBNFΛܭ ࢉ͢͠ ԣ෯ґଘͷॲཧͷલʹɺ MBZPVU*G/FFEFEΛݺͼग़͢
"VUP-BZPVUͷ ϝϯςφϯείετ
AutoLayout ਓྨʹૣ͗ͨ͢…
ಡΊΔAutoLayout ίʔυଆͰ"VUP-BZPVUΛॻ ͘ͱϝϯςφϯεੑ͕ߴ͍ όʔδϣϯཧ͕Ͱ͖Δʂ ଞਓͷ੍͕ಡΊΔʂ
·ͱΊ
৽͍͠Ͱͷಈ࡞֬ೝɺൃද͞Εͨ ޙ͡Όͳ͍ͱ͍͠ "VUP-BZPVUΛͬͯΞχϝʔγϣϯΛ ͢Δͱίʔυ؆ܿʹͳΔ͕ɺґଘ͕ଟ ͍ͱෳࡶ 6*4DSPMM7JFX"VUP-BZPVUͩͱͭΒ͍ ίʔυଆͰ੍Λॻ͘ͱϝϯςφϯεͰ͖ Δ
http://recruit.pixiv.net/
͓͠·͍