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
690
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftUIで作りながら学ぶアニメーション インジケーター編
SwiftUIで作りながら学ぶアニメーション インジケーター編
Qiitaに詳しい記事あげます。
Ryo Tsuzukihashi
February 12, 2020
More Decks by Ryo Tsuzukihashi
See All by Ryo Tsuzukihashi
GeoJSON×SwiftUI:地図を“美しく”描くための技術
tsuzuki817
0
30
AlarmKitで実現する 新時代のシステム通知
tsuzuki817
0
8.1k
SwiftUI Transaction を徹底活用!ZOZOTOWN UI開発での活用事例
tsuzuki817
1
3.5k
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
3
1.2k
二次元コードを読み取りやすくするために 画面を強制的に明るくするのは もうやめにしませんか?👀
tsuzuki817
0
490
動画だけじゃない!iOS 15のピクチャ・イン・ピクチャを使って好きなUIを表示させよう!
tsuzuki817
3
6.1k
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
2
1.1k
Complications and widgets: Reloadedの要約
tsuzuki817
1
1.5k
Speech framework tips
tsuzuki817
1
2.9k
Other Decks in Programming
See All in Programming
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
12
6k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
さぁV100、メモリをお食べ・・・
nilpe
0
150
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
210
Performance Engineering for Everyone
elenatanasoiu
0
210
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
140
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
AIで効率化できた業務・日常
ochtum
0
140
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
110
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
190
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Lessons from Spec-Driven Development
simas
PRO
0
220
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
370
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
310
Building Adaptive Systems
keathley
44
3.1k
How GitHub (no longer) Works
holman
316
150k
Crafting Experiences
bethany
1
190
Thoughts on Productivity
jonyablonski
76
5.2k
Visualization
eitanlees
152
17k
Context Engineering - Making Every Token Count
addyosmani
9
980
The Spectacular Lies of Maps
axbom
PRO
1
820
Writing Fast Ruby
sferik
630
63k
How to make the Groovebox
asonas
2
2.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
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*ͰΦϦδφϧΞχϝʔγϣϯΛͬͯ ΞϓϦΛϦονʹʂ