반응형
https://github.com/airbnb/lottie-ios
GitHub - airbnb/lottie-ios: An iOS library to natively render After Effects vector animations
An iOS library to natively render After Effects vector animations - GitHub - airbnb/lottie-ios: An iOS library to natively render After Effects vector animations
github.com
로티 깃허브 링크입니다. 전 PM으로 추가했습니다! 편하신대로 추가해주시고 아래 링크(로티공홈)에서 맘에 드는 gif파일을 고르거나 개인 파일을 골라 밑에 코드 처럼 적용하시면 되요!
https://lottiefiles.com
LottieFiles: Download Free lightweight animations for website & apps.
Effortlessly bring the smallest, free, ready-to-use motion graphics for the web, app, social, and designs. Create, edit, test, collaborate, and ship Lottie animations in no time!
lottiefiles.com
적용 코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
let animationView: LottieAnimationView = {
let animView = LottieAnimationView(name: "99228-heart2heart") //json 파일을 갖고와서 프로젝트에 추가해주세요!
animView.contentMode = .scaleAspectFill
return animView
}()
private func layout() {
self.view.addSubview(animationView)
// 애니메이션뷰의 제약 조건 설정
animationView.snp.makeConstraints {
$0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(60)
$0.centerY.equalToSuperview()
}
animationView.play { [weak self] finished in
guard let self = self else { return }
// 애니메이션이 종료된 후에 이미지뷰와 버튼을 추가하고 제약 조건을 설정합니다.
if finished {
let sideniavigationController = UINavigationController(rootViewController: MainViewController())
let LoginVC = sideniavigationController
LoginVC.modalPresentationStyle = .fullScreen
self.present(LoginVC,animated: true, completion: nil)
}
}
}
|
cs |
끝!
반응형
'iOS > UIKit' 카테고리의 다른 글
헷갈리는 Auto Layout 정리하자. (0) | 2023.07.16 |
---|---|
[Swift/UI Kit] 'SideMenu'라이브러리 적용 (코드로만)feat.SnapKit (1) | 2023.07.01 |
[Swift] 스토리보드 없이 코드로만 UI 시작해보기! Feat.SnapKit(1) (0) | 2023.06.23 |
[Swift/iOS] 구글 로그인 구현하기! (0) | 2023.02.28 |
[Swift/iOS] 네.아.로 네이버 로그인 구현하기 (0) | 2023.02.26 |