diff --git a/enzevalos_iphone.xcodeproj/project.pbxproj b/enzevalos_iphone.xcodeproj/project.pbxproj index b2fbbd2a7b72e5a4601fc8995fe4ba07efba7725..64e761c2b19e6d459678f9b5cad9b09234135c6d 100644 --- a/enzevalos_iphone.xcodeproj/project.pbxproj +++ b/enzevalos_iphone.xcodeproj/project.pbxproj @@ -776,7 +776,6 @@ CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = 4377G946WP; LastSwiftMigration = 0820; - TestTargetID = A13526741D955BDF00D3BFE1; }; A13526961D955BE000D3BFE1 = { CreatedOnToolsVersion = 7.3.1; @@ -1374,13 +1373,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = 411EB2B85F99B48FFD36F966 /* Pods-enzevalos_iphoneTests.debug.xcconfig */; buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; INFOPLIST_FILE = enzevalos_iphoneTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "fu-berlin.enzevalos-iphoneTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/enzevalos_iphone.app/enzevalos_iphone"; }; name = Debug; }; @@ -1388,13 +1385,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = C7733DFEFB7E7CFF38EC1665 /* Pods-enzevalos_iphoneTests.release.xcconfig */; buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; INFOPLIST_FILE = enzevalos_iphoneTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "fu-berlin.enzevalos-iphoneTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/enzevalos_iphone.app/enzevalos_iphone"; }; name = Release; }; diff --git a/enzevalos_iphone/DataHandler.swift b/enzevalos_iphone/DataHandler.swift index 93ebf8e7fc37b433114033bea79e02d32c54caec..73c643f18debf76c0e8f7af804d88f7bfd6a3099 100644 --- a/enzevalos_iphone/DataHandler.swift +++ b/enzevalos_iphone/DataHandler.swift @@ -164,7 +164,7 @@ class DataHandler { // Save, load, search private func find(_ entityName: String, type:String, search: String) -> [AnyObject]?{ - let fReq: NSFetchRequest = NSFetchRequest(entityName: entityName) + let fReq: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entityName) //FIXME: NSFetchRequestResult richtig hier? fReq.predicate = NSPredicate(format:"\(type) CONTAINS '\(search)' ") let result: [AnyObject]? do { @@ -177,7 +177,7 @@ class DataHandler { } private func findNum (_ entityName: String, type:String, search: UInt64) -> [AnyObject]?{ - let fReq: NSFetchRequest = NSFetchRequest(entityName: entityName) + let fReq: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entityName) //FIXME: NSFetchRequestResult richtig hier? fReq.predicate = NSPredicate(format:"\(type) = %D ",search) let result: [AnyObject]? do { @@ -191,7 +191,7 @@ class DataHandler { private func findAll(_ entityName:String)->[AnyObject]? { - let fReq: NSFetchRequest = NSFetchRequest(entityName: entityName) + let fReq: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entityName) //FIXME: NSFetchRequestResult richtig hier? let result: [AnyObject]? do { result = try self.managedObjectContext.fetch(fReq) @@ -209,7 +209,7 @@ class DataHandler { let search = find("Mail_Address", type: "address", search: address) if search == nil || search!.count == 0 { if temporary{ - return CNMailAddressExtension(addr: address) + return CNMailAddressExtension(addr: address as NSString) } else{ let mail_address = NSEntityDescription.insertNewObject(forEntityName: "Mail_Address",into: managedObjectContext) as! Mail_Address diff --git a/enzevalos_iphone/EnzevalosContact+CoreDataProperties.swift b/enzevalos_iphone/EnzevalosContact+CoreDataProperties.swift index cbba8b6bfbedac9581d63844b5e88500f9b4fe02..afc2d33154ab4829d185a3bb091d7971a60a595f 100644 --- a/enzevalos_iphone/EnzevalosContact+CoreDataProperties.swift +++ b/enzevalos_iphone/EnzevalosContact+CoreDataProperties.swift @@ -12,7 +12,7 @@ import CoreData extension EnzevalosContact { - @nonobjc public override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { + @nonobjc open override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { return NSFetchRequest(entityName: "EnzevalosContact"); } diff --git a/enzevalos_iphone/EnzevalosEncryptionHandler.swift b/enzevalos_iphone/EnzevalosEncryptionHandler.swift index 72e382506e3eaa2905e5eabd9824519860ce2759..31e9507d9ee231281e803decd39e095838692183 100644 --- a/enzevalos_iphone/EnzevalosEncryptionHandler.swift +++ b/enzevalos_iphone/EnzevalosEncryptionHandler.swift @@ -123,7 +123,7 @@ class EnzevalosEncryptionHandler : EncryptionHandler { private init(){ - keychain = Keychain(service: "Enzevalos").accessibility(.WhenUnlocked) + keychain = Keychain(service: "Enzevalos")//FIXME: .accessibility(.WhenUnlocked) } func hasPersistentData(_ searchKey: String, encryptionType: EncryptionType) -> Bool { diff --git a/enzevalos_iphone/InitViewController.swift b/enzevalos_iphone/InitViewController.swift index cc1e71857df9a06d33d4fff9ab229a705032d2ee..b8aaaff1f96da10d9b78edb0227530abe2e55fbc 100644 --- a/enzevalos_iphone/InitViewController.swift +++ b/enzevalos_iphone/InitViewController.swift @@ -22,17 +22,17 @@ class InitViewController : UIViewController { let path = Bundle.main.path(forResource: "providers", ofType: "json") print(path) //manager.registerProvidersWithFilename(path) - print(manager.providerForEmail("alice2005@yahoo.com") == nil) - print(manager.providerForEmail("alice2005@aol.com") == nil) - print(manager.providerForEmail("aol.com") == nil) - print(manager.providerForMX("imap.aol.com") == nil) - print(manager.providerForMX("web") == nil) - print(manager.providerForMX("web.de") == nil) - print(manager.providerForIdentifier("web") == nil) - print(manager.providerForIdentifier("web.de") == nil) - print(manager.providerForIdentifier("alice2005@aol.com") == nil) - print(manager.providerForIdentifier("aol") == nil) - print(manager.providerForIdentifier("aol.com") == nil) + print(manager?.provider(forEmail: "alice2005@yahoo.com") == nil) + print(manager?.provider(forEmail: "alice2005@aol.com") == nil) + print(manager?.provider(forEmail: "aol.com") == nil) + print(manager?.provider(forMX: "imap.aol.com") == nil) + print(manager?.provider(forMX: "web") == nil) + print(manager?.provider(forMX: "web.de") == nil) + print(manager?.provider(forIdentifier: "web") == nil) + print(manager?.provider(forIdentifier: "web.de") == nil) + print(manager?.provider(forIdentifier: "alice2005@aol.com") == nil) + print(manager?.provider(forIdentifier: "aol") == nil) + print(manager?.provider(forIdentifier: "aol.com") == nil) } } diff --git a/enzevalos_iphone/Mail+CoreDataProperties.swift b/enzevalos_iphone/Mail+CoreDataProperties.swift index 70891d319011a43db53cbecbcb5d72c02621e396..2b77176ef82ab956a2e50350eebde70f42387bb9 100644 --- a/enzevalos_iphone/Mail+CoreDataProperties.swift +++ b/enzevalos_iphone/Mail+CoreDataProperties.swift @@ -12,7 +12,7 @@ import CoreData extension Mail { - @nonobjc public override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { + @nonobjc open override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { return NSFetchRequest(entityName: "Mail"); } diff --git a/enzevalos_iphone/MailHandler.swift b/enzevalos_iphone/MailHandler.swift index 7eae8f636fb33959cc0b92716fa6c2e565a830a7..b3d33264c224ca9864f070893eb906d7af15f713 100644 --- a/enzevalos_iphone/MailHandler.swift +++ b/enzevalos_iphone/MailHandler.swift @@ -210,7 +210,7 @@ class MailHandler { } //return if send successfully - func send(_ toEntrys: [String], ccEntrys: [String], bccEntrys: [String], subject: String, message: String, callback: @escaping (NSError?) -> Void) { + func send(_ toEntrys: [String], ccEntrys: [String], bccEntrys: [String], subject: String, message: String, callback: @escaping (Error?) -> Void) { //http://stackoverflow.com/questions/31485359/sending-mailcore2-plain-emails-in-swift let useraddr = (UserManager.loadUserValue(Attribute.userAddr) as! String) @@ -249,7 +249,7 @@ class MailHandler { sendOperation = session.sendOperation(with: sendData, from: userID, recipients: encPGP) //sendOperation = session.sendOperationWithData(builder.openPGPEncryptedMessageDataWithEncryptedData(sendData), from: userID, recipients: encPGP) //TODO handle different callbacks - sendOperation.start(callback as! (Error?) -> Void) + sendOperation.start(callback) builder.textBody = message } else { @@ -263,7 +263,7 @@ class MailHandler { sendData = builder.data() sendOperation = session.sendOperation(with: sendData, from: userID, recipients: unenc) //TODO handle different callbacks - sendOperation.start(callback as! (Error?) -> Void) + sendOperation.start(callback) } } @@ -495,11 +495,11 @@ func parseMail(_ error: Error?, parser: MCOMessageParser?, message: MCOIMAPMessa } - func checkIMAP(_ completion: @escaping (NSError?) -> Void) { + func checkIMAP(_ completion: @escaping (Error?) -> Void) { self.setupIMAPSession() - self.IMAPSession.checkAccountOperation().start(completion as! (Error?) -> Void) - self.IMAPSession.connectOperation().start(completion as! (Error?) -> Void) + self.IMAPSession.checkAccountOperation().start(completion/* as! (Error?) -> Void*/) + self.IMAPSession.connectOperation().start(completion/* as! (Error?) -> Void*/) } diff --git a/enzevalos_iphone/Onboarding.swift b/enzevalos_iphone/Onboarding.swift index 1d4b01631f0c406d3e50bc5908caef1daab557a8..198d0b83f7bd4863a0abe8f730a9726e42c5bf70 100644 --- a/enzevalos_iphone/Onboarding.swift +++ b/enzevalos_iphone/Onboarding.swift @@ -306,7 +306,7 @@ class Onboarding { return Onboard.OnboardingViewController(backgroundImage: background, contents: [page1]) } - static func checkContact(_ callback : (Bool) -> ()){ + static func checkContact(_ callback : @escaping (Bool) -> ()){ AppDelegate.getAppDelegate().requestForAccess(callback) } @@ -328,7 +328,7 @@ class Onboarding { return true } - static func imapCompletion(_ error: NSError?) { + static func imapCompletion(_ error: Error?) { //FIXME: vorher NSError? Mit Error? immer noch gültig? imapCheckDone = true imapCheck = error == nil if imapCheck { @@ -338,7 +338,7 @@ class Onboarding { fail() } - static func smtpCompletion(_ error: NSError?){ + static func smtpCompletion(_ error: Error?){ //FIXME: vorher NSError? Mit Error? immer noch gültig? smtpCheckDone = true smtpCheck = error == nil if smtpCheck { @@ -353,43 +353,43 @@ class Onboarding { if let mailAddress = mailaddress.text, !manualSet && mailAddress != "" && mailAddress.contains("@") { let guessedUserName = mailAddress.components(separatedBy: "@")[0] let provider = mailAddress.components(separatedBy: "@")[1] - UserManager.storeUserValue(mailAddress, attribute: Attribute.userAddr)//Attribute.attributeValues[Attribute.UserAddr] = addr - UserManager.storeUserValue(guessedUserName, attribute: Attribute.userName) + UserManager.storeUserValue(mailAddress as AnyObject?, attribute: Attribute.userAddr)//Attribute.attributeValues[Attribute.UserAddr] = addr + UserManager.storeUserValue(guessedUserName as AnyObject?, attribute: Attribute.userName) if provider == Provider.FU.rawValue { Providers.setValues(Provider.FU) - UserManager.storeUserValue("jakobsbode", attribute: Attribute.accountname) - UserManager.storeUserValue("jakobsbode", attribute: Attribute.userName) + UserManager.storeUserValue("jakobsbode" as AnyObject?, attribute: Attribute.accountname) + UserManager.storeUserValue("jakobsbode" as AnyObject?, attribute: Attribute.userName) } if provider == Provider.ZEDAT.rawValue { Providers.setValues(Provider.ZEDAT) - UserManager.storeUserValue("jakobsbode", attribute: Attribute.accountname) - UserManager.storeUserValue("jakobsbode", attribute: Attribute.userName) + UserManager.storeUserValue("jakobsbode" as AnyObject?, attribute: Attribute.accountname) + UserManager.storeUserValue("jakobsbode" as AnyObject?, attribute: Attribute.userName) } if provider == Provider.ENZEVALOS.rawValue { Providers.setValues(Provider.ENZEVALOS) - UserManager.storeUserValue(guessedUserName, attribute: Attribute.accountname) - UserManager.storeUserValue(guessedUserName, attribute: Attribute.userName) + UserManager.storeUserValue(guessedUserName as AnyObject?, attribute: Attribute.accountname) + UserManager.storeUserValue(guessedUserName as AnyObject?, attribute: Attribute.userName) } if provider == Provider.WEB.rawValue { Providers.setValues(Provider.WEB) } } if let pw = password.text, pw != "" { - UserManager.storeUserValue(pw, attribute: Attribute.userPW) + UserManager.storeUserValue(pw as AnyObject?, attribute: Attribute.userPW) } if manualSet { - UserManager.storeUserValue(imapServer.text, attribute: Attribute.imapHostname) - UserManager.storeUserValue(Int(imapPort.text!), attribute: Attribute.imapPort) - UserManager.storeUserValue(smtpServer.text, attribute: Attribute.smtpHostname) - UserManager.storeUserValue(Int(smtpPort.text!), attribute: Attribute.smtpPort) - UserManager.storeUserValue(mailaddress.text, attribute: Attribute.userAddr) - UserManager.storeUserValue(password.text!, attribute: Attribute.userPW) - UserManager.storeUserValue(username.text!, attribute: Attribute.userName) - UserManager.storeUserValue(username.text!, attribute: Attribute.accountname) - UserManager.storeUserValue(keyForValue(transportRows, value: imapTransDataDelegate.pickedValue)[0], attribute: Attribute.imapConnectionType) - UserManager.storeUserValue(keyForValue(authenticationRows, value: imapAuthDataDelegate.pickedValue)[0], attribute: Attribute.imapAuthType) - UserManager.storeUserValue(keyForValue(transportRows, value: smtpTransDataDelegate.pickedValue)[0], attribute: Attribute.smtpConnectionType) - UserManager.storeUserValue(keyForValue(authenticationRows, value: smtpAuthDataDelegate.pickedValue)[0], attribute: Attribute.smtpAuthType) + UserManager.storeUserValue(imapServer.text as AnyObject?, attribute: Attribute.imapHostname) + UserManager.storeUserValue(Int(imapPort.text!) as AnyObject?, attribute: Attribute.imapPort) + UserManager.storeUserValue(smtpServer.text as AnyObject?, attribute: Attribute.smtpHostname) + UserManager.storeUserValue(Int(smtpPort.text!) as AnyObject?, attribute: Attribute.smtpPort) + UserManager.storeUserValue(mailaddress.text as AnyObject?, attribute: Attribute.userAddr) + UserManager.storeUserValue(password.text! as AnyObject?, attribute: Attribute.userPW) + UserManager.storeUserValue(username.text! as AnyObject?, attribute: Attribute.userName) + UserManager.storeUserValue(username.text! as AnyObject?, attribute: Attribute.accountname) + UserManager.storeUserValue(keyForValue(transportRows, value: imapTransDataDelegate.pickedValue)[0] as AnyObject?, attribute: Attribute.imapConnectionType) + UserManager.storeUserValue(keyForValue(authenticationRows, value: imapAuthDataDelegate.pickedValue)[0] as AnyObject?, attribute: Attribute.imapAuthType) + UserManager.storeUserValue(keyForValue(transportRows, value: smtpTransDataDelegate.pickedValue)[0] as AnyObject?, attribute: Attribute.smtpConnectionType) + UserManager.storeUserValue(keyForValue(authenticationRows, value: smtpAuthDataDelegate.pickedValue)[0] as AnyObject?, attribute: Attribute.smtpAuthType) } } diff --git a/enzevalos_iphone/PGPKeyManagement.swift b/enzevalos_iphone/PGPKeyManagement.swift index 6b63ea04992c395eceae81b6442e1e26320c8ddc..56481828cbba8b3799205a87cc60d3c4c9aaefe9 100644 --- a/enzevalos_iphone/PGPKeyManagement.swift +++ b/enzevalos_iphone/PGPKeyManagement.swift @@ -58,7 +58,7 @@ class PGPKeyManagement { func getMaxIndex(_ fingerprint: String) -> Int64 { var index : Int64 = 0 if let indexData = encryptionHandler.getPersistentData(fingerprint+"-index", encryptionType: self.encryptionType){ - (indexData as NSData).getBytes(&index, length: sizeof(Int64)) + (indexData as NSData).getBytes(&index, length: MemoryLayout<Int64>.size) } return index @@ -70,11 +70,11 @@ class PGPKeyManagement { var existent = false if let indexData = encryptionHandler.getPersistentData(searchKey, encryptionType: self.encryptionType){ existent = true - (indexData as NSData).getBytes(&index, length: sizeof(Int64)) + (indexData as NSData).getBytes(&index, length: MemoryLayout<Int64>.size) } index += 1 - let indexData = Data(bytes: UnsafePointer<UInt8>(&index), count: sizeof(Int64)) + let indexData = Data(bytes: &index, count: MemoryLayout<Int64>.size)//Data(bytes: UnsafePointer<UInt8>(&index), length: MemoryLayout<Int64>.size) if !existent { encryptionHandler.addPersistentData(indexData, searchKey: searchKey, encryptionType: self.encryptionType) } diff --git a/enzevalos_iphone/ReadViewController.swift b/enzevalos_iphone/ReadViewController.swift index 0786756ada4b01eec1a8fb734276c1793a47fd1b..fb403dc8c1acaa43c5827c4464b3a1871926e70c 100644 --- a/enzevalos_iphone/ReadViewController.swift +++ b/enzevalos_iphone/ReadViewController.swift @@ -345,7 +345,7 @@ class ReadViewController: UITableViewController { } } else if segue.identifier == "showContact" { let destinationVC = segue.destination as! ContactViewController - if let sender = sender { + if let sender = sender as? [String: AnyObject?] { destinationVC.keyRecord = (sender["record"] as! KeyRecord) destinationVC.highlightEmail = (sender["email"] as! String) } diff --git a/enzevalos_iphone/SendViewController.swift b/enzevalos_iphone/SendViewController.swift index cc997394b4bf025d20cf96376614bfc9895885e9..497a56184450331d7f512171923a811973d5510f 100644 --- a/enzevalos_iphone/SendViewController.swift +++ b/enzevalos_iphone/SendViewController.swift @@ -594,7 +594,7 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni mailHandler.send(toEntrys as NSArray as! [String], ccEntrys: ccEntrys as NSArray as! [String], bccEntrys: [], subject: subject, message: message, callback: self.mailSend) } - func mailSend(_ error: NSError?) { + func mailSend(_ error: Error?) { if (error != nil) { NSLog("Error sending email: \(error)") AppDelegate.getAppDelegate().showMessage("An error occured", completion: nil) diff --git a/enzevalos_iphone/State+CoreDataProperties.swift b/enzevalos_iphone/State+CoreDataProperties.swift index 1ce6c39f5254a0c516709993db5ecfbbd4ddb10e..0dfe9ca928683aff790e35a5074178b4c25f5884 100644 --- a/enzevalos_iphone/State+CoreDataProperties.swift +++ b/enzevalos_iphone/State+CoreDataProperties.swift @@ -12,7 +12,7 @@ import CoreData extension State { - @nonobjc public override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { + @nonobjc open override class func fetchRequest() -> NSFetchRequest<NSFetchRequestResult> { return NSFetchRequest(entityName: "State"); } diff --git a/enzevalos_iphone/Theme.swift b/enzevalos_iphone/Theme.swift index d8c94afb980b791b76d041ff99454ec0f433c05f..f2e220236550e00c8f2d7da5bdf1ab1fde1ede53 100644 --- a/enzevalos_iphone/Theme.swift +++ b/enzevalos_iphone/Theme.swift @@ -80,7 +80,7 @@ enum Theme: Int{ struct ThemeManager{ static func currentTheme() -> Theme { - if let storedTheme = (UserDefaults.standard.value(forKey: SelectedThemeKey)? as AnyObject).intValue { + if let storedTheme = (UserDefaults.standard.value(forKey: SelectedThemeKey) as? Int) { return Theme(rawValue: storedTheme)! } else { return .very_strong_security_indicator diff --git a/enzevalos_iphone/UserData.swift b/enzevalos_iphone/UserData.swift index ac6355c6774bfbb8c10e332724bf0815da45f9b3..aa99d3656c1457ac5664e002b5bf625549f1782c 100644 --- a/enzevalos_iphone/UserData.swift +++ b/enzevalos_iphone/UserData.swift @@ -38,11 +38,11 @@ enum Attribute: Int{ case .imapConnectionType: return MCOConnectionType.TLS.rawValue as AnyObject? case .imapAuthType: - return MCOAuthType.SASLPlain.rawValue as AnyObject? + return MCOAuthType.saslPlain.rawValue as AnyObject? case .smtpConnectionType: - return MCOConnectionType.StartTLS.rawValue as AnyObject? + return MCOConnectionType.startTLS.rawValue as AnyObject? case .smtpAuthType: - return MCOAuthType.SASLPlain.rawValue as AnyObject? + return MCOAuthType.saslPlain.rawValue as AnyObject? case .publicKey: return "" as AnyObject? @@ -50,7 +50,7 @@ enum Attribute: Int{ } static let allAttributes = [accountname, userName, userAddr, userPW, smtpHostname, smtpPort, imapHostname, imapPort, prefEncryption, publicKey, autocryptType] - static var attributeValues: [Attribute : AnyObject?] = [.accountname : "Alice" as AnyObject?, .userName : "Alice2005" as Optional<AnyObject>, .userAddr : "alice2005@web.de" as Optional<AnyObject>, .userPW : "WJ$CE:EtUo3E$" as Optional<AnyObject>, .smtpHostname : "smtp.web.de" as Optional<AnyObject>, .smtpPort : 587 as Optional<AnyObject>, .imapHostname : "imap.web.de" as Optional<AnyObject>, .imapPort : 993, .prefEncryption : "yes", .autocryptType : "p", .publicKey : ""] + static var attributeValues: [Attribute : AnyObject?] = [.accountname : "Alice" as AnyObject?, .userName : "Alice2005" as Optional<AnyObject>, .userAddr : "alice2005@web.de" as Optional<AnyObject>, .userPW : "WJ$CE:EtUo3E$" as Optional<AnyObject>, .smtpHostname : "smtp.web.de" as Optional<AnyObject>, .smtpPort : 587 as Optional<AnyObject>, .imapHostname : "imap.web.de" as Optional<AnyObject>, .imapPort : 993 as AnyObject?, .prefEncryption : "yes" as AnyObject?, .autocryptType : "p" as AnyObject?, .publicKey : "" as AnyObject?] } diff --git a/enzevalos_iphone/VENDataDelegate.swift b/enzevalos_iphone/VENDataDelegate.swift index b2158bb27b43e43718671425172c6e21b1c2aea2..2e9a5e2d824012a1f3af991e0f793aadc2dba9f4 100644 --- a/enzevalos_iphone/VENDataDelegate.swift +++ b/enzevalos_iphone/VENDataDelegate.swift @@ -89,13 +89,13 @@ class VENDataDelegate : NSObject, VENTokenFieldDataSource , VENTokenFieldDelegat return tokenField.textTokens[Int(index)] as! String } - func numberOfTokensInTokenField(tokenField: VENTokenField) -> UInt { + func numberOfTokens(in tokenField: VENTokenField) -> UInt { return UInt((tokenField.textTokens.count)) } func tokenFieldCollapsedText(_ tokenField: VENTokenField) -> String { var text : String = "names: " - text.appendContentsOf(String(tokenField.dataSource?.numberOfTokensInTokenField!(tokenField))) + text.append(String(describing: tokenField.dataSource?.numberOfTokens!(in: tokenField))) return text }