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
「iOSエンジニアだし、Androidアプリも作れるでしょ?」
Search
akatsuki174
September 20, 2020
Programming
9
3.3k
「iOSエンジニアだし、Androidアプリも作れるでしょ?」
2020/09/20 iOSDC Japan 2020 day 1
akatsuki174
September 20, 2020
Tweet
Share
More Decks by akatsuki174
See All by akatsuki174
SwiftUI、UIKitでキャプチャを撮ろう!
akatsuki174
1
34
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
5.4k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
390
オフライン勉強会ぼっち対策
akatsuki174
1
570
Xcode 15の新機能
akatsuki174
0
2.5k
AndroidにもSelect Photosがやってきた
akatsuki174
0
1.2k
Famm Android改善記
akatsuki174
0
340
Flutterアプリ開発にネイティブコードはどこまで求められるのか
akatsuki174
2
4.4k
UIKitのアップデート #WWDC22
akatsuki174
4
1.2k
Other Decks in Programming
See All in Programming
C++でシェーダを書く
fadis
6
4.1k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
RubyLSPのマルチバイト文字対応
notfounds
0
120
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Side Projects
sachag
452
42k
Speed Design
sergeychernyshev
24
610
A designer walks into a library…
pauljervisheath
203
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Navigating Team Friction
lara
183
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Designing Experiences People Love
moore
138
23k
Transcript
ʮiOSΤϯδχΞͩ͠ɺ AndroidΞϓϦ ࡞ΕΔͰ͠ΐʁʯ iOSDC Japan 2020 @akatsuki174
ࣗݾհ
• ਢ౻ຘʢ@akatsuki174ʣ • iOS→AndroidΤϯδχΞ • גࣜձࣾTimersॴଐ • ࠷ۙiOSࣄͰͬͯΔ • Αͬͯ͘ΔɺiPhone
Xͱ Pixel 3 • iOSDC Japan 2020 core staff
ࠓͷ
࣍ • iOS/AndroidͷUIͰҧ͏ͱ͜Ζ • Swiftͱൺֱͭͭ͠KotlinΛֶ΅͏ • ActivityɺFragmentΛཧղ͠Α͏ • Α͘͏ListViewͱRecyclerViewΛΖ͏ •
؆୯ͳUI͕ΊΔΑ͏ʹͳΖ͏ • ࠷ݶͷσόοά͕Ͱ͖ΔΑ͏ʹͳΖ͏
ͳΜͱͳ͘Ͱ͖ΔΑ͏ʹͳΔ͜ͱ • iOS/Androidͷҧ͍͕Θ͔Δ • Kotlinίʔυ͕ಡΊΔΑ͏ʹͳΔ • AndroidΞϓϦͷ࡞Γํ͕Θ͔Δ • ෆ۩߹ͷಛఆ͕Ͱ͖ΔΑ͏ʹͳΔ
ࠓͷࢿྉ
ࠓͷࢿྉ • SpeakerDeckʹ্͛ͯ·͢ • TwitterͰྲྀͯ͠·͢
iOS/AndroidͷUIͰ ҧ͏ͱ͜Ζ
ࣅͯΔ͚Ͳɺҧ͏ • iOS/AndroidͰࣅͯΔͷʹ͍ͭͯઆ໌ • ࣅͯͯࡉ෦͕ҟͳ͍ͬͯͨΓ͢ΔͷͰ҆қ ʹஔ͖͑ΒΕͳ͍͜ͱ
ը໘ભҠ • iOS • ϓογϡભҠ͕ج࣠ɻ֊Λ۷ΔΠϝʔδɻ • ঢ়گʹΑͬͯɺϞʔμϧભҠ • Android •
ϖʔδΛੵΈॏͶΔΠϝʔδɻ
ΔϘλϯͷ༗ແ • iOS • ΄΅ඞ͍͍ͣͭͯΔ • Android • ͍ͭͯͳ͍͜ͱ͋Δ •
ʹΔϘλϯ͕͋Δ
J04 "OESPJE
ը໘λΠτϧͷҐஔ • iOS • தԝ • ϥʔδλΠτϧͩͱࠨ • Android •
ࠨ
J04 "OESPJE
ཁૉબ • iOS • ϦετɺυϥϜϩʔϧɺΞΫγϣϯγʔτ • Android • νΣοΫϘοΫεɺϥδΦϘλϯɺυϩοϓ μϯϦετɺϘτϜγʔτ
J04 "OESPJE
Ϧετͷҹ • iOS • Disclosure IndicatorΛ͚ͨΓ͢Δ • Android • ͚ͳ͍ํ͕Ұൠతʁ
J04 "OESPJE
બ • iOS • υϥϜϩʔϧ • iOS 14͔ΒΧϨϯμʔܕ • Android
• ΧϨϯμʔܕ
"OESPJE J04
ϑϩʔςΟϯάΞΫγϣϯϘλϯ • ͦͷը໘ͷओΞΫγϣϯϘλϯ • iOSͰ͍ͬͯΔྫͪΒ΄Β
None
γϟυ • ϚςϦΞϧσβΠϯʹӨͷষ͕͋Δ • Z࣠ɺಈ͖ͷํΛ֮ͤ͞Δ • Өͷೱ͞ߴ͞ɺଞͱͷؔʹΑܾͬͯ·Δ
https://material.io/design/environment/light-shadows.html#shadows ᶃ ᶄ ᶅ
φϏήʔγϣϯυϩϫʔ • iOS • كʹͦΕͬΆ͍ͷ͕͋Δ • Android • ը໘ࠨ͔ΒεϥΠυͯ͠දࣔͰ͖Δϝχϡʔ
None
ࢀߟʹͳΔαΠτ • consim • iOS/Androidͷը໘ΛൺֱͰ͖ΔαΠτ • https://consim.design/ • ʮAndroidiOSͱಉ͡σβΠϯͰʂʯͱݴΘΕͨͱ͖ͷ ରԠҊ
• https://qiita.com/ogapants/items/ 8a551ed3b16bcf0cc3ed
Swiftͱൺֱͭͭ͠ KotlinΛֶ΅͏
Kotlinͱ • JetBrains͕։ൃͨ͠ΦϒδΣΫτࢦɹɹɹ ϓϩάϥϛϯάݴޠ • Google I/O 2017ͰAndroidνʔϜ͕KotlinΛ ެࣜʹαϙʔτ͢Δ͜ͱΛൃද •
Javaͷࢿ࢈ͷଟ͘Λྲྀ༻Ͱ͖Δ • 1ͭͷϓϩδΣΫτʹJavaͱKotlinͷࠞࡏՄ
KotlinͱSwift • ΘΓͱॻ͖ํ͕ࣅͯΔ • جຊจ๏Ͱࣅ͍ͯΔͷΛհ
ϓϩύςΟએݴ
Φϓγϣφϧ
Ξϯϥοϓ
ؔ
ྻૢ࡞
Ϋϥε֦ு
ΠϯλʔϑΣʔεɺϓϩτίϧ
ͦͷଞ
ActivityɺFragmentΛ ཧղ͠Α͏
ActivityͱFragment • MVCͰݴ͏ͱ͜ΖͷControllerΈ͍ͨͳͷ • ϥΠϑαΠΫϧΛ͍࣋ͬͯΔ
Activityͱ • ௨ৗɺ1ͭͷActivityͰ1ͭͷը໘Λ࣮͢Δ • ≒ UIViewController
https://developer.android.com/guide/components/ activities/activity-lifecycle?hl=ja
"DUJWJUZ ੜ࣌ "DUJWJUZ͔ΒΕΑ ͏ͱ͍ͯ͠ΔɻӬଓԽॲཧ ͜͜Ͱɻ Ϣʔβ͕ΠϯλϥΫ γϣϯΛ࣮ࢪͰ͖Δঢ়ଶ "DUJWJUZ͕ ݟ͑ͳ͘ͳͬͨͱ͖ https://developer.android.com/guide/components/
activities/activity-lifecycle?hl=ja
ActivityͷϨΠΞτ • Activity#onCreate(Bundle)ͷதͰ Activity#setContentView(int)Λݺͼग़͢ • intϨΠΞτϑΝΠϧͷid
Fragmentͱ • ActivityʹΈࠐΜͰ͏ • 1ͭͷActivityʹෳͷFragmentΛΈ߹Θͤɹ ΒΕΔ • ଟղ૾ରԠ࣌ʹศར • ෳͷActivityͰFragmentΛ࠶ར༻Ͱ͖Δ
https://developer.android.com/guide/ components/fragments?hl=ja#Creating
https://developer.android.com/guide/ components/fragments?hl=ja#Creating 'SBHNFOU͕ "DUJWJUZʹ Έࠐ·Εͨঢ়ଶ 'SBHNFOU ͕࣋ͭ 7JFXΛߏங 'SBHNFOU ͕"DUJWJUZ͔Β
Γ͞ΕΔ
https://developer.android.com/guide/components/fragments?hl=ja#Design
Α͘͏ListViewͱ RecyclerViewΛΖ͏
ListViewͱ • Androidͷॳظ͔Β༻ҙ͞Ε͍ͯΔΫϥε • γϯϓϧͳҰཡදࣔ
ొਓͷΠϝʔδ %BUB4PVSDF "EBQUFS -JTU7JFX $VSTPS "SSBZ-JTU FUD
ListViewʢ࣮ʣ
ListViewʢϨΠΞτʣ
RecyclerViewͱ • ListViewΛ֦ுͯ͠ॊೈੑΛͨͤͨվྑ൛ • εϫΠϓɺD&DͳͲΛ͢ΔͳΒͬͪ͜ • ϔομʔɺϑολʔͷΈଘࡏ͠ͳ͍ • ۠ΓઢࣗͰ࣮͢Δඞཁ͕͋Δ
ొਓͷΠϝʔδ %BUB4PVSDF "EBQUFS 7JFX)PMEFS 3FDZDMFS7JFX -BZPVU.BOBHFS
RecyclerViewʢຊମʣ
RecyclerViewʢAdapterʣ
RecyclerViewʢViewHolderʣ
RecyclerViewʢϨΠΞτʣ
RecyclerViewʢϨΠΞτʣ
؆୯ͳUI͕ ΊΔΑ͏ʹͳΖ͏
AndroidͷϨΠΞτͷ࡞Γํ • xmlͰهड़ɺ͘͠GUIͰ࡞ ʢStoryboard, xibΈ͍ͨͳ͔Μ͡ʣ • ͍ͣΕʹͯ͠xml͕ੜ͞ΕΔ
None
None
None
LayoutsͱWidgets • LayoutͰΛࢦఆ͠ɺ෦ͱͳΔWidgetΛɹ ฒ͍ͯ͘ • WidgetʹButton, ImageView, TextView, ListViewͳͲ͕͋Δ
-BZPVU 8JEHFU -BZPVU
͞·͟·ͳϓϩύςΟ • LayoutɺWidgetiOSͱಉ͡Α͏ʹɺ༷ʑͳɹ ઃఆΛՃ͑Δ͜ͱ͕Ͱ͖Δ • ͪΖΜLayout/WidgetʹΑͬͯઃఆͰ͖Δɹ ϓϩύςΟҟͳΔ • ͜͜ͰදతͳͷΛհ
id • ݴ༿௨Γɺࣝผࢠ • ಉҰϑΝΠϧͰҰҙͳ໊લʹͳ͍ͬͯΕɹ ྑ͍ • xmlͰৼͬͨidΛݩʹKotlinϑΝΠϧ͔Βݺͼɹ ग़͕͠Ͱ͖Δ
None
None
width/height • ݴ༿௨Γɺ෯ͱߴ͞ • `match_parent`ͩͱͷViewʹର͍ͯͬ͠ͺ͍ ʹ͕Δ • `wrap_content`༰ʹ߹Θͤͯௐઅ͞ΕΔ • ͪΖΜઈରࢦఆՄ
None
ओͳLayoutͷछྨ • LinearLayout • ॎorԣ1ྻʹཁૉΛฒΔ • UIStackViewͬΆ͍͔Μ͡ • ConstraintLayout •
ཁૉʹ੍Λ͚ɺҐஔΛ૬ରతʹܾΊΔ
None
None
None
None
None
͓·͚ɿϓϨϏϡʔTips
༨ஊɿJetpack Compose • Google I/O 2019Ͱൃද͞ΕͨɺUIπʔϧΩοτ • SwiftUIͷΑ͏ʹɺએݴతʹUIΛߏஙͰ͖Δ
https://developer.android.com/jetpack/compose?hl=ja
࠷ݶͷσόοά͕ Ͱ͖ΔΑ͏ʹͳΖ͏
2௨Γհ • ϒϨʔΫϙΠϯτΛுΔํ๏ • Ϗϡʔ֊ΛѲ͢Δํ๏
ϒϨʔΫϙΠϯτͷுΓํ
None
None
None
͜Μͳέʔε͋Γ·ͤΜ͔ʁ • RecyclerViewͷpositionͳͲɺมΘΓΏ͘Λ Ѳ͍ͨ͠ • ͍͍ͪͪϒϨʔΫϙΠϯτͰࢭ·ͬͯ΄͘͠ɹ ͳ͍ • ίʔυʹLog.dॻ͍ͯ࠶Ϗϧυ͢Δͷ໘
ղܾͰ͖·͢ • Evaluate and logΛ׆༻͢Ε࠶Ϗϧυͤͣɹ ϩάΛग़ྗͰ͖Δ • ίʔυ͍͡Δඞཁ͕ͳ͍
None
None
None
Ϗϡʔ֊ͷݟํ • Layout InspectorΛ͏
None
·ͱΊ
·ͱΊ • iOSͷੈքΛ͍ͬͯΕAndroidͦ͜·Ͱɹ ͘͠ͳ͍ʂʂʂ
એ
• αʔόʔαΠυΤϯδχΞ (PHP, Golang, AWS) • AndroidΤϯδχΞ (Kotlin) • iOSΤϯδχΞ
(Swift) TimersͰݱࡏΤϯδχΞશ৬छ࠾༻தʂ ৄ͘͠”Timers”Ͱݕࡧ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ