Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyun99999/uiviewanimationoptions
𧨠UIView.AnimationOptions μ΄μ©ν μ ν μ λλ©μ΄μ
λμμ
https://github.com/hyun99999/uiviewanimationoptions
animation ios
Last synced: 26 days ago
JSON representation
𧨠UIView.AnimationOptions μ΄μ©ν μ ν μ λλ©μ΄μ λμμ
- Host: GitHub
- URL: https://github.com/hyun99999/uiviewanimationoptions
- Owner: hyun99999
- Created: 2021-08-20T03:54:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-20T04:22:08.000Z (over 3 years ago)
- Last Synced: 2024-11-25T21:35:45.596Z (3 months ago)
- Topics: animation, ios
- Language: Swift
- Homepage:
- Size: 2.37 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UIViewAnimationOptions
𧨠UIView.AnimationOptions μ΄μ©ν μ ν μ λλ©μ΄μ λμμ ### UIView transition animation options
λ¨Όμ κ°λ°μλ¬Έμλ₯Ό μ΄ν΄λ³΄μ
[transition(with:duration:options:animations:completion:)](https://developer.apple.com/documentation/uikit/uiview/1622574-transition)- νΉμ container λ·°μ transition animation μ λ§λλ ν¨μμ΄λ€.
animation ν¨κ³Όλ₯Ό μ£ΌκΈ° μν΄μ νλΌλ―Έν° options μ ν΄λΉνλ `UIView.AnimationOptions` μ΅μ μ μ€μ ν΄μ£Όλ©΄ λλ€.
### μ€λΉ
- Main.storyboard
- ViewController.swift
```swift
import UIKitclass ViewController: UIViewController {
private var isInitialImage = true
@IBOutlet weak var initialImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
initialImageView.image = UIImage(named: "initialImg")
initialImageView.contentMode = .scaleAspectFill
}@IBAction func touchTransitionButton(_ sender: Any) {
print("transitionButton touched.")
// β μλ©΄μ κ²½μ°
if isInitialImage {
self.isInitialImage = false
initialImageView.image = UIImage(named: "transitionImg")
// β options νλΌλ―Έν°μ μνλ ν¨κ³Όμ ν΄λΉνλ μ΅μ μ λ£μ΄μ£Όλ©° λλ€.
UIView.transition(with: initialImageView, duration: 1, options:.transitionFlipFromLeft, animations: nil, completion: nil)
}
// β λ·λ©΄μ κ²½μ°
else {
self.isInitialImage = true
initialImageView.image = UIImage(named: "initialImg")
UIView.transition(with: initialImageView, duration: 1, options: .transitionFlipFromLeft, animations: nil, completion: nil)
}
}
}```
### UIView.AnimationOptions constants.
transition animation ννμ μ§μ μ μΈ μ΅μ λ€μ μ€μ΅ν΄λ³΄μλ€.- [transitionCrossDissolve](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622499-transitioncrossdissolve)
- [transitionCurlDown](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622455-transitioncurldown)
- [transitionCurlUp](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622637-transitioncurlup)
- [transitionFlipFromBottom](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622632-transitionflipfrombottom)
- [transitionFlipFromLeft]()
- [transitionFlipFromRight](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622573-transitionflipfromright)
- [transitionFlipFromTop](https://developer.apple.com/documentation/uikit/uiview/animationoptions/1622548-transitionflipfromtop)
![]()