12월, 2020의 게시물 표시

[iOS] 앱 아이콘 동적으로 변경하기 (Dynamically Change App icon)

이미지
  [iOS] 앱 아이콘 동적으로 변경하기 (Dynamically Change App icon) 안녕하세요 물먹고하자입니다. 오늘은 앱 아이콘을 동적으로 변경하는 방법에 대해서 정리해 보았습니다. iOS 10.3 이상부터 지원되는 기능입니다. 참고 :  https://developer.apple.com/documentation/uikit/uiapplication // If false, alternate icons are not supported for the current process. // 앱 아이콘을 변경 할 수 있는지 체크 하는 함수 @available ( iOS 10.3 , *) open var supportsAlternateIcons : Bool { get } // Pass `nil` to use the primary application icon. The completion handler will be invoked asynchronously on an arbitrary background queue; be sure to dispatch back to the main queue before doing any further UI work. // 앱 아이콘을 변경하는 함수 @available ( iOS 10.3 , *) open func setAlternateIconName ( _ alternateIconName: String ?, completionHandler: (( Error ?) -> Void )? = nil ) // If `nil`, the primary application icon is being used. // 현재 변경되어 있는 앱아이콘 이름을 아져오는 함수 @available ( iOS 10.3 , *) open var alternateIconName : String ? { get } 샘플 완료 동영상 Git 주소 :  https://github.com/kimjiwook/AppIconChangeSampl