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
940
カンファレンスアプリを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
530
メルペイのスケーラビリティを支えるマルチモジュール開発
masamichi
1
720
Cloning photos app fluid interface
masamichi
3
3.9k
Other Decks in Programming
See All in Programming
Recoilを剥がしている話
kirik
5
7.2k
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
120
Go の GC の不得意な部分を克服したい
taiyow
3
840
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
testcontainers のススメ
sgash708
1
130
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
280
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Haze - Real time background blurring
chrisbanes
1
520
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
970
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
110
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Gamification - CAS2011
davidbonilla
80
5.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Designing for Performance
lara
604
68k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
1
110
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
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