본문 바로가기

swift86

[iOS] UIView와 CALayer의 차이 [iOS - swift] View와 Layer의 차이 (UIView, CALayer) View와 Layer private let someView: UIView = { let view = UIView() view.backgroundColor = .systemBlue view.layer.shadowOffset = CGSize(width: 0, height: 10) view.layer.shadowColor = UIColor.black.cg.. ios-development.tistory.com UIView와 CALayer의 차이 UIView는 UIKit, CALayer는 Core Animation에 포함됨 OpenGL은 매우 low한 레벨에서 그래픽을 컨트롤할 수 있기 때문에 쉽게 사용하기 어렵기 때문에, 고수.. 2022. 5. 21.
[iOS] UIViewPropertyAnimator [iOS - swift] 1. UIViewPropertyAnimator, AnimationStates - 개념 1. UIViewPropertyAnimator, AnimationStates - 개념 2. UIViewPropertyAnimator, AnimationStates - fractionComplete, interactive animation (상호작용 애니메이션) UIViewPropertyAnimator UIView.animate와.. ios-development.tistory.com Apple Developer Documentation developer.apple.com UIViewPropertyAnimator view들의 변화들을 animation으로 처리하고, 해당 animation들의 동적인.. 2022. 5. 15.
[iOS] performBatchUpdates [iOS] - UITableView performBatchUpdates - row와 section를 일괄적으로 업데이트하기 Row와 Section을 일괄적으로 업데이트하는 방법에 대해 알아보자. yoojin99.github.io Apple Developer Documentation developer.apple.com performBatchUpdates UITableView와 UICollectionView에서 insert, delete, reload, move 등의 동작들의 애니메이션을 group화해서 동시에 실행할 수 있게 해주는 메소드이다 beginUpdates(), endUpdates()와 같이 batch update를 적용할 수 있는 방법 중에 하나이며, 애플 공식문서에서는 beginUpdates(.. 2022. 4. 24.
[iOS] json파일 dictionary로 불러오기 json파일 dictionary로 불러오기 Bundle에서 해당 파일의 url을 불러온다. JSONSerialization에서 url을 이용해서 만든 Data 오브젝트에서 jsonObject를 생성하고 [String: Any] 타입으로 캐스팅한다. if let url = Bundle.main.url(forResource: "Person", withExtension: "json") { if let jsonDict = try? JSONSerialization.jsonObject(with: Data(contentsOf: url)) as? [String: Any] { print(jsonDict["name"] ?? "") print(jsonDict["age"] ?? 0) } } /* Park 20 */ json파.. 2022. 4. 22.