• Productivity

    • iPad Multitasking: 새 윈도우에서 열기 기능 추가

      • 새로운 windowscene이 할당된다.
      • scene 단위로 선반에 들어간다.
      // 이 액션을 메뉴에 넣으면 된다.
      let newSceneAction = UIWindowScene.ActivationAction({ _ in
      
      		// 새로운 Scene을 나타내기 위한 User Activity 생성
      		let userActivity = NSUserActivity(activityType: "com.myapp.detailScene")
      		
      		// activation configuration 반환
      		return UIWindowScene.ActivationConfiguration(userActivity: userActivity)
      })
      
    • Keyboard Navigation

      • tvOS의 포커스 네비게이션 시스템이 iPadOS, mac Catalyst에도 도입
      • 키보드로 포커스 이동이 가능해진다.
    • Keyboard shortcuts

      • iPad OS 15부터 숏컷 메뉴를 사용자가 빌드 가능
        • 카테고리 할당 하면 분류해준다.
        • UIResponder.KeyCommand로 단축키 할당
      class AppDelegate: UIResponder, UIApplicationDelegate {
      	override func buildMenu(with builder: UIMenuBuilder) {
      		// 빌더를 통해서 메뉴를 변경하면 된다.
      	}
      }
      
    • iPad pointer

      • band selection 추가, 기본 활성화
        • multiselection을 지원하는 UICollectionView에 대해서 기본 활성화
      • 포인터 액세서리(상황에 따라 다른 형태의 포인터) - 전환도 자동으로 애니매이션
    • iPhone에서도 앱 간 드래그앤 드롭 기능 지원

      • API는 그대로!
  • UI refinements

    • UIToolbar와 UITabbar 디자인 변경 - 배경이 없는 것처럼 처리됨

      • Tabbar는 SF Symbol 지원 추가

      • 다음 코드는 비쥬얼 이슈가 있을 수 있음

        // 불투명 처리
        bar.isTranslucent = false
        
        // 표준적이지 않은 테두리 처리
        viewController.edgesForExtendedLayout = .top
        
      • 기본 동작이 마음에 들지 않는다면, Appearance 객체를 할당하라.

      let appearance = UITabBarAppearance()
      appearance.backgroundEffect = nil
      appearance.backgroundColor = .blue
      
      tabBar.scrollEdgeAppearance = appearance // UINavigationBar에만 있던게 ToolBar와 TabBar에도 생김
      
      • UIKit이 scrollEdgeAprearance를 수행하기 위해 스크롤을 감시해야 되는데, 이를 자동으로 찾지 못할 경우에 대비해서 설정을 할 수 있다.
      let scrollView = ... //
      viewController.setContentScrollView(scrollView, for: .bottom)
      
      • 테이블 뷰에 새로운 스타일 추가: .prominentInsetGrouped, .extraProminentInsetGrouped
      • UIListSeparatorConfiguration(14.5) 추가. row 단위로 separator조정 가능
      • Sheet Presentation → 판모달 비슷한거네
        • 선택적으로 모달이 아닐 수 있음
      • UIDatePicker에 시간을 타자로 편집할 수 있게 됨
  • API environments

    • UIButton API 강화
      • 룩앤필을 다양하게 설정 가능 → Configuration
      • 메뉴 API를 pop-up 인지 pull-down인지 설정 가능
    var config = UIButton.Configuration.tinted()
    
    config.title = "Add to Cart"
    config.image = UIImage(systemName: "cart.badge.plus")
    config.imagePlacement = .trailing
    config.buttonSize = .large
    config.cornerStyle = .capsule
    
    self.addToCartButton = UIButton(configuration: config)
    

    • SubMenu

      • UIMenu의 서브메뉴가 새로운 UI로 개편
      • API 변경 필요 없음
    • SF Symbol 스타일 추가 - 심볼도 configuration 이 생김

      • Monochrome(기본) - tintColor 기반
      • Hierarchical - tintColor 기반으로 레이어마다 다른 컬러를 런타임에 결정
      • Pallete - 명시적으로 레이어마다 컬러 지정
      • Multicolor - 사전에 정해진 컬러셋
    • SF Symbol을 선언적으로 사용 가능 → 첫 시작만 문자열로 하면, 나머지는 modifier로

    • Content Size Category 제한

      • UIView의 추가 프로퍼티로 최대, 최소 카테고리 지정 가능
      • 그렇다고 말도 안되게 제한해놓지는 말것
      extension UIView {
      	var minimumContentSizeCategory: UIContentSizeCategory
      	var maximumContentSizeCategory: UIContentSizeCategory
      }
      
    • SystemColor 추가

      • UIColor.tintColor
      • 런타임에 결정되는 색상값
      • 현재앱과 뷰계층의 tintColor
    • ColorPicker 강화(iOS 14.5)

      • 연속적인 선택이 가능
    • TextKit2

    • 상태 복원 API → UIScene도 지원한다.

      • NSUserActivity가 현재 인터페이스의 상태를 나타낸다.
      • 기능 강화
        • 텍스트 상호작용 API(텍스트 입력 등)의 값도 저장
        • 스토리 보드 로드 이후에 호출되는 콜백
        • 상태 복원을 지연시킬 수 있는 기능 제공
    • Scene 레벨에서의 공유 → 이건 잘 모르겠다.

    • Cell configuration 클로저

      • CollectionView와 UITableView 지원
      • cell의 상태 변화에 따라 반응
      • 서브클래싱 이제 필요없다. → 정말?
    let cell: UICollectionViewCell = ...
    
    cell.configurationUpdateHandler = { cell, state in
    	var content = UIListContentConfiguration.cell().updated(for: state)
    	if state.isDisabled {
    		content.textProperties.color = .systemGray
    	}
    
    	cell.conetntConfiguration = content
    }
    
    • Diffable Datasource
      • animation 없이 apply 가능
      • reconfigure API 추가 → Identity가 안바뀌어도, 재설정 가능
  • Performance

    • 셀 프리패칭 기능 향상 → 별도로 해줄 건 없음
    • 이미지 비동기 로딩, 섬네일화 API도 지원
    // 비동기 로딩
    if let image = UIImage(contentsOfFile: pathToImage) {
    	async {
    		let preparedImage = await image.byPreparingForDisplay()
    
    		imageView.image = preparedImage
    	}
    }
    
    // 썸네일화
    if let bigImage = UIImage(contentsOfFile: pathToBigImage) {
    	async {
    		let preparedImage = await bigImage.byPreparingThumbnail(ofSize: smallSize)
    
    		imageView.image = preparedImage
    	}
    }
    
    • UIKit API들을 MainActor로 선언함으로써 API들이 메인스레드에서 호출되고 있음을 컴파일 타임에 검사
  • Security and privacy

    • Location Button: 이런 저런 권한 없이도 디바이스의 현재 위치를 받아오는 기능을 가짐
      • 구성할 수 있는 것들을 많이 제공
    • 붙여넣기 팝업이 사용자가 의도한 행동(메뉴 선택, Cmd + V) 에선 뜨지 않도록 개선
      • UIResponder Selector와 UIAction Identifier중에서 다음 것들이 뜨지 않도록 만들어준다.
        • Paste
        • Paste and go
        • Paste and search
        • Paste and Match Style
      • Pasteboard 검사 API가 모든 표준 Data Detector 타입을 커버할 수 있게 됨
    • 개인 클릭 측정(14.5) → 개인 정보를 유지한채로 광고 통계를 내기 위함
      • 광고를 UIEventAttributionView로 덮고, UIEventAttribution이벤트를 URL 열 때 제공해라