cozzin
코찐 기술 블로그
cozzin
전체 방문자
오늘
어제
  • 분류 전체보기
    • Kotlin
    • 백엔드
    • iOS
      • Swift
      • SwiftUI
      • Combine
      • Architecture
    • 개발환경
    • 세미나
    • 생각정리
    • 스터디
    • CS
      • Refactoring
      • OS

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • LinkedIn
  • 강의

공지사항

인기 글

태그

  • 운영체제
  • WWDC21
  • slide-over
  • XCode
  • Ribs
  • 컴퓨터공학
  • Combine
  • multicast
  • ios
  • 디자인패턴
  • SwiftUI
  • darkmode
  • Warning
  • os
  • Swift
  • 테스트
  • 워닝제거
  • CS
  • 리팩토링
  • WWDC

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
cozzin

코찐 기술 블로그

[WWDC21] What's new in Swift
iOS/Swift

[WWDC21] What's new in Swift

2021. 7. 10. 21:14
반응형

이걸 제일 먼저 했어야 했는데!

역시 각 잡고 정리하는 시간이 필요하긴하네요.

 

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

image

 

image

  • 패키지를 검색해서 찾기 쉬움
  • CocoaPods Specs 같은 느낌

Data Sturcture

Swift Collections

Deque

image

  • Array 같은건데, 양쪽 끝으로 삽입 삭제가 가능

OrderedSet

image

  • 순서가 있는 Set
  • Random Access도 가능
  • Set 이랑 동일하게 Element가 하나만 있는 걸 보장해줌

OrderDictionary

image

  • 순서대로 접근 가능
  • Random Access도 가능

Algorithms

image

  • extension으로 구현해서 쓰던게 이제 기본으로 많이 제공되는 듯
  • (코테 칠때 편할듯)

https://developer.apple.com/videos/play/wwdc2021/10256/

Swift System

FilePath

image

 

image

 

image

  • window path가 뭐지? Root도 지정할 수 있는 간편한 방법을 제공

Swift Numerics

작년에 Float16 타입 도입되었는데, 이번에 Apple Silicon에 Float16에도 추가됨.

  • Float16-based complex number 구성 가능
  • Complex: 로그, 사인, 코사인 표현 가능

image

ArgumentParser

  • Fish shell completion scripts
  • Joined short options (-Ddebug)
  • Improved error messages

이런거 보면 Swift로 만든 스크립트 작성이 편할 듯

Swift Server

image

  • Static linking on Linux
  • Imporved JSON performance
  • Enhanced AWS Lambda runtime: 아무튼 빠름

image

Developer experience improvements

Swift DocC

image

  • 문서화 제대로 지원 가능
  • 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 퍼포먼스 개선

image


이제는 이런 에러들 없음!

Build Improvements

  • imported modules이 변경되었을 때 빌드 속도 빨라짐
  • compile 시작전 시간 빨라짐
  • extension 코드가 변경되었을때 재컴파일 적게함

image

 

Memory Management

  • 더 효율적으로 관리

image

Ergonomic improvements

image

Result Builders

  • 원래는 SwiftUI를 위해 디자인됨
  • 복잡한 계층구조를 유연하게 표현가능
  • 다양한 곳에서 사용할 수 있음
  • https://developer.apple.com/videos/play/wwdc2021/10253/

Enum Codable synthesis

image


간편하게 Codable 구현 가능

Flexible static member lookup

Protocol에 static var로 확장해두면 사용하는 곳에서 간편하게 사용 가능.

Screenshot 2021-07-10 PM 5 20 18

Property wrappers on parameters

파라미터로 사용 가능!

image

코드 개선해보기

기존

image

개선

image

https://developer.apple.com/videos/play/wwdc2021/10018/

Asynchronous and concurrent programming

image

코드 살펴보기

기존

image

개선

image


제어 흐름이 위에서 아래로 흘러서 이해하기 쉬움

  • Meet async/await in Swift
  • Swift concurrency: Behind the scenes

Structured Concurrency

기본

image

병렬

image


async 키워드 하나면 가능

  • Explore structured concurrency in Swift

Actor

멀티 스레딩 이슈

image


여러 스레드에서 동작하면 이슈가 됨

Actor 사용

image


actor를 사용하면 스레드 이슈가 없어짐

image


await 쓸때 일반적으로 필요하다는 뜻

image


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
    'iOS/Swift' 카테고리의 다른 글
    • concurrency-in-swift-chapter2
    • [WWDC21] Detect and diagnose memory issues
    • [WWDC21] ARC in Swift: Basics and beyond
    • [Swift 입문] 3. 변수와 상수
    cozzin
    cozzin
    Software Engineer

    티스토리툴바