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
カンファレンスアプリをSwiftUIで作った
Search
Masamichi Ueta
December 17, 2019
Programming
3
930
カンファレンスアプリをSwiftUIで作った
Flutter製のMTC2018アプリをSwiftUIで作り直した話です。
Masamichi Ueta
December 17, 2019
Tweet
Share
More Decks by Masamichi Ueta
See All by Masamichi Ueta
Recap of Spatial Computing
masamichi
1
520
メルペイのスケーラビリティを支えるマルチモジュール開発
masamichi
1
710
Cloning photos app fluid interface
masamichi
3
3.9k
Other Decks in Programming
See All in Programming
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
CSC509 Lecture 11
javiergs
PRO
0
180
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
620
最新TCAキャッチアップ
0si43
0
190
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
190
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Unsuck your backbone
ammeep
668
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Happy Clients
brianwarren
98
6.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Documentation Writing (for coders)
carmenintech
65
4.4k
A Tale of Four Properties
chriscoyier
156
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
KATA
mclloyd
29
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Transcript
ΧϯϑΝϨϯεΞϓϦ ΛSwiftUIͰ࡞ͬͨ Masamchi Ueta potatotips #67
ࣗݾհ • ্ాխಓ(Masamichi Ueta) • GitHub(@masamichiueta), Twitter(@masamichiueta) • ϝϧϖΠ iOS
None
Mercari Tech Conf 2018 ΞϓϦ
SwiftUI
OSS ✓ MVVM ✓ μʔΫϞʔυ ✓ ϩʔΧϥΠζ ✓ AppleͰαΠϯΠϯ https://github.com/mercari/mtc2018-app-SwiftUI
Widget → View Container( padding: EdgeInsets.fromLTRB(8.0, 4.0, 12.0, 8.0), decoration:
BoxDecoration( borderRadius: BorderRadius.circular(100.0), border: const Border( top: const BorderSide(width: 1.0, color: kMtcSecondaryRed), left: const BorderSide(width: 1.0, color: kMtcSecondaryRed), bottom: const BorderSide(width: 1.0, color: kMtcSecondaryRed), right: const BorderSide(width: 1.0, color: kMtcSecondaryRed), )), child: Text(" # $tag", style: TextStyle(color: kMtcSecondaryRed) )
Widget → View struct TagView: View { let tag: String
let color: Color var body: some View { Text("# \(tag)") .foregroundColor(color) .font(.system(size: 14)) .padding(EdgeInsets(top: 4, leading: 8, bottom: 6, trailing: 8)) .background(Color.clear) .overlay(RoundedRectangle(cornerRadius: 100).stroke(lineWidth: 1).foregroundColor(color)) } }
ಉ͡Row͔Βෳͷը໘ʹભҠ ͢Δʹʁ
List + NavigationLink NavigationView { List(0..<10) { _ in VStack
{ NavigationLink(destination: Text("NavigationLink1")) { Text("NavigationLink1") } NavigationLink(destination: Text("NavigationLink2")) { Text("NavigationLink2") } } } }
None
ScrollView+NavigationLink NavigationView { ScrollView { ForEach(0..<10) { _ in VStack
{ NavigationLink(destination: Text("NavigationLink1")) { Text("NavigationLink1") } NavigationLink(destination: Text("NavigationLink2")) { Text("NavigationLink2") } Divider() } } } }
None
PageView PageView([ ScrollView(.vertical, showsIndicators: true) { ForEach(viewModel.trackASessions, id: \.id) {
session in VStack { TimeTableRow(session: session) Divider() } } }, ScrollView(.vertical, showsIndicators: true) { ForEach(viewModel.trackBSessions, id: \.id) { session in VStack { TimeTableRow(session: session) Divider() } } } ], currentPage: $page)
PageView+pop… • ެࣜνϡʔτϦΞϧͷPageView • Interfacing with UIKit • https://developer.apple.com/tutorials/swiftui/interfacing- with-uikit
• NavigationLinkΛஔ͍ͯPop͢ΔͱXcode11.2.1ͰΫϥογϡ • ͱࢥͬͨΒXcode11.3ͰΫϥογϡ͠ͳ͘ͳ͍ͬͯͨ(Trying to pop to a missing destinationͱ͍͏ϝοηʔδग़Δ)
ͦͷଞ • ϦϞʔτը૾ͷऔಘɺΩϟογϡ • MVVMʢࢀߟ: https://github.com/kitasuke/SwiftUI-MVVM • WebViewʢWKWebViewʣ • ActivityIndicator
ײ • SwiftUI࡞Γ͔ͬͨ͢(Declarative, Component) • ίϯϙʔωϯτΓͳ͍ɺࢥΘ͵ಈ࡞Λ͢Δ߹͕͋Δ • Flutterͷํ͕νϡʔτϦΞϧίϯϙʔωϯτ͕ॆ࣮ͯ͠ ͍ͨͷͰɺ࡞Γ͔ͬͨ͢ؾ͕͢Δ •
SwiftUIͬͱαϯϓϧTips͕ग़͖ͯͯཉ͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠ • FlutterMTC2018ΞϓϦΛSwiftUIͰϦϥΠτͨ͠ʢϝ ϧΧϦ ΞυϕϯτΧϨϯμʔ7ʣby @jollyjoaster • https://tech.mercari.com/entry/2019/12/07/090000 • mercari/mtc2018-app-SwiftUI
• https://github.com/mercari/mtc2018-app-SwiftUI