[iOS, Swift] 타입 별칭 예제 iOS 16.1, Xcode 14.1, Swift 5, UIKit 환경에서 진행했습니다. typealias Handler = () -> Void typealias BoolHandler = (Bool) -> Void func connectAPI(completion: Handler) { completion() } func connectAPI(completion: BoolHandler) { completion(true) } iOS/문법 2023.01.31
[iOS, Swift] Swift Closure Snippet iOS 15.5, Xcode 13.31, Swift 5, UIKit 환경에서 진행했습니다. func completionFunction(_ completion: (() -> Void)?) { completion?() } iOS/코드조각 2022.07.13