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
870
カンファレンスアプリを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
470
メルペイのスケーラビリティを支えるマルチモジュール開発
masamichi
1
680
Cloning photos app fluid interface
masamichi
3
3.8k
Other Decks in Programming
See All in Programming
ドメイン駆動設計の実践
masuda220
PRO
17
5.1k
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
DynamoDB コスト最適化っぽいことの基本 with Terraform
kuro_kurorrr
2
250
CSC307 Lecture 10
javiergs
PRO
0
310
はしめてのプログラミングとロボット制御
watawatavoltage
0
290
Mastering Developer Experience: A Roadmap for Success 【開発生産性Conference 2024】
findyinc
1
380
CSC307 Lecture 11
javiergs
PRO
0
240
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
Google's Recipe for Scaling (Web) Security – LocoMocoSec 2024
lweichselbaum
0
170
Activities at Cairo Library
cairolibrary720
0
1.2k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
20
1.3k
How STYLIGHT went responsive
nonsquared
93
5k
Imperfection Machines: The Place of Print at Facebook
scottboms
262
13k
Speed Design
sergeychernyshev
9
270
Bash Introduction
62gerente
607
210k
Raft: Consensus for Rubyists
vanstee
134
6.5k
Designing for Performance
lara
604
67k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
GitHub's CSS Performance
jonrohan
1026
450k
From Idea to $5000 a Month in 5 Months
shpigford
377
46k
Typedesign – Prime Four
hannesfritz
37
2.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
17
1.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