이걸 제일 먼저 했어야 했는데!
역시 각 잡고 정리하는 시간이 필요하긴하네요.
https://developer.apple.com/videos/play/wwdc2021/10192/
What‘s new in Swift - WWDC21 - Videos - Apple Developer
Join us for an update on Swift. Discover the latest language advancements that make your code easier to read and write. Explore the...
developer.apple.com
Update on Swift packages
Swift Package Collection
- 패키지를 검색해서 찾기 쉬움
- CocoaPods Specs 같은 느낌
Data Sturcture
Swift Collections
Deque
- Array 같은건데, 양쪽 끝으로 삽입 삭제가 가능
OrderedSet
- 순서가 있는 Set
- Random Access도 가능
- Set 이랑 동일하게 Element가 하나만 있는 걸 보장해줌
OrderDictionary
- 순서대로 접근 가능
- Random Access도 가능
Algorithms
- extension으로 구현해서 쓰던게 이제 기본으로 많이 제공되는 듯
- (코테 칠때 편할듯)
https://developer.apple.com/videos/play/wwdc2021/10256/
Swift System
FilePath
- window path가 뭐지? Root도 지정할 수 있는 간편한 방법을 제공
Swift Numerics
작년에 Float16
타입 도입되었는데, 이번에 Apple Silicon에 Float16
에도 추가됨.
- Float16-based complex number 구성 가능
Complex
: 로그, 사인, 코사인 표현 가능
ArgumentParser
- Fish shell completion scripts
- Joined short options (-Ddebug)
- Improved error messages
이런거 보면 Swift로 만든 스크립트 작성이 편할 듯
Swift Server
- Static linking on Linux
- Imporved JSON performance
- Enhanced AWS Lambda runtime: 아무튼 빠름
Developer experience improvements
Swift DocC
- 문서화 제대로 지원 가능
- interactive
- 오픈소스로 공개 예정
- https://developer.apple.com/videos/play/wwdc2021/10166/
- https://developer.apple.com/videos/play/wwdc2021/10167
- https://developer.apple.com/videos/play/wwdc2021/10236
- https://developer.apple.com/videos/play/wwdc2021/10235
Type checker 퍼포먼스 개선
이제는 이런 에러들 없음!
Build Improvements
- imported modules이 변경되었을 때 빌드 속도 빨라짐
- compile 시작전 시간 빨라짐
- extension 코드가 변경되었을때 재컴파일 적게함
Memory Management
- 더 효율적으로 관리
Ergonomic improvements
Result Builders
- 원래는 SwiftUI를 위해 디자인됨
- 복잡한 계층구조를 유연하게 표현가능
- 다양한 곳에서 사용할 수 있음
- https://developer.apple.com/videos/play/wwdc2021/10253/
Enum Codable synthesis
간편하게 Codable 구현 가능
Flexible static member lookup
Protocol에 static var로 확장해두면 사용하는 곳에서 간편하게 사용 가능.
Property wrappers on parameters
파라미터로 사용 가능!
코드 개선해보기
기존
개선
https://developer.apple.com/videos/play/wwdc2021/10018/
Asynchronous and concurrent programming
코드 살펴보기
기존
개선
제어 흐름이 위에서 아래로 흘러서 이해하기 쉬움
Structured Concurrency
기본
병렬
async 키워드 하나면 가능
Actor
멀티 스레딩 이슈
여러 스레드에서 동작하면 이슈가 됨
Actor 사용
actor를 사용하면 스레드 이슈가 없어짐
await
쓸때 일반적으로 필요하다는 뜻
async/await 도 잘 동작함
actor는 클래스와 같이 reference type임
하지만 멀티 스레드에서 안전하게 사용할 수 있도록 규칙이 적용됨
Protect mutable state with Swift actors
Looking ahead to Swift6
- Safe Concurrency 동시성 이슈에 초집중할듯!
- 스위프트 포럼에 참여해달라!
'iOS > Swift' 카테고리의 다른 글
concurrency-in-swift-chapter2 (0) | 2021.12.01 |
---|---|
[WWDC21] Detect and diagnose memory issues (0) | 2021.07.07 |
[WWDC21] ARC in Swift: Basics and beyond (0) | 2021.07.04 |
[Swift 입문] 3. 변수와 상수 (0) | 2021.01.17 |
[Swift 입문] 2. Playground 사용해보기 (0) | 2021.01.17 |