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
Ryo Tsuzukihashi
February 12, 2020
Programming
0
570
SwiftUIで作りながら学ぶアニメーション インジケーター編
SwiftUIで作りながら学ぶアニメーション インジケーター編
Qiitaに詳しい記事あげます。
Ryo Tsuzukihashi
February 12, 2020
Tweet
Share
More Decks by Ryo Tsuzukihashi
See All by Ryo Tsuzukihashi
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
0
11
二次元コードを読み取りやすくするために 画面を強制的に明るくするのは もうやめにしませんか?👀
tsuzuki817
0
400
動画だけじゃない!iOS 15のピクチャ・イン・ピクチャを使って好きなUIを表示させよう!
tsuzuki817
3
4.3k
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
2
1k
Complications and widgets: Reloadedの要約
tsuzuki817
1
1.2k
Speech framework tips
tsuzuki817
1
2.6k
Build complication in SwiftUI の要約
tsuzuki817
0
690
SwiftUI で Neumorphism!!!
tsuzuki817
2
1.8k
Other Decks in Programming
See All in Programming
Domain-Driven Transformation
hschwentner
2
1.9k
テストをしないQAエンジニアは何をしているか?
nealle
0
130
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
120
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
730
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
370
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
230
CI改善もDatadogとともに
taumu
0
110
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
昭和の職場からアジャイルの世界へ
kumagoro95
1
350
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.1k
Unity Android XR入門
sakutama_11
0
140
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
35
1.6k
Statistics for Hackers
jakevdp
797
220k
GitHub's CSS Performance
jonrohan
1030
460k
The World Runs on Bad Software
bkeepers
PRO
67
11k
The Pragmatic Product Professional
lauravandoore
32
6.4k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
540
Code Review Best Practice
trishagee
66
17k
How STYLIGHT went responsive
nonsquared
98
5.3k
The Cult of Friendly URLs
andyhume
78
6.2k
Rails Girls Zürich Keynote
gr2m
94
13k
A better future with KSS
kneath
238
17k
Transcript
4XJGU6*㗧Ъ㘊㗪㗌㘉䕎㗶㘕㘾㙔㖽㘪㙚㙦 㘗㙦㘫㘤㖽㘲㖽ᇜ QPUBUPUJQT !UTV[VLJ
ࣗݾհ w ϠϑʔJ04ΤϯδχΞ w ೖࣾͷ৽ଔ w 1BZ1BZϑϦϚJ04 w #POpSFJ04ӡӦ w
झຯݸਓΞϓϦυοτֆ ॳొஃͰۓுத
ΰʔϧ
࡞Ζ͏ struct ContentView: View { var body: some View {
Circle() .trim(from: 0, to: 0.6) .stroke(Color.green, lineWidth: 8) .frame(width: 48, height: 48) } }
ʁ
StrokeStyle( lineWidth: CGFloat, lineCap: CGLineCap, lineJoin: CGLineJoin, miterLimit: CGFloat, dash:
[CGFloat], dashPhase: CGFloat ) StrokeStyle
lineCap . round . square . butt
dash [ઢͷ͞, ۭനͷ͞, 2൪ͷઢͷ͞, 2൪ͷۭനͷ͞, ...] ഁઢͷܗঢ়ΛྻͰࢦఆ͠·͢ɻ .stroke(Color.green, style: StrokeStyle(
lineWidth: 8, lineCap: .round, dash: [0.1, 16]))
rotationEffect(_:anchor:) func rotationEffect( _ angle: Angle, anchor: UnitPoint = .center)
-> some View Circle() . . . .rotationEffect( Angle(degrees: self.isAnimation ? 360 : 0) ) @State var isAnimation = false
.onAppear() { withAnimation( Animation .linear(duration: 1) .repeatForever(autoreverses: false)) { self.isAnimation.toggle()
} } @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) public func withAnimation<Result>( _ animation: Animation? = .default, _ body: () throws -> Result) rethrows -> Result XJUI"OJNBUJPO @@
default linear easeIn easeOut easeInOut
άϦϯϐʔεΛଔۀ
AngularGradient(gradient: Gradient(colors: [.gray, .white]) άϥσʔγϣϯ Gradient(colors: [.gray, .white]) άϥσʔγϣϯ͍ͤͨ͞৭ͷྻͭҎ্⭕ w-JOFBS(SBEJFOUઢܗάϥσʔγϣϯ
w"OHVMBS(SBEJFOUԁܗάϥσʔγϣϯ w3BEJBM(SBEJFOU์ঢ়άϥσʔγϣϯ
None
StrokeStyle( lineWidth: 8, lineCap: .round, dash: [0.1, 16], dashPhase: 8)
) ഁઢͷ։࢝ҐஔΛͣΒ͢ʂ
Circle() .trim(from: 0, to: 0.6) .stroke( AngularGradient( gradient: Gradient(colors: [.gray,
.white]), center: .center), style: StrokeStyle( lineWidth: 8, lineCap: .round, dash: [0.1, 16], dashPhase: 8)) .frame(width: 48, height: 48) .rotationEffect( Angle(degrees: self.isAnimation ? 360 : 0)) .onAppear() { withAnimation( Animation .linear(duration: 1) .repeatForever(autoreverses: false)) { self.isAnimation.toggle() } }
None
None
4XJGU6*ͰΦϦδφϧΞχϝʔγϣϯΛͬͯ ΞϓϦΛϦονʹʂ