-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/#147 앱 아이콘 및 로띠 추가 #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "chore/#147-\uC571-\uC544\uC774\uCF58"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // | ||
| // Lottie+.swift | ||
| // Cherrish-iOS | ||
| // | ||
| // Created by 이나연 on 1/21/26. | ||
| // | ||
|
|
||
| import SwiftUI | ||
| import Lottie | ||
|
|
||
| struct LottieView: UIViewRepresentable { | ||
| let animationName: String | ||
| let loopMode: LottieLoopMode | ||
|
|
||
| func makeUIView(context: Context) -> UIView { | ||
| let view = UIView(frame: .zero) | ||
|
|
||
| let animationView = LottieAnimationView(name: animationName) | ||
| animationView.loopMode = loopMode | ||
| animationView.play() | ||
|
|
||
| animationView.translatesAutoresizingMaskIntoConstraints = false | ||
| view.addSubview(animationView) | ||
|
|
||
| NSLayoutConstraint.activate([ | ||
| animationView.leadingAnchor.constraint(equalTo: view.leadingAnchor), | ||
| animationView.trailingAnchor.constraint(equalTo: view.trailingAnchor), | ||
| animationView.topAnchor.constraint(equalTo: view.topAnchor), | ||
| animationView.bottomAnchor.constraint(equalTo: view.bottomAnchor) | ||
| ]) | ||
|
|
||
| return view | ||
| } | ||
|
|
||
| func updateUIView(_ uiView: UIView, context: Context) {} | ||
|
Comment on lines
+15
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "Lottie+.swift" -type fRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 141 🏁 Script executed: fd "Lottie\+\.swift" -type fRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 240 🏁 Script executed: cat -n "./Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Lottie+.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 1331 🌐 Web query:
💡 Result: Key points & best practices for UIViewRepresentable lifecycle (makeUIView / updateUIView)
Short checklist when implementing:
If you want, I can show a compact example demonstrating these patterns. Citations:
updateUIView가 비어 있어 애니메이션 속성 변경이 반영되지 않음 animationName 또는 loopMode가 변경되어도 updateUIView가 구현되지 않았으므로 UI에 반영되지 않습니다. 특히 동일한 LottieView를 다른 파라미터로 재사용할 때 버그가 발생할 수 있습니다. Coordinator 패턴을 사용하여 animationView 참조를 유지한 후, updateUIView에서 애니메이션과 루프 모드를 갱신해야 합니다. 🛠️ 제안 수정 struct LottieView: UIViewRepresentable {
let animationName: String
let loopMode: LottieLoopMode
+ func makeCoordinator() -> Coordinator { Coordinator() }
+
func makeUIView(context: Context) -> UIView {
let view = UIView(frame: .zero)
let animationView = LottieAnimationView(name: animationName)
+ context.coordinator.animationView = animationView
animationView.loopMode = loopMode
animationView.play()
animationView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(animationView)
NSLayoutConstraint.activate([
animationView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
animationView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
animationView.topAnchor.constraint(equalTo: view.topAnchor),
animationView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
return view
}
- func updateUIView(_ uiView: UIView, context: Context) {}
+ func updateUIView(_ uiView: UIView, context: Context) {
+ guard let animationView = context.coordinator.animationView else { return }
+ if animationView.animation?.name != animationName {
+ animationView.animation = LottieAnimation.named(animationName)
+ }
+ animationView.loopMode = loopMode
+ animationView.play()
+ }
+
+ final class Coordinator {
+ var animationView: LottieAnimationView?
+ }
}🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "calendar_D-day.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "calendar_D-day@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "calendar_D-day@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Reduce Motion 사용자 배려 추가 권장.
반복 루프 애니메이션은 Reduce Motion이 켜진 경우 1회 재생(또는 정적 대체)로 전환하는 편이 접근성에 유리합니다. 애니메이션이 보이스오버 포커스를 받지 않도록 숨김 처리도 권장합니다.
♿ 제안 변경사항
struct ChallengeLoadingView: View { + `@Environment`(\.accessibilityReduceMotion) private var reduceMotion `@ObservedObject` var viewModel: CreateChallengeViewModel var body: some View { VStack { @@ - LottieView(animationName: "splash", loopMode: .loop) + LottieView(animationName: "splash", loopMode: reduceMotion ? .playOnce : .loop) .frame(width: 130.adjustedW, height: 154.adjustedH) .padding(.top, 60.adjustedH) + .accessibilityHidden(true)🤖 Prompt for AI Agents