Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hyun99999/uiviewanimationoptions

🧨 UIView.AnimationOptions μ΄μš©ν•œ μ „ν™˜ μ• λ‹ˆλ©”μ΄μ…˜ λŒ€μž‘μ „
https://github.com/hyun99999/uiviewanimationoptions

animation ios

Last synced: 26 days ago
JSON representation

🧨 UIView.AnimationOptions μ΄μš©ν•œ μ „ν™˜ μ• λ‹ˆλ©”μ΄μ…˜ λŒ€μž‘μ „

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 UIKit

class 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)