I was trying to understand the usage and significance of the typealias marked for code enum declared in the LAError class for the LocalAuthentication framework provided for iOS SDK. I have marked the same in the screenshot attached.
What is the significance and use of the _ErrorType declared inside the LAErro.Code enum?
Any lead on this that which would help me understand would be greatly appreciated.
Corresponding Code Snippet for the image :
@available(iOS 8.0, *)
public struct LAError {
public init(_nsError: NSError)
public static var errorDomain: String { get }
@available(iOS 8.0, *)
public enum Code : Int {
public typealias _ErrorType = LAError
typealias
is used to refer anything with another name. e.g.so
ErrorCallback
andErrorBlock
represent same object.Here is link, which shows many benefits of typealias. On the summary, here is the list of other examples from the link: