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
WeatherKit iOS18 update - お天気の更新
notoroid
0
37
AppIntentsの用途 - AppleのGPT元年
notoroid
1
120
Privacy manifests - Appleと開発コミュニティ
notoroid
1
180
とっさのAutoLayout - Rewind autolayout
notoroid
0
71
UVC(USB video class)と マルチプラットフォーム - UVC support by Apple multiplatform
notoroid
0
280
SwiftUIむけに 整理された状態監視 Observation
notoroid
0
650
よせあつめSwift - Swift5.9
notoroid
1
620
Transferable - SwiftUI ドキュメントアプリ
notoroid
2
390
整理されたSwift言語仕様 - Swift 5.7 any/some
notoroid
1
960
Other Decks in Programming
See All in Programming
CSC509 Lecture 09
javiergs
PRO
0
140
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
役立つログに取り組もう
irof
28
9.6k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
190
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
RubyLSPのマルチバイト文字対応
notfounds
0
120
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Docker and Python
trallard
40
3.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Building Adaptive Systems
keathley
38
2.3k
How STYLIGHT went responsive
nonsquared
95
5.2k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Side Projects
sachag
452
42k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Code Reviewing Like a Champion
maltzj
520
39k
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*ྲྀ͠ࠐΉσʔλιʔε͋Γ͖ͳͷͰϞοΫΞοϓ༻ͷσʔλ ४උͨ͠΄͏͕͍͍͔