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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masamichi Ueta
December 17, 2019
Programming
1.1k
3
Share
カンファレンスアプリをSwiftUIで作った
Flutter製のMTC2018アプリをSwiftUIで作り直した話です。
Masamichi Ueta
December 17, 2019
More Decks by Masamichi Ueta
See All by Masamichi Ueta
Recap of Spatial Computing
masamichi
1
640
メルペイのスケーラビリティを支えるマルチモジュール開発
masamichi
1
810
Cloning photos app fluid interface
masamichi
3
4.2k
Other Decks in Programming
See All in Programming
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
320
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.1k
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.8k
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
The Less-Told Story of Socket Timeouts
coe401_
3
950
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.6k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
490
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.6k
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
220
My daily life on Ruby
a_matsuda
3
180
Kingdom of the Machine
yui_knk
2
1.4k
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
290
Optimising Largest Contentful Paint
csswizardry
37
3.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
770
Utilizing Notion as your number one productivity tool
mfonobong
4
300
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
The Curse of the Amulet
leimatthew05
1
12k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
290
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
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