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
Build complication in SwiftUI の要約
Search
Ryo Tsuzukihashi
July 09, 2020
Programming
0
670
Build complication in SwiftUI の要約
Build complication in SwiftUIの要約
WWDC20セッション要約会
Ryo Tsuzukihashi
July 09, 2020
Tweet
Share
More Decks by Ryo Tsuzukihashi
See All by Ryo Tsuzukihashi
二次元コードを読み取りやすくするために 画面を強制的に明るくするのは もうやめにしませんか?👀
tsuzuki817
0
380
動画だけじゃない!iOS 15のピクチャ・イン・ピクチャを使って好きなUIを表示させよう!
tsuzuki817
3
4k
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
2
1k
Complications and widgets: Reloadedの要約
tsuzuki817
1
1.1k
Speech framework tips
tsuzuki817
1
2.5k
SwiftUI で Neumorphism!!!
tsuzuki817
2
1.8k
SwiftUIで作りながら学ぶアニメーション インジケーター編
tsuzuki817
0
560
Other Decks in Programming
See All in Programming
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
2
160
선언형 UI에서의 상태관리
l2hyunwoo
0
150
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
Symfony Mapper Component
soyuka
2
730
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
Haze - Real time background blurring
chrisbanes
1
510
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
440
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
良いユニットテストを書こう
mototakatsu
5
2k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
RailsConf 2023
tenderlove
29
940
Bash Introduction
62gerente
608
210k
Typedesign – Prime Four
hannesfritz
40
2.4k
Optimising Largest Contentful Paint
csswizardry
33
3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
97
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Transcript
!UTV[VLJ 3ZP5TV[VLJIBTIJ #VJMEDPNQMJDBUJPOJO4XJGU6* ͷཁ 88%$ηογϣϯཁձ
͓ॻ͖ NJO w ࣗݾհ w ⚠ҙࣄ߲⚠ w ίϯϓϦέʔγϣϯͱʁ w $PNQMJDBUJPOY4XJGU6*
w $PNQMJDBUJPO5FNQMBUF w ϓϨϏϡʔ w Τϥʔ Ҿ༻IUUQTTVQQPSUBQQMFDPNKBKQHVJEFXBUDIBQEFCXBUDIPT
ࣗݾհ w :BIPP+"1"/ w 1BZ1BZϑϦϚJ04ΞϓϦ w 5XJUUFS !UTV[VLJ w
ݸਓΞϓϦ։ൃ͕झຯ ࠷ۙʮ4LZ$PEFʯͱ͍͏ΞϓϦ͕όζΓ w ͖ͳXBUDIGBDF ΠϯϑΥάϥϑϞδϡϥʔ
⚠ҙࣄ߲⚠ w ։ൃڥ 9DPEFCFUB XBUDI04CFUB w γϛϡϨʔλͰಈ࡞֬ೝ ࣮ػͩͱίϯϓϦέʔγϣϯ͕ਖ਼͘͠දࣔ͞Εͳ͔ͬͨ w ͍ΖΜͳ͕͠ΒΈͰ࣮ࡍʹಈ͔͍ͯ͠ΔεΫγϣ͕ແ͍Ͱ͢
ޱ಄ͷઆ໌ؤுΓ·͢ʂ
ίϯϓϦέʔγϣϯͱʁ
ίϯϓϦέʔγϣϯͱʁ w ΞϓϦʹؔ͢ΔλΠϜϦʔͰؔ࿈ੑͷߴ͍ใΛΥονϑΣΠεʹදࣔ Ҿ༻IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPODMPDLLJU
$PNQMJDBUJPOY4XJGU6* w ίϯϓϦέʔγϣϯΛ4XJGU6*Ͱ࡞ΕΔΑ͏ʹͳͬͨ w ϓϨϏϡʔͷػೳ͕ڧ͍ w 4XJGU6*ͷԸܙΛड͚ΕΔ
GraphicCorner ▪CLKComplicationTemplateGraphicCornerCircularView ▪CLKComplicationTemplateGraphicCornerGaugeView ▪CLKComplicationTemplateGraphicCornerTextView GraphicCircular ▪CLKComplicationTemplateGraphicCircularView ▪CLKComplicationTemplateGraphicCircularStackViewT ext ▪CLKComplicationTemplateGraphicCircularClosedGaug eView
▪CLKComplicationTemplateGraphicCircularOpenGauge View GraphicRectangular ▪CLKComplicationTemplateGraphicRectangularFullVie w ▪CLKComplicationTemplateGraphicRectangularLargeVi ew ▪CLKComplicationTemplateGraphicRectangularTextGa ugeView ▪CLKComplicationTemplateGraphicRectangularStandar dBodyView ExtraLargeCircular ▪CLKComplicationTemplateGraphicExtraLargeCircular View ▪CLKComplicationTemplateGraphicExtraLargeCircular StackViewText ▪CLKComplicationTemplateGraphicExtraLargeCircular ClosedGaugeView ▪CLKComplicationTemplateGraphicExtraLargeCircular OpenGaugeView $PNQMJDBUJPO5FNQMBUF ߹ܭݸՃ
1SFWJFX దͳ7JFXΛ࡞Δ import SwiftUI struct SampleGraphicRectangular: View { @State var
gaugeValue: CGFloat = 3 var body: some View { VStack { Text("SwiftѪձ") Gauge(value: gaugeValue, in: 1...15) { Image(systemName: "drop.fill") .foregroundColor(.green) } currentValueLabel: { Text("\(gaugeValue, specifier: "%.1f")") } .gaugeStyle(LinearGaugeStyle( tint: Gradient(colors: [.orange, .yellow, .green, .blue, .purple]) )) } } }
1SFWJFX ઌ΄ͲͷViewΛwatchOSͷίϯϓϦέʔγϣϯͱͯ͠ϓϨϏϡʔ w $-,$PNQMJDBUJPOςϯϓϨʔτ4XJGU6*ͷ7JFXͦͷͷͰͳ͍ͷͰɺ୯ ମͰϓϨϏϡʔ͢Δ͜ͱ͕Ͱ͖ͳ͍ CLKComplicationTemplateͱpreviewContext Ͱղܾʂ
1SFWJFX w $MPDL,JUͱ4XJGU6*ΛJNQPSU w $PNQMJDBUJPO5FNQMBUFɺͦΕͧΕͷXBUDIGBDFͰදࣔ FY$-,$PNQMJDBUJPO5FNQMBUF(SBQIJD$JSDVMBS7JFX ˠΠϯϑΥάϥϑϞδϡϥʔ
struct SampleGraphicRectangular_Previews: PreviewProvider { static var previews: some View {
Group { CLKComplicationTemplateGraphicCornerCircularView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicCircularView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicRectangularFullView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicExtraLargeCircularView(SampleGraphicRectangular ()) .previewContext() } } }
֤1SFWJFXͷදࣔ 1SFWJFX
1SFWJFX GBDFDPMPS w XBUDIGBDFΛςʔϚΧϥʔΛม͑Δ͜ͱ͕Ͱ͖Δ w ϓϨϏϡʔͰ؆୯ʹ֬ೝͰ͖·͢ w QSFWJFX$POUFYU GBDF$PMPSHSFFO
1SFWJFX $PNQMJDBUJPO3FOEFSJOH.PEF w XBUDIGBDFͷGBDF$PMPSʹΑͬͯίϯϓϦέʔγϣϯͷݟͨΛมߋ͍ͨ͠ ߹ʹҎԼͷΑ͏ʹDPNQMJDBUJPOͷ3FOEFSJOH.PEF͕ڥม͔ΒऔΕ ·͢ͷͰͦΕΛར༻͢Δ͜ͱͰରԠͰ͖·͢ʂ @Environment(\.complicationRenderingMode) var mode FOVN$PNQMJDBUJPO3FOEFSJOH.PEF
DBTFGVMM$PMPS DBTFUJOUFE
Τϥʔ ৽͘͠Ճ͞ΕͨศརͳΤϥʔ w $PNQMJDBUJPO$POUSPMMFSͷHFU$VSSFOU5JNFMJOF&OUSZʢʣ $PNQMJDBUJPOGBNJMZͱҟͳΔλΠϓͷ5FNQMBUF͕બ͞Ε͍ͯͨ߹ %BUBIBOEMFSDBMMFEXJUIJODPNQBUJCMFUFNQMBUFGPSDPNQMJDBUJPOGBNJMZ &YQFDUFEUFNQMBUFGPS$-,$PNQMJDBUJPO'BNJMZ(SBQIJD$JSDVMBS CVU SFDFJWFEPOFGPS$-,$PNQMJDBUJPO'BNJMZ(SBQIJD$PSOFS