Skip to content

Commit

Permalink
Merge pull request matthewpalmer#133 from warren-gavin/swift-3.0
Browse files Browse the repository at this point in the history
Updates for Xcode beta 4
  • Loading branch information
matthewpalmer authored Aug 6, 2016
2 parents 5055c89 + 6e15b6e commit 7036917
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Source/Locksmith.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

public let LocksmithDefaultService = Bundle.main.infoDictionary![String(kCFBundleIdentifierKey)] as? String ?? "com.locksmith.defaultService"

public typealias PerformRequestClosureType = (requestReference: CFDictionary, inout result: AnyObject?) -> (OSStatus)
public typealias PerformRequestClosureType = (requestReference: CFDictionary, result: inout AnyObject?) -> (OSStatus)


// MARK: - Locksmith
Expand Down
16 changes: 8 additions & 8 deletions Source/LocksmithAccessibleOption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ public enum LocksmithAccessibleOption: RawRepresentable {
public init?(rawValue: String) {
switch rawValue {
case String(kSecAttrAccessibleWhenUnlocked):
self = WhenUnlocked
self = .WhenUnlocked
case String(kSecAttrAccessibleAfterFirstUnlock):
self = AfterFirstUnlock
self = .AfterFirstUnlock
case String(kSecAttrAccessibleAlways):
self = Always
self = .Always
case String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly):
self = WhenUnlockedThisDeviceOnly
self = .WhenUnlockedThisDeviceOnly
case String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly):
self = AfterFirstUnlockThisDeviceOnly
self = .AfterFirstUnlockThisDeviceOnly
case String(kSecAttrAccessibleAlwaysThisDeviceOnly):
self = AlwaysThisDeviceOnly
self = .AlwaysThisDeviceOnly
case String(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly):
self = WhenPasscodeSetThisDeviceOnly
self = .WhenPasscodeSetThisDeviceOnly
default:
self = WhenUnlocked
self = .WhenUnlocked
}
}

Expand Down
20 changes: 10 additions & 10 deletions Source/LocksmithError.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

// MARK: Locksmith Error
public enum LocksmithError: String, ErrorProtocol {
public enum LocksmithError: String, Error {
case Allocate = "Failed to allocate memory."
case AuthFailed = "Authorization/Authentication failed."
case Decode = "Unable to decode the provided data."
Expand All @@ -20,23 +20,23 @@ public enum LocksmithError: String, ErrorProtocol {
init?(fromStatusCode code: Int) {
switch code {
case Int(errSecAllocate):
self = Allocate
self = .Allocate
case Int(errSecAuthFailed):
self = AuthFailed
self = .AuthFailed
case Int(errSecDecode):
self = Decode
self = .Decode
case Int(errSecDuplicateItem):
self = Duplicate
self = .Duplicate
case Int(errSecInteractionNotAllowed):
self = InteractionNotAllowed
self = .InteractionNotAllowed
case Int(errSecItemNotFound):
self = NotFound
self = .NotFound
case Int(errSecNotAvailable):
self = NotAvailable
self = .NotAvailable
case Int(errSecParam):
self = Param
self = .Param
case Int(errSecUnimplemented):
self = Unimplemented
self = .Unimplemented
default:
return nil
}
Expand Down
18 changes: 9 additions & 9 deletions Source/LocksmithInternetAuthenticationType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ public enum LocksmithInternetAuthenticationType: RawRepresentable {
public init?(rawValue: String) {
switch rawValue {
case String(kSecAttrAuthenticationTypeNTLM):
self = NTLM
self = .NTLM
case String(kSecAttrAuthenticationTypeMSN):
self = MSN
self = .MSN
case String(kSecAttrAuthenticationTypeDPA):
self = DPA
self = .DPA
case String(kSecAttrAuthenticationTypeRPA):
self = RPA
self = .RPA
case String(kSecAttrAuthenticationTypeHTTPBasic):
self = HTTPBasic
self = .HTTPBasic
case String(kSecAttrAuthenticationTypeHTTPDigest):
self = HTTPDigest
self = .HTTPDigest
case String(kSecAttrAuthenticationTypeHTMLForm):
self = HTMLForm
self = .HTMLForm
case String(kSecAttrAuthenticationTypeDefault):
self = Default
self = .Default
default:
self = Default
self = .Default
}
}

Expand Down
64 changes: 32 additions & 32 deletions Source/LocksmithInternetProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,69 @@ public enum LocksmithInternetProtocol: RawRepresentable {
public init?(rawValue: String) {
switch rawValue {
case String(kSecAttrProtocolFTP):
self = FTP
self = .FTP
case String(kSecAttrProtocolFTPAccount):
self = FTPAccount
self = .FTPAccount
case String(kSecAttrProtocolHTTP):
self = HTTP
self = .HTTP
case String(kSecAttrProtocolIRC):
self = IRC
self = .IRC
case String(kSecAttrProtocolNNTP):
self = NNTP
self = .NNTP
case String(kSecAttrProtocolPOP3):
self = POP3
self = .POP3
case String(kSecAttrProtocolSMTP):
self = SMTP
self = .SMTP
case String(kSecAttrProtocolSOCKS):
self = SOCKS
self = .SOCKS
case String(kSecAttrProtocolIMAP):
self = IMAP
self = .IMAP
case String(kSecAttrProtocolLDAP):
self = LDAP
self = .LDAP
case String(kSecAttrProtocolAppleTalk):
self = AppleTalk
self = .AppleTalk
case String(kSecAttrProtocolAFP):
self = AFP
self = .AFP
case String(kSecAttrProtocolTelnet):
self = Telnet
self = .Telnet
case String(kSecAttrProtocolSSH):
self = SSH
self = .SSH
case String(kSecAttrProtocolFTPS):
self = FTPS
self = .FTPS
case String(kSecAttrProtocolHTTPS):
self = HTTPS
self = .HTTPS
case String(kSecAttrProtocolHTTPProxy):
self = HTTPProxy
self = .HTTPProxy
case String(kSecAttrProtocolHTTPSProxy):
self = HTTPSProxy
self = .HTTPSProxy
case String(kSecAttrProtocolFTPProxy):
self = FTPProxy
self = .FTPProxy
case String(kSecAttrProtocolSMB):
self = SMB
self = .SMB
case String(kSecAttrProtocolRTSP):
self = RTSP
self = .RTSP
case String(kSecAttrProtocolRTSPProxy):
self = RTSPProxy
self = .RTSPProxy
case String(kSecAttrProtocolDAAP):
self = DAAP
self = .DAAP
case String(kSecAttrProtocolEPPC):
self = EPPC
self = .EPPC
case String(kSecAttrProtocolIPP):
self = IPP
self = .IPP
case String(kSecAttrProtocolNNTPS):
self = NNTPS
self = .NNTPS
case String(kSecAttrProtocolLDAPS):
self = LDAPS
self = .LDAPS
case String(kSecAttrProtocolTelnetS):
self = TelnetS
self = .TelnetS
case String(kSecAttrProtocolIMAPS):
self = IMAPS
self = .IMAPS
case String(kSecAttrProtocolIRCS):
self = IRCS
self = .IRCS
case String(kSecAttrProtocolPOP3S):
self = POP3S
self = .POP3S
default:
self = HTTP
self = .HTTP
}
}

Expand Down
12 changes: 6 additions & 6 deletions Source/LocksmithSecurityClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ public enum LocksmithSecurityClass: RawRepresentable {
public init?(rawValue: String) {
switch rawValue {
case String(kSecClassGenericPassword):
self = GenericPassword
self = .GenericPassword
case String(kSecClassInternetPassword):
self = InternetPassword
self = .InternetPassword
case String(kSecClassCertificate):
self = Certificate
self = .Certificate
case String(kSecClassKey):
self = Key
self = .Key
case String(kSecClassIdentity):
self = Identity
self = .Identity
default:
self = GenericPassword
self = .GenericPassword
}
}

Expand Down

0 comments on commit 7036917

Please sign in to comment.