Parcourir la source

Merge pull request #172 from kishikawakatsumi/defaultvalue

Use default value instead overload in method
kishikawa katsumi il y a 9 ans
Parent
commit
f8d5c9900a
1 fichiers modifiés avec 2 ajouts et 10 suppressions
  1. 2 10
      Lib/KeychainAccess/Keychain.swift

+ 2 - 10
Lib/KeychainAccess/Keychain.swift

@@ -398,19 +398,11 @@ public class Keychain {
         self.init(options)
     }
     
-    public convenience init(server: String, protocolType: ProtocolType) {
-        self.init(server: NSURL(string: server)!, protocolType: protocolType)
-    }
-    
-    public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType) {
+    public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
         self.init(server: NSURL(string: server)!, protocolType: protocolType, authenticationType: authenticationType)
     }
     
-    public convenience init(server: NSURL, protocolType: ProtocolType) {
-        self.init(server: server, protocolType: protocolType, authenticationType: .Default)
-    }
-    
-    public convenience init(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType) {
+    public convenience init(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
         var options = Options()
         options.itemClass = .InternetPassword
         options.server = server