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
1k
カンファレンスアプリを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
600
メルペイのスケーラビリティを支えるマルチモジュール開発
masamichi
1
780
Cloning photos app fluid interface
masamichi
3
4.1k
Other Decks in Programming
See All in Programming
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
290
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
5
7.4k
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
AIを駆使して新しい技術を効率的に理解する方法
nogu66
1
650
Patterns of Patterns (and why we need them)
denyspoltorak
0
110
r2-image-worker
yusukebe
1
180
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
530
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
10
5.2k
Atomics APIを知る / Understanding Atomics API
ssssota
1
170
[SF Ruby Conf 2025] Rails X
palkan
0
310
Doc Translate - LLMを活用したコードドキュメント自動翻訳VSCode拡張機能
eycjur
0
100
Private APIの呼び出し方
kishikawakatsumi
3
900
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
970
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Speed Design
sergeychernyshev
33
1.2k
Navigating Team Friction
lara
190
16k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
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