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
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
5.3k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
370
オフライン勉強会ぼっち対策
akatsuki174
1
540
Xcode 15の新機能
akatsuki174
0
2.5k
AndroidにもSelect Photosがやってきた
akatsuki174
0
1.1k
Famm Android改善記
akatsuki174
0
330
Flutterアプリ開発にネイティブコードはどこまで求められるのか
akatsuki174
2
4.2k
UIKitのアップデート #WWDC22
akatsuki174
4
1.2k
職能/職種横断でチームの生産性を高める
akatsuki174
2
5.7k
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
390
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
220
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
400
Jakarta EE meets AI
ivargrimstad
1
550
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
0
410
マルチモジュールにおけるテスト最適化
fxwx23
0
210
私のEbitengineの第一歩
qt_luigi
0
450
REXML改善のその後
naitoh
0
190
Increased Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
430
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
150
unique パッケージから学ぶ interning と weak reference @ Asakusa.go#3
karamaru
2
820
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
7
1.5k
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
39
2.3k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Producing Creativity
orderedlist
PRO
340
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Six Lessons from altMBA
skipperchong
26
3.4k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
Why Our Code Smells
bkeepers
PRO
334
56k
Practical Orchestrator
shlominoach
185
10k
Clear Off the Table
cherdarchuk
91
320k
YesSQL, Process and Tooling at Scale
rocio
167
14k
What's new in Ruby 2.0
geeforr
340
31k
Web Components: a chance to create the future
zenorocha
309
42k
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”Ͱݕࡧ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ