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
630
SwiftUIで作りながら学ぶアニメーション インジケーター編
SwiftUIで作りながら学ぶアニメーション インジケーター編
Qiitaに詳しい記事あげます。
Ryo Tsuzukihashi
February 12, 2020
Tweet
Share
More Decks by Ryo Tsuzukihashi
See All by Ryo Tsuzukihashi
SwiftUI Transaction を徹底活用!ZOZOTOWN UI開発での活用事例
tsuzuki817
1
2.4k
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
3
1.1k
二次元コードを読み取りやすくするために 画面を強制的に明るくするのは もうやめにしませんか?👀
tsuzuki817
0
440
動画だけじゃない!iOS 15のピクチャ・イン・ピクチャを使って好きなUIを表示させよう!
tsuzuki817
3
5.1k
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
2
1.1k
Complications and widgets: Reloadedの要約
tsuzuki817
1
1.3k
Speech framework tips
tsuzuki817
1
2.7k
Build complication in SwiftUI の要約
tsuzuki817
0
730
SwiftUI で Neumorphism!!!
tsuzuki817
2
1.9k
Other Decks in Programming
See All in Programming
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
1.2k
為你自己學 Python - 冷知識篇
eddie
1
350
Swift Updates - Learn Languages 2025
koher
2
470
Laravel Boost 超入門
fire_arlo
3
210
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
230
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
490
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
270
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Docker and Python
trallard
45
3.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
The Cult of Friendly URLs
andyhume
79
6.6k
Balancing Empowerment & Direction
lara
3
620
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Navigating Team Friction
lara
189
15k
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*ͰΦϦδφϧΞχϝʔγϣϯΛͬͯ ΞϓϦΛϦονʹʂ