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のライブコーディングす るとxcodeが◯回落ちる
Search
notoroid
July 27, 2019
Programming
2
360
SwiftUIのライブコーディングす るとxcodeが◯回落ちる
SwiftUIが発表されたWWDC2019初期から間もないプレゼンテーション資料。beta版のxcodeで実際に実演したところ表題通りxcodeが途中終了してしまった。
notoroid
July 27, 2019
Tweet
Share
More Decks by notoroid
See All by notoroid
ZIPでくれ - Apple謹製 geocoding/ reverse geocoding
notoroid
0
33
WeatherKit iOS18 update - お天気の更新
notoroid
0
41
AppIntentsの用途 - AppleのGPT元年
notoroid
1
130
Privacy manifests - Appleと開発コミュニティ
notoroid
1
190
とっさのAutoLayout - Rewind autolayout
notoroid
0
80
UVC(USB video class)と マルチプラットフォーム - UVC support by Apple multiplatform
notoroid
0
300
SwiftUIむけに 整理された状態監視 Observation
notoroid
0
680
よせあつめSwift - Swift5.9
notoroid
1
640
Transferable - SwiftUI ドキュメントアプリ
notoroid
2
400
Other Decks in Programming
See All in Programming
testcontainers のススメ
sgash708
1
120
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
640
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
42 best practices for Symfony, a decade later
tucksaun
1
180
Discord Bot with AI -for English learners-
xin9le
1
120
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
180
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
CSC305 Lecture 26
javiergs
PRO
0
140
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
260
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Site-Speed That Sticks
csswizardry
2
190
Music & Morning Musume
bryan
46
6.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Speed Design
sergeychernyshev
25
670
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
What's in a price? How to price your products and services
michaelherold
243
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
4XJGU6*ͷϥΠϒίʔσΟϯά͢ ΔͱYDPEF͕̋ճམͪΔ ͜ΕͬͯτϦϏΞʹͳΓ·ͤΜ͔
ࣗݾհ
ೳొཁ !OPUPSPJE w J04ΞϓϦ։ൃऀ w ߸͍Γ·͢ిࢉاը w !OPUPSPJE w !JSJNBTV
w Fεϙʔπ
w 4XJGU6*ొ w 4XJGU6*ϥΠϒίʔσΟϯά w ·ͱΊ
͢ൣғ w 4XJGU6*5VUPSJBMTΛͬͨϥΠϒίʔσΟϯά w $SFBUJOHBOE$PNCJOJOH7JFXT w IUUQTEFWFMPQFSBQQMFDPNUVUPSJBMTTXJGUVJDSFBUJOHBOE DPNCJOJOHWJFXT w %SBXJOH1BUITBOE4IBQFT
w IUUQTEFWFMPQFSBQQMFDPNUVUPSJBMTTXJGUVJESBXJOHQBUIT BOETIBQFT
͞ͳ͍ൣғ w ը໘ભҠ w σʔλόΠϯσΟϯά w طଘ6*ͱͷΈ߹Θͤ w Ξχϝʔγϣϯ w
04͝ͱͷ4XJGU6*ͷద༻
4XJGU6*ొ
88%$ ։ൃऀʹΓࢁͷ༰
4XJGU6*
4XJGU6* w 4XJGUϕʔεͷ6*࡞ϑϨʔϜϫʔΫ w %4- ༻్ൣᙝݻ༗ݴޠ ͕4XJGUͰهड़Ͱ͖Δ w 4XJGUΛ%4-ʹدͤͨ w
6*Λߏ͢Δجຊఆٛ7JFX w 7JFXΛએݴత %FDMBSBUJWF ʹهड़Ͱ͖؆ܿͳهड़͕Մೳ
4XJGU6* w 4XJGUϕʔεͷ6*࡞ϑϨʔϜϫʔΫ w %4- ༻్ൣᙝݻ༗ݴޠ ͕4XJGUͰهड़Ͱ͖Δ w 4XJGUʹ༷ΛՃͯ͠%4-ʹدͤͯ͠·͏ w
6*Λߏ͢Δجຊఆٛ7JFX w 7JFXΛએݴత %FDMBSBUJWF ʹهड़Ͱ͖؆ܿͳهड़͕Մೳ
4XJGU6* w 4XJGUϕʔεͷ6*࡞ϑϨʔϜϫʔΫ w %4- ༻్ൣᙝݻ༗ݴޠ ͕4XJGUͰهड़Ͱ͖Δ w 4XJGUʹ༷ΛՃͯ͠%4-ʹدͤͯ͠·͏ w
6*Λߏ͢Δجຊఆٛ7JFX w 7JFXΛએݴత %FDMBSBUJWF ʹهड़Ͱ͖؆ܿͳهड़͕Մೳ Կ
એݴత %FDMBSBUJWF w ͋Δग़ྗΛಘΔʹ͋ͨͬͯͦΕΛ࡞͢Δํ๏Ͱͳ͘ɺग़ྗͷੑ࣭Λه ड़͢Δ͜ͱΛʮએݴܕʯͱশ͢Δ w એݴతϓϩάϥϛϯάͷʮએݴతʯͬͯʁ w
IUUQTTIIBUFOBEJBSZPSHFOUSZ w )5.-એݴత
"QQMFͱͯ͠
એݴతͳهड़ΛՄೳͱ͠ એݴతͳهड़ʹ׳Ε͍ͯΔ ࡞Γख 8FC։ൃऀ Λݺͼد͍ͤͨ
એݴతͳख๏Λఏڙ͢Δ͜ͱͰ ༷ʑͳ04 J04 NBD04 XBUDI04 Ͱ ಉ͡ख๏Λద༻Ͱ͖ΔΑ͏ʹ͍ͨ͠
"QQMFͷ4XJGU6*ಋೖ w એݴతͳهड़ΛՄೳͱ͠એݴతͳهड़ʹ׳Ε͍ͯΔ࡞ΓखΛݺͼد͍ͤͨ w એݴతͳख๏Λఏڙ༷͠ʑͳ04Ͱಉ͡ख๏Λద༻Ͱ͖ΔΑ͏ʹ͍ͨ͠ w *OUFSGBDFCVJMEFSͰͷ6*࡞͔ΒҎ্ܦͪٻΊΒΕΔͷΛఏڙ͠ ͨ
"QQMFͷ4XJGU6*ಋೖ w એݴతͳهड़ΛՄೳͱ͠એݴతͳهड़ʹ׳Ε͍ͯΔ࡞ΓखΛݺͼد͍ͤͨ w એݴతͳख๏Λఏڙ༷͠ʑͳ04Ͱಉ͡ख๏Λద༻Ͱ͖ΔΑ͏ʹ͍ͨ͠ w *OUFSGBDFCVJMEFSͰͷ6*࡞͔ΒҎ্ܦͪٻΊΒΕΔͷΛఏڙ͠ ͨ 8FC։ൃऀʹ·Ͱ։ൃऀͷؒޱΛ͛Δ
ैདྷͷ6*෦ 4UPSZCPBSE YJC Έ߹ΘͤՄೳ
04ʹ࠷దԽ͞ΕͨػೳΛ͜Ε·ͰͲ ͓ΓΞϓϦʹΈࠐΉ͜ͱͰ͖Δ
એݴతهड़ʹෳࡶͳػೳΛఏڙͰ͖Δ ͍͏ͱࢥ͍ग़͢
8FCϒϥβʔ 'MBTI લ
4XJGU6*ͱطଘ6*ϑϨʔϜϫʔΫڞଘ͠ ͭͭ4XJGU6*ͰϦϓϨʔεͰ͖Δ6* ؆ܿʹهड़Ͱ͖ΔΑ͏ʹͳΔ J04͔Βʜ
4XJGU6*ϥΠϒίʔσΟϯά
4XJGU6*؆ܿʹ هड़Ͱ͖Δͷ͕ڧΈ
ͱ͍͑ҙਤͨ͠ϨΠΞτ͕ ࡞Εͳ͚ΕʹͳΒͳ͍
ࠓճطଘͷ6*Λਅࣅͯ͠ΈΔ
ਅࣅ͢Δର λΠϦϯάϕʔεͷ6*
ਅࣅ͢Δ6*
(MPSJPVT#BUUFSZ w ·ͰͷόοςϦʔঢ়ଶΛͱഎܠ ৭Ͱݟ͘͢දࣔ w ΫϦʔϯͳΠϯλʔϑΣΠε w όοςϦʔঢ়ଶɺॆిঢ়ଶͷΈΛදࣔ w όοςϦʔ֬ೝ͍ͨ͠σόΠεΛট
w ·ͰొՄೳɻͭͷը໘Ͱ֬ೝͰ ͖·͢ɻ
࣮ࡍͷϨΠΞτΛݟͯΈΔ
None
ηϧ 4BGF"SFB·Ͱ ృΓͭͿ͠
None
όοςϦʔྔ ୯Ґ ࣌ؒຖάϥϑ ॆిঢ়ଶ ໊ ԁάϥσʔγϣϯ
(MPSJPVT#BUUFSZͷϨΠΞτ w ηϧ w ηϧຖʹόοςϦʔใ w ηϧͷഎ໘ʹάϥσʔγϣϯ w ηϧ4BGF"SFBΛग़͍ͯΔ
YDPEFͷ ςϯϓϨʔτ͔ΒσβΠϯΛ ͚ۙͮͯΈΔ
ϨΪϡϨʔγϣϯ w ϑΥϯταΠζ w ϑΥϯταΠζP⒎TFU w ϑΥϯτશମΦϑηοτ w άϥσʔγϣϯΧϥʔ
w $PMPS SFE HSFFO CMVF w άϥσʔγϣϯΧϥʔ w $PMPS SFE HSFFO CMVF w ԁάϥσʔγϣϯ։࢝ܘQYɺऴྃܘQY w ϓϩδΣΫτ໊.POJUPS w ΧελϜ7JFXɺ$POUFOU7JFXɺ.POJUPS7JFXɺ(SBQI7JFXΛ༻
7JFX
import SwiftUI struct ContentView: View { var body: some View
{ Text("Hello World") } } #if DEBUG struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } #endif 4XJGU6*ͷςϯϓϨʔτίʔυ 7JFXCPEZͰͭͷ7JFXΛੜ ͨ͠એݴΛ͢ඞཁ͕͋Δɻ
ΈࠐΈ7JFXੜ 5FYU *NBHF -JOFBS(SBEJFOU 3BEJBM(SBEJFOU 3FDU"OHMF $JSDMF &MMJQTF (FPNFUSZ3FBEFS "OHVMBS(SBEJFOU
$BQTVMF
ෳͷ7JFXΛஔ͢Δ߹ɺ 4UBDL )4UBDL 74UBDL ;4UBDL
)4UBDL HStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }
ᶃ ᶄ ᶅ هड़ॱʹࠨ͔Βӈʹஔ ᶃ ᶄ ᶅ
74UBDL VStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }
ᶃ ᶄ ᶅ هड़ॱʹ্͔ΒԼʹஔ ᶃ ᶄ ᶅ
;4UBDL ZStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }
ᶃ ᶄ ᶅ هड़ॱʹԞʹஔ ᶃ ᶄ ᶅ
4UBDLͷஔ7JFXଆʹαΠζ ࢦఆ͕ͳ͍ݶΓഒஔ
٧ΊࠐΉ߹ 4QBDFS Λࢦఆ
7JFXFEHFT*HOPSJOH4BGF"SFB Λ ͏ͱ4BGF"SFBΛແࢹ͢ΔΑ͏ʹͳΔ
4UBDL )4UBDL 74UBDL )4UBDL Λ Θͳͯ͘ஔͰ͖Δ
7JFXʹஔ
7JFXʹஔ
CBDLHSPVOECPEZͷDMJQϑΟϧλʔʹ Өڹ͢Δɻ
CBDLHSPVOE7JFXDMJQ ͷ ݁Ռ͕ө͞ΕΔ
Rectangle() .fill( Color.clear ).background( എܠඳը͢ΔView ) .clipped()
ϥΠϒίʔσΟϯάத
Ϧιʔε w ϑΥϯταΠζ w ϑΥϯταΠζP⒎TFU w ϑΥϯτશମΦϑηοτ w άϥσʔγϣϯΧϥʔ
w άϥσʔγϣϯΧϥʔ
RadialGradient(gradient: .init(colors: [Self.gradientStart, Self.gradientEnd]), center: .init(x: 0.5, y: 0.5), startRadius:
50, endRadius: 150) .aspectRatio(contentMode: .fill) static let gradientStart = Color(red: 102.0 / 255, green: 196.0 / 255, blue: 66.0 / 255) static let gradientEnd = Color(red: 87.0 / 255, green: 161.0 / 255, blue: 58.0 / 255) // .previewDevice(PreviewDevice(rawValue: "iPhone 8") ) .previewDevice(PreviewDevice(rawValue: "iPhone X") )
import SwiftUI struct GraphView: View { var body: some View
{ HStack(spacing:0) { ForEach(0 ..< 12) { item in GraphLineView() } Spacer() } } } #if DEBUG struct GraphVioew_Previews: PreviewProvider { static var previews: some View { GraphView() // .previewDevice(PreviewDevice(rawValue: "iPhone 8") ) .previewDevice(PreviewDevice(rawValue: "iPhone X") ) } } #endif struct GraphLineView: View { var body: some View { ZStack { // Rectangle() // .foregroundColor(Color.green) ForEach(0 ..< 12 ) { item in GeometryReader { geometry in Path { path in let verticalOffset = 0.5 + (item == 0 ? 0 : (geometry.size.height * 0.2)) path.move( to: CGPoint( x: 0.5 + CGFloat(item) * 2.5, y: verticalOffset ) ) path.addLine( to: CGPoint( x: 0.5 + CGFloat(item) * 2.5, y: 0.5 + geometry.size.height ) ) } .stroke(Self.strokeColor, lineWidth: 1) } } }.frame(width:29.5, height:20) } static let strokeColor = Color(white: 1, opacity: 0.8) }
·ͱΊ w 4XJGU6*4XJGUͰهड़Ͱ͖Δ%4-Ͱ͋Δ4XJGUιʔείʔυͰ͢ w ͿΓʹ"QQMF͕ॏ͍ࠊΛ্͛ͯ৽͍͠։ൃऀͷݺͼࠐΈத w 4XJGU6*ͷϨΠΞτ8FCͷσβΠϯʹ͍͚ۙͲΫη͋Γ w 4XJGU6*ྲྀ͠ࠐΉσʔλιʔε͋Γ͖ͳͷͰϞοΫΞοϓ༻ͷσʔλ ४උͨ͠΄͏͕͍͍͔