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
ユニバーサルアプリの理想と現実: Yahoo! JAPAN MeetUp #2
Search
kazuhiro4949
September 08, 2016
Technology
7
1.1k
ユニバーサルアプリの理想と現実: Yahoo! JAPAN MeetUp #2
Yahoo! JAPAN MeetUp #2 (iOS) の時の発表資料です。
http://yj-meetup.connpass.com/event/38348/
kazuhiro4949
September 08, 2016
Tweet
Share
More Decks by kazuhiro4949
See All by kazuhiro4949
SwiftUIをUIKitのライフサイクルで拡張するTips
kazuhiro4949
4
2.5k
iOS15でプッシュ通知のテストが大変だった話
kazuhiro4949
0
560
Source Editor Extensionと SwiftSyntaxでコード自動生成ツール を作る
kazuhiro4949
2
3.6k
iOS 12サポート終了で使えるAPIおさらい
kazuhiro4949
2
320
Source Editor ExtensionとSwiftSyntaxでコード自動生成
kazuhiro4949
0
70
大企業の最前線でコードを書き続けるためにやってきたこと
kazuhiro4949
28
19k
10分で振り返るここ数年のWWDCの技術トレンド
kazuhiro4949
0
270
コードを書きながら同時に設計していくためのiOSアプリ開発方針
kazuhiro4949
6
2.5k
身近な技術的課題から始めるOSSプロジェクト
kazuhiro4949
0
260
Other Decks in Technology
See All in Technology
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.8k
Mastering Quickfix
daisuzu
1
310
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
250
Taming you application's environments
salaboy
0
200
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
130
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
130
Engineer Career Talk
lycorp_recruit_jp
0
200
OS 標準のデザインシステムを超えて - より柔軟な Flutter テーマ管理 | FlutterKaigi 2024
ronnnnn
1
310
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
7
710
電話を切らさない技術 電話自動応答サービスを支える フロントエンド
barometrica
1
190
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Why Our Code Smells
bkeepers
PRO
334
57k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Transcript
݄ ,B[VIJSP)BZBTIJ ϢχόʔαϧΞϓϦ ͷཧͱݱ࣮ :BIPP+"1"/.FFU6Q
ࣗݾհ ྛ߂ ͔ͣ͠ͻΖ HJUIVC!LB[VIJSP RJJUB!LB[VIJSP UXJUUFSॾࣄͰౚ݁த ˙͓ࣄ w:BIPPγϣοϐϯά
wJ04ΞϓϦ wUW04ΞϓϦ
ΞϓϦͷϢχόʔαϧԽʹ͍ͭͯ Λ͠·͢
͍ҙຯͰͷϢχόʔαϧΞϓϦͷΑΓͪΐͬͱڱ͍ൣғΛѻ͍·͢ w͞ͳ͍͜ͱ wࠃࡍԽ%ZOBNJD5ZQFͳͲ w͢͜ͱ wը໘αΠζʹΑΔσβΠϯͷҧ͍
̍ͷ-BOETDBQFɾ1PSUSBJUΛߟ͑ΕΑ͔ͬͨ ग़య: https://developer.apple.com/videos/play/wwdc2016/222/
ͨ͘͞ΜͷαΠζΛߟ͑Δඞཁ͕͋Δ ग़య: https://developer.apple.com/videos/play/wwdc2016/222/
ը໘αΠζ ͲΜͲΜଟ༷Խ͍ͯ͠Δ
"EBQUJWF6*
88%$l#VJMEJOH"EBQUJWF"QQTXJUI6*,JUz wJ04Ҏ߱ͷϞμϯͳ։ൃํ๏ ͱͯ͠ɺz"EBQUJWF6*zͷ֓೦ Λߏங wσόΠεɾճసɾϏϡʔαΠζ ͷଟ༷ੑʹڞ௨ͷΫϥεͰରԠ ग़య: https://developer.apple.com/videos/play/wwdc2014/216/
88%$l.BLJOH"QQT"EBQUJWF 1BSUɾ1BSUz w88%$ͷηογϣϯΛ ϕʔεʹz"EBQUJWF6*zΛ࣮ ΞϓϦద༻͢Δࡍͷ w࣮ફతʹͲ͏͍͏ઃܭɾ࣮Λ ߦ͑Α͍͔Λѻ͍ͬͯΔ ग़య: https://developer.apple.com/videos/play/wwdc2016/222/
"EBQUJWF6*Λࢧ͑Δ 6*,JUͷΈ
"EBQUJWF6*Λࢧ͑Δ6*,JUͷΈ w"VUP-BZPVU J04ʙ w6*5SBJU$PMMFDUJPO 4J[F$MBTT J04ʙ w6*4QMJU7JFX$POUSPMMFS
6*1SFTFOUBUJPO$POUSPMMFS J04ʙ w6*4UBDL7JFX J04ʙ
"VUP-BZPVU ग़య: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/ w 7JFXಉ࢜ͷ૬ରతͳִؒαΠζͷൺ Λઃఆ͢Δ͜ͱͰϨΠΞτܾఆͤ͞Δ w Ұ൪֎ଆͷΟϯυαΠζʹԠͯࣗ͡ ಈతʹͦΕͧΕͷ7JFXͷҐஔ͕ܭࢉ͞Ε
Δ w J04͔Β͑Δ
4J[F$MBTT w εΫϦʔϯαΠζͷҧ͍ΛநԽͨ͠ ͷ w ෯ͱߴ͞ͷαΠζʹ3FHVMBS $PNQBDU ͷछྨͷΧςΰϦΛఆٛ w
4UPSZCPBSE"TTFUT$BUBMPHͰ4J[F $MBTT୯Ґͷมߋ͕Մೳ w J04ҎલͰ͑ͳ͍ ग़య: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITraitCollection_ClassReference/
6*5SBJU$PMMFDUJPO wεΫϦʔϯαΠζɾσόΠεͷछྨɾ ղ૾ͳͲ͕7JFX$POUSPMMFSɾ 7JFX୯ҐͰ֨ೲ͞Εͨͷ wJ04Ҏ߱Ͱճసɾը໘ׂͳͲ Ͱ7JFXαΠζ͕มߋ͞ΕΔ߹ ͜ΕΛݟΔ ग़య: https://developer.apple.com/videos/play/wwdc2014/216/
6*4QMJU7JFX$POUSPMMFS w "EBQUJWFͳ7JFX$POUSPMMFS w .BTUFS%FUBJMߏͷը໘Ͱ༻Մೳ w 5SBJU$PMMFDUJPOͷύϥϝʔλʹΑͬͯ ݟͤํΛม͑ΒΕΔ w
J04ҎલJ1BEͷΈͰར༻Մ ग़య: https://developer.apple.com/videos/play/wwdc2014/216/
6*1SFTFOUBUJPO$POUSPMMFS w "EBQUJWFͳ1SFTFOUBUJPO w ϞʔμϧϏϡʔͷදࣔํ๏ΛΧελϚΠ ζͰ͖Δ w 5SBJU$PMMFDUJPOͷύϥϝʔλʹΑͬͯ ݟͤํΛม͑ΒΕΔ
w J04ҎલͰ͑ͳ͍ ग़య: https://developer.apple.com/videos/play/wwdc2014/216/
6*4UBDL7JFX w7JFXཁૉΛִؒͰฒΔ͜ ͱ͕Ͱ͖ΔศརΫϥε w4J[F$MBTT୯ҐͰִؒฒ ํΛઃఆͰ͖Δ wJ04Ҏ߱Ͱͳ͍ͱ͑ͳ͍ ग़య: https://developer.apple.com/videos/play/wwdc2015/218/
ͦΕΒͷΈΛ߹Θͤͯ͜͏͍ͬͨΞϓϦΛ࡞Δ͜ͱ͕Ͱ͖Δ wͻͱͭͷ7JFX$POUSPMMFSΛ ͍ͳ͕Βҧͬͨը໘ΛݟͤΔ͜ ͱ͕Ͱ͖Δ w"QQMF͕ਪ͢Δzܕzʹ·ͬ ͨܗͰ"EBQUJWF6*͕࣮ݱͰ ͖Δ ग़య: https://developer.apple.com/videos/play/wwdc2014/216/
ݱ࣮ͷʹ ͖߹͏
࣮ͰؔΘΔΞϓϦͬͱ͍͜͠
࣮ͰؔΘΔΞϓϦͬͱ͍͜͠ wݹ͍04ͷαϙʔτ
࣮ͰؔΘΔΞϓϦͬͱ͍͜͠ wݹ͍04ͷαϙʔτ wαʔϏεಠࣗͷσβΠϯ֓೦
࣮ͰؔΘΔΞϓϦͬͱ͍͜͠ wݹ͍04ͷαϙʔτ wαʔϏεಠࣗͷσβΠϯ֓೦ w։ൃϦιʔεεϐʔυͱͷ݉Ͷ߹͍
࣮ͰؔΘΔΞϓϦͬͱ͍͜͠ wݹ͍04ͷαϙʔτ wαʔϏεಠࣗͷσβΠϯ֓೦ w։ൃϦιʔεεϐʔυͱͷ݉Ͷ߹͍ ଟ༷ͳσόΠε࠷దԽ͍ͨ͠ ؾ࣋ͪͱͷᷤ౻
αʔϏεͷࣄʹ߹Θͤͨ Ћͷ͕ඞཁ
ϙΠϯτ ߇͑ΊͳมߋͰ ຊ࣭తͳҧ͍ʹཹΊΔ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ J1IPOFͷσβΠϯ͜ΕͰ͍͍ͱͯ͠J1BEͲ͏͢Δʁʁ ΤϯδχΞ σβΠφ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ J1IPOFͷσβΠϯ͜ΕͰ͍͍ͱͯ͠J1BEͲ͏͢Δʁʁ ͏ʔΜʜͦ͏͍͑ʜ ΤϯδχΞ σβΠφ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ ͜ͷػೳJ1BE༻ͷσβΠϯ࣮Ͱ͖ͦ͏ʁ σΟϨΫλʔ ΤϯδχΞ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ ͜ͷػೳJ1BE༻ͷσβΠϯ࣮Ͱ͖ͦ͏ʁ ೲظ͕ۙ͘ɺ༨༟͕ແ͍ͷͰJ1BEͰ͜ͷػೳΓ·͢ʜ σΟϨΫλʔ ΤϯδχΞ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ ͦ͏͍͑J1BEճస࣌ͷಈ࡞֬ೝ͢ΔͷΪϦΪϦ·ͰΕͯͨ ΤϯδχΞ
ʑͷ։ൃۀͰ͏͔ͬΓى͖ͯ͠·͍͕ͪͳ͜ͱ ͋ΕʁJ1BE൛ʹ͜ͷػೳͳ͍ͱ͍͏༷Ͱਖ਼ղͳΜ͚ͩͬʜ σΟϨΫλʔ
αʔϏεΛఏڙ͠ଓ͚ΒΕΔϓϩμΫτΛࢦ͢ wେݪଇͱͯ͠J1IPOFͱJ1BEͰίʔυΛڞ༗͢Δ wۃྗɺશσόΠεɾ04Ͱػೳ༷Λ౷Ұ͠ɺݟ͚ͨͩม͑Δ wͱΓ͋͑ͣJ1IPOFͷීٴͰૉૣ͘σβΠϯΛܾΊͯ͠·͏ wେମͷέʔεͰ͔ͦ͜Β"VUPMBZPVUͰԣʹ৳ͨ͠Γɺ SFBEBCMF$POUFOU(VJEFͰϚʔδϯΛ࡞ͬͨΓ͢Δͷ͕ແ
αʔϏεΛఏڙ͠ଓ͚ΒΕΔϓϩμΫτΛࢦ͢ ͨͩ͠ ΤϯδχΞͱͯ͠ͷ ཧɺ σόΠεຖʹ࠷దԽ͞ΕͨϓϩμΫτΛఏڙ͍ͨ͠ wେݪଇͱͯ͠J1IPOFͱJ1BEͰίʔυΛڞ༗͢Δ wۃྗɺશσόΠεɾ04Ͱػೳ༷Λ౷Ұ͠ɺݟ͚ͨͩม͑Δ wͱΓ͋͑ͣJ1IPOFͷීٴͰૉૣ͘σβΠϯΛܾΊͯ͠·͏ wେମͷέʔεͰ͔ͦ͜Β"VUPMBZPVUͰԣʹ৳ͨ͠Γɺ
SFBEBCMF$POUFOU(VJEFͰϚʔδϯΛ࡞ͬͨΓ͢Δͷ͕ແ
ϙΠϯτ 6*5BCMF7JFX͔Β 6*$PMMFDUJPO7JFXͰͷ࣮มߋ
6*$PMMFDUJPO7JFX w 6*5BCMF7JFXʹൺͯϨΠΞτͷ ࣗ༝͕ߴ͍ w ෳࡶͳը໘Ληϧ Ϟδϡʔϧ ʹ Ͱ͖Δ
w J04͔Β͑Δ 4UBDL7JFXͩͱ J04Ҏ͔߱͑͠ͳ͍
6*$PMMFDUJPO7JFX'MPX-BZPVUΛͬͯɺEFMFHBUFͰذͤ͞Δ ॳڃ func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath
indexPath: NSIndexPath) -> CGSize { switch (indexPath.section, indexPath.item) { case (0, 0) where traitCollection.userInterfaceIdiom == .Phone: return CGSize(width: aWidth, height: aHeight) case (0, 0) where traitCollection.userInterfaceIdiom == .Pad: return CGSize(width: aWidth / 2, height: aHeight) .. .. .. } }
6*$PMMFDUJPO7JFX'MPX-BZPVUΛͬͯɺEFMFHBUFͰذͤ͞Δ ॳڃ func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath
indexPath: NSIndexPath) -> CGSize { switch (indexPath.section, indexPath.item) { case (0, 0) where traitCollection.userInterfaceIdiom == .Phone: return CGSize(width: aWidth, height: aHeight) case (0, 0) where traitCollection.userInterfaceIdiom == .Pad: return CGSize(width: aWidth / 2, height: aHeight) .. .. .. } } J1IPOFͰ͋Ε͋Δ෯ΛऔΓɺJ1BEͰ͋ΕJ1IPOFͷ෯ͷʹ͢Δ
6*$PMMFDUJPO7JFX'MPX-BZPVUΛͬͯɺEFMFHBUFͰذͤ͞Δ ॳڃ
6*$PMMFDUJPO7JFX'MPX-BZPVUΛͬͯɺEFMFHBUFͰذͤ͞Δ ॳڃ w J1IPOFͰηϧΛॎʹ ฒΔ w J1BEͰηϧΛԣʹฒ Δ
6*$PMMFDUJPO7JFX'MPX-BZPVUΛܧঝͯ͠ɺϨΠΞτΫϥεͰذͤ͞Δ தڃ class GridLayout: UICollectionViewFlowLayout { enum DisplayMode {
case TwoColumns = 2 case FourColumns = 4 func estimatedWidth(viewWidth: CGFloat, space: CGFloat) -> CGFloat { return CGFloat(Int(viewWidth - space) /rawValue) } .. .. } .. .. }
6*$PMMFDUJPO7JFX'MPX-BZPVUΛܧঝͯ͠ɺϨΠΞτΫϥεͰذͤ͞Δ தڃ class GridLayout: UICollectionViewFlowLayout { enum DisplayMode {
case TwoColumns = 2 case FourColumns = 4 func estimatedWidth(viewWidth: CGFloat, space: CGFloat) -> CGFloat { return CGFloat(Int(viewWidth - space) /rawValue) } .. .. } .. .. } J1IPOFͰ͋ΕྻΛऔͬͯɺJ1BEͰ͋ΕྻΛऔΔΑ͏ʹ -BZPVUΫϥεͰFOVNΛ࡞Δ
6*$PMMFDUJPO7JFX'MPX-BZPVUΛܧঝͯ͠ɺϨΠΞτΫϥεͰذͤ͞Δ தڃ
6*$PMMFDUJPO7JFX'MPX-BZPVUΛܧঝͯ͠ɺϨΠΞτΫϥεͰذͤ͞Δ தڃ wJ1IPOFͰྻ wJ1BEͰྻ
J1IPOF༻ͱJ1BE༻ͷϨΠΞτΫϥεΛ࡞ͬͯΓସ͑Δ ্ڃ class UICollectionViewController { override func viewDidLoad() {
super.viewDidLoad() if traitCollection.userInterfaceIdiom == .Pad { collectionView?.collectionViewLayout = SectionSplitLayout(delegate: self) } else { collectionView?.collectionViewLayout = UICollectionViewFlowLayout() } } } ͜͜ͰۮηΫγϣϯΛࠨحηΫγϣϯΛӈฒΔϨΠΞτΫϥεΛ࡞ J1BEͷ͚࣌ͩͦͷಠ࣮ࣗͨ͠ϨΠΞτΫϥεΛೖΕΔ
J1IPOF༻ͱJ1BE༻ͷϨΠΞτΫϥεΛ࡞ͬͯΓସ͑Δ ্ڃ J1BE J1IPOF
J1IPOF༻ͱJ1BE༻ͷϨΠΞτΫϥεΛ࡞ͬͯΓସ͑Δ ্ڃ J1BE J1IPOF wJ1IPOFͰηΫγϣϯΛ ॎʹฒΔ wJ1BEͰۮηΫγϣϯ ΛࠨɺحηΫγϣϯΛ ӈʹஔ͢Δ
6*$PMMFDUJPO7JFXΛ͏͜ͱͰ w7JFX7JFX$POUSPMMFS͔ΒϨΠΞτͷΈΛΓͤΔ wը໘ύʔπͷΈ͑ʹΑͬͯɺʮը໘ͷ͞ͷҧ͍ʯʹ Ԡͨ͡࠷ݶͷมԽΛ༩͑Δࣄ͕Ͱ͖Δ
ϙΠϯτ 7JFX7JFX$POUSPMMFS͔Β ը໘αΠζґଘͷίʔυΛΓ͢
88%$Ͱਪ͞Εͨํ๏ w ֤7JFX$POUSPMMFSຖʹz%FTJHO0CKFDU Λ༻ҙ͢Δ w TUSVDUFOVNΛޮՌతʹ͏ w 7JFX$POUSPMMFSͰذ͢ΔͷͰͳ ͘ɺz%FTJHO0CKFDUzΧϓηϧԽ͢
Δ ग़య: https://developer.apple.com/videos/play/wwdc2016/233/
7JFX$POUSPMMFS͔Βʮ͠J1BEͳΒʯͱ͍͏ذΛΓ͢ enum LayoutContext { case DefaultScreen case WideScreen init(traitCollection:
UITraitCollection, size: CGSize) { if traitCollection.horizontalSizeClass == .Regular && size.width >= size.height { self = .WideScreen } else { self = .DefaultScreen } } var navigationBarTranslucent: Bool { switch self { case .DefaultScreen: return true case .WideScreen: return false } } }
7JFX$POUSPMMFSͰཧ͞ΕΔը໘ͷϨΠΞτύλʔϯ͕Θ͔Γ͘͢ͳΔ
7JFX$POUSPMMFSͰཧ͞ΕΔը໘ͷϨΠΞτύλʔϯ͕Θ͔Γ͘͢ͳΔ w ྫ͑ɺ͖ͬ͞ͷܕͷத ͰɺJ1IPOFಁ໌ɾ J1BEෆಁ໌ͷφϏήʔ γϣϯΛఆٛ͢Δɻ w 7JFX$POUSPMMFSͷ৭ ΜͳՕॴͰҧ͍͕ൃੜ͢
Δ߹ʹɺ͜ͷΑ͏ʹ Γग़͢ͱɺ༷͕·ͱ ·ͬͯΘ͔Γ͍͢
γεςϜ্ͷఆٛͱσβΠφɾσΟϨΫλ͔Βݟͨఆٛͷҧ͍Λٵऩ wྫ͑:BIPPγϣοϐϯάͰσβΠφͰҎԼͷׅΓͰΞϓϦσ βΠϯΛ࡞͍ͬͯΔ ߋʹ04ͷόʔδϣϯʹΑͬͯҧ͏͜ͱ͕͋Δ wJ1IPOF wJ1BEॎ wJ1BEԣ w6*5SBJU$PMMFDUJPOΛ͍ɺ4J[F$MBTTͱॎɾԣͷαΠζൺͰͭͷ
۠ผΛ͢Δɻͦͯͦ͠ͷҧ͍Λz%FTJHO0CKFDUzʹΧϓηϧԽ
·ͱΊ
·ͱΊ wJ1IPOF J1BEͰಉ͡ػೳɾαʔϏεΛఏڙ͠ଓ͚Δ͜ͱΛ ࢦ͢
·ͱΊ wJ1IPOF J1BEͰಉ͡ػೳɾαʔϏεΛఏڙ͠ଓ͚Δ͜ͱΛ ࢦ͢ wग़དྷΔݶΓ"QQMFͷෑ͍ͨϨʔϧʹΔ
·ͱΊ wJ1IPOF J1BEͰಉ͡ػೳɾαʔϏεΛఏڙ͠ଓ͚Δ͜ͱΛ ࢦ͢ wग़དྷΔݶΓ"QQMFͷෑ͍ͨϨʔϧʹΔ w͔ͦ͜Β֎ΕΔ߹ɺຊ࣭తͳมԽͷΈΛ࡞Δ
·ͱΊ wJ1IPOF J1BEͰಉ͡ػೳɾαʔϏεΛఏڙ͠ଓ͚Δ͜ͱΛ ࢦ͢ wग़དྷΔݶΓ"QQMFͷෑ͍ͨϨʔϧʹΔ w͔ͦ͜Β֎ΕΔ߹ɺຊ࣭తͳมԽͷΈΛ࡞Δ w͋·Γಠࣗ࿏ઢͰڽΔͱকདྷ͔ͳΓۤ͠Ή
ࢀߟࢿྉ w "EBQUJWF6TFS*OUFSGBDFT"QQMF%FWFMPQFS w 88%$4FTTJPO#VJMEJOH"EBQUJWF"QQTXJUI6*,JU w 88%$4FTTJPO.BLJOH"QQT"EBQUJWF 1BSU w 88%$4FTTJPO.BLJOH"QQT"EBQUJWF
1BSU
ऴΘΓ