From feed49a332cba458515982006c064d0e7b00c0bb Mon Sep 17 00:00:00 2001 From: jakob <jakob.bode@fu-berlin.de> Date: Wed, 15 Aug 2018 15:57:12 +0200 Subject: [PATCH] change function declaration --- enzevalos_iphone/OnboardingDataHandler.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/enzevalos_iphone/OnboardingDataHandler.swift b/enzevalos_iphone/OnboardingDataHandler.swift index b11aa887..acaf1a60 100644 --- a/enzevalos_iphone/OnboardingDataHandler.swift +++ b/enzevalos_iphone/OnboardingDataHandler.swift @@ -41,16 +41,18 @@ class OnboardingDataHandler { - func setSettings(with mailaddress: String, password: String, username: String, imapServer: String, imapPort: Int, imapConnectionType: String, imapAuthenticationType: String, smtpServer: String, smtpPort: Int, smtpConnectionType: String, smtpAuthenticationType: String) { + func setSettings(with mailaddress: String, password: String, username: String, imapServer: String, imapPort: Int, imapConnectionType: Int, imapAuthenticationType: Int, smtpServer: String, smtpPort: Int, smtpConnectionType: Int, smtpAuthenticationType: Int) { if let mailconfig = mailconfig { //TODO: Update mailconfig print("update Mail cpnfig!") } else { - let imapAuth = MCOAuthType.init(rawValue: keyForValue(authenticationOptions, value: imapAuthenticationType)[0]) - let imapCon = MCOConnectionType.init(rawValue: keyForValue(transportOptions, value: imapConnectionType)[0]) - let smtpAuth = MCOAuthType.init(rawValue: keyForValue(authenticationOptions, value: smtpAuthenticationType)[0]) - let smtpCon = MCOConnectionType.init(rawValue: keyForValue(transportOptions, value: smtpConnectionType)[0]) + + + let imapAuth = MCOAuthType.init(rawValue: imapAuthenticationType % authenticationOptions.count) + let imapCon = MCOConnectionType.init(rawValue: imapConnectionType % transportOptions.count) + let smtpAuth = MCOAuthType.init(rawValue: smtpAuthenticationType % authenticationOptions.count) + let smtpCon = MCOConnectionType.init(rawValue: smtpConnectionType % transportOptions.count) mailconfig = MailConfigurator(userAddr: mailaddress, password: password, accountName: nil, displayName: nil, imapHostname: imapServer, imapPort: UInt32(imapPort), imapAuthType: imapAuth , imapConType: imapCon, smtpHostname: smtpServer, smtpPort: UInt32(smtpPort), smtpAuthType: smtpAuth, smtpConType: smtpCon) } -- GitLab