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.4k
「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
53
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
5.4k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
410
オフライン勉強会ぼっち対策
akatsuki174
1
590
Xcode 15の新機能
akatsuki174
0
2.6k
AndroidにもSelect Photosがやってきた
akatsuki174
0
1.3k
Famm Android改善記
akatsuki174
0
350
Flutterアプリ開発にネイティブコードはどこまで求められるのか
akatsuki174
2
4.6k
UIKitのアップデート #WWDC22
akatsuki174
4
1.3k
Other Decks in Programming
See All in Programming
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
Package Traits
ikesyo
1
210
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
return文におけるstd::moveについて
onihusube
1
1.4k
php-conference-japan-2024
tasuku43
0
430
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
KATA
mclloyd
29
14k
Automating Front-end Workflow
addyosmani
1366
200k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Scaling GitHub
holman
459
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Writing Fast Ruby
sferik
628
61k
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”Ͱݕࡧ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ