project: add static code analysis

This commit:
- adds swiftlint analysis as custom build phase
- to install, see: https://github.com/realm/SwiftLint
- fix almost every error/warning messages detected by swiftlint

Change-Id: I0d15cecaa33c4f79dcd1417a2169f1e66fd2e551
diff --git a/Ring/.swiftlint.yml b/Ring/.swiftlint.yml
new file mode 100644
index 0000000..07e9a65
--- /dev/null
+++ b/Ring/.swiftlint.yml
@@ -0,0 +1,45 @@
+disabled_rules: # rule identifiers to exclude from running
+
+opt_in_rules: # some rules are only opt-in
+  - empty_count
+
+excluded: # paths to ignore during linting. Takes precedence over `included`.
+  - Carthage
+  - Pods
+
+force_cast: warning # implicitly
+force_try:
+  severity: warning # explicitly
+
+type_body_length:
+  - 300 # warning
+  - 400 # error
+
+type_name:
+  min_length: 4 # only warning
+  max_length: # warning and error
+    warning: 40
+    error: 50
+  excluded: iPhone # excluded via string
+
+identifier_name:
+  min_length: # only min_length
+    error: 3 # only error
+  excluded: # excluded via string array
+    - id
+    - URL
+    - GlobalAPIKey
+
+reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji)
+
+function_body_length:
+  - 75
+  - 100
+
+file_length:
+  warning: 600
+  error: 1200
+
+line_length:
+  warning: 200
+  error: 250
diff --git a/Ring/Ring.xcodeproj/project.pbxproj b/Ring/Ring.xcodeproj/project.pbxproj
index 9062055..e381f8a 100644
--- a/Ring/Ring.xcodeproj/project.pbxproj
+++ b/Ring/Ring.xcodeproj/project.pbxproj
@@ -807,10 +807,11 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 04399A201D1C2D9D00E99CD9 /* Build configuration list for PBXNativeTarget "Ring" */;
 			buildPhases = (
+				1ABE07C31F0C28E000D36361 /* ⚠️ Swiftlint Analysis */,
+				0273C3011E0C655900CF00BA /* ⚙️ Copy Frameworks */,
 				043999EF1D1C2D9D00E99CD9 /* Sources */,
 				043999F01D1C2D9D00E99CD9 /* Frameworks */,
 				043999F11D1C2D9D00E99CD9 /* Resources */,
-				0273C3011E0C655900CF00BA /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -947,7 +948,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		0273C3011E0C655900CF00BA /* ShellScript */ = {
+		0273C3011E0C655900CF00BA /* ⚙️ Copy Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -961,12 +962,27 @@
 				"$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/RxRealm.framework",
 			);
+			name = "⚙️ Copy Frameworks";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "/usr/local/bin/carthage copy-frameworks";
 		};
+		1ABE07C31F0C28E000D36361 /* ⚠️ Swiftlint Analysis */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			name = "⚠️ Swiftlint Analysis";
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if which swiftlint > /dev/null; then\n    swiftlint\nelse\n    echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
+		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */
diff --git a/Ring/Ring/Account/AccountConfigModel.swift b/Ring/Ring/Account/AccountConfigModel.swift
index 9e14201..ff9bbb1 100644
--- a/Ring/Ring/Account/AccountConfigModel.swift
+++ b/Ring/Ring/Account/AccountConfigModel.swift
@@ -28,30 +28,30 @@
  - errors concerning the state of the accounts
  */
 enum AccountState: String {
-    case Registered = "REGISTERED"
-    case Ready = "READY"
-    case Unregistered = "UNREGISTERED"
-    case Trying = "TRYING"
-    case Error = "ERROR"
-    case ErrorGeneric = "ERROR_GENERIC"
-    case ErrorAuth = "ERROR_AUTH"
-    case ErrorNetwork = "ERROR_NETWORK"
-    case ErrorHost = "ERROR_HOST"
-    case ErrorConfStun = "ERROR_CONF_STUN"
-    case ErrorExistStun = "ERROR_EXIST_STUN"
-    case ErrorServiceUnavailable = "ERROR_SERVICE_UNAVAILABLE"
-    case ErrorNotAcceptable = "ERROR_NOT_ACCEPTABLE"
-    case ErrorRequestTimeout = "Request Timeout"
-    case ErrorNeedMigration = "ERROR_NEED_MIGRATION"
-    case Initializing = "INITIALIZING"
+    case registered = "REGISTERED"
+    case ready = "READY"
+    case unregistered = "UNREGISTERED"
+    case trying = "TRYING"
+    case error = "ERROR"
+    case errorGeneric = "ERROR_GENERIC"
+    case errorAuth = "ERROR_AUTH"
+    case errorNetwork = "ERROR_NETWORK"
+    case errorHost = "ERROR_HOST"
+    case errorConfStun = "ERROR_CONF_STUN"
+    case errorExistStun = "ERROR_EXIST_STUN"
+    case errorServiceUnavailable = "ERROR_SERVICE_UNAVAILABLE"
+    case errorNotAcceptable = "ERROR_NOT_ACCEPTABLE"
+    case errorRequestTimeout = "Request Timeout"
+    case errorNeedMigration = "ERROR_NEED_MIGRATION"
+    case initializing = "INITIALIZING"
 }
 
 /**
  The different types of account handled by Ring.
  */
 enum AccountType: String {
-    case Ring = "RING"
-    case SIP = "SIP"
+    case ring = "RING"
+    case sip = "SIP"
 }
 
 /**
@@ -63,11 +63,11 @@
  - expose a clear interface to manipulate the configuration of an account
  - keep this configuration
  */
-class AccountConfigModel :Object {
+class AccountConfigModel: Object {
     /**
      The collection of configuration elements.
      */
-    fileprivate var configValues = Dictionary<ConfigKeyModel, String>()
+    fileprivate var configValues = [ConfigKeyModel: String]()
 
     /**
      Constructor.
@@ -76,7 +76,7 @@
 
      - Parameter details: an optional collection of configuration elements
      */
-    convenience init(withDetails details: Dictionary<String, String>?) {
+    convenience init(withDetails details: [String: String]?) {
         self.init()
         if details != nil {
             for (key, value) in details! {
@@ -98,7 +98,7 @@
 
      - Returns: a boolean indicating the value of the configuration element.
      */
-    func getBool(forConfigKeyModel configKeyModel : ConfigKeyModel) -> Bool {
+    func getBool(forConfigKeyModel configKeyModel: ConfigKeyModel) -> Bool {
         return "true".caseInsensitiveCompare(self.get(withConfigKeyModel: configKeyModel))
             == ComparisonResult.orderedSame
     }
@@ -111,8 +111,8 @@
      - Returns: the value of the configuration element as a String. The result will be an empty
      string in case of an issue.
      */
-    func get(withConfigKeyModel configKeyModel : ConfigKeyModel) -> String {
-        let value:String? = self.configValues[configKeyModel]
+    func get(withConfigKeyModel configKeyModel: ConfigKeyModel) -> String {
+        let value: String? = self.configValues[configKeyModel]
         return value != nil ? value! : ""
     }
 }
diff --git a/Ring/Ring/Account/AccountCredentialsModel.swift b/Ring/Ring/Account/AccountCredentialsModel.swift
index 7180674..4ddfddd 100644
--- a/Ring/Ring/Account/AccountCredentialsModel.swift
+++ b/Ring/Ring/Account/AccountCredentialsModel.swift
@@ -26,7 +26,7 @@
  - NotEnoughData: some information are missing to create the object
  */
 enum CredentialsError: Error {
-    case NotEnoughData
+    case notEnoughData
 }
 
 /**
@@ -35,7 +35,7 @@
  Its responsability:
  - keep the credentials of an account.
  */
-class AccountCredentialsModel :Object {
+class AccountCredentialsModel: Object {
     dynamic var username: String = ""
     dynamic var password: String = ""
     dynamic var accountRealm: String = ""
@@ -63,14 +63,14 @@
 
      - Throws: CredentialsError
      */
-    convenience init(withRawaData raw: Dictionary<String, String>) throws {
+    convenience init(withRawaData raw: [String: String]) throws {
         self.init()
-        let username = raw[ConfigKey.AccountUsername.rawValue]
-        let password = raw[ConfigKey.AccountPassword.rawValue]
-        let accountRealm = raw[ConfigKey.AccountRealm.rawValue]
+        let username = raw[ConfigKey.accountUsername.rawValue]
+        let password = raw[ConfigKey.accountPassword.rawValue]
+        let accountRealm = raw[ConfigKey.accountRealm.rawValue]
 
         if username == nil || password == nil || accountRealm == nil {
-            throw CredentialsError.NotEnoughData
+            throw CredentialsError.notEnoughData
         }
 
         self.username = username!
diff --git a/Ring/Ring/Account/AccountModel.swift b/Ring/Ring/Account/AccountModel.swift
index 70f8ddd..ddf1760 100644
--- a/Ring/Ring/Account/AccountModel.swift
+++ b/Ring/Ring/Account/AccountModel.swift
@@ -26,13 +26,13 @@
  Errors that can be thrown when trying to build an AccountModel
  */
 enum AccountModelError: Error {
-    case UnexpectedError
+    case unexpectedError
 }
 
 /**
  A class representing an account.
  */
-class AccountModel : Object {
+class AccountModel: Object {
     // MARK: Public members
     dynamic var id: String = ""
     dynamic var registeringUsername = false
@@ -48,10 +48,10 @@
     }
 
     convenience init(withAccountId accountId: String,
-         details: AccountConfigModel,
-         volatileDetails: AccountConfigModel,
-         credentials: List<AccountCredentialsModel>,
-         devices: [DeviceModel]) throws {
+                     details: AccountConfigModel,
+                     volatileDetails: AccountConfigModel,
+                     credentials: List<AccountCredentialsModel>,
+                     devices: [DeviceModel]) throws {
         self.init()
         self.id = accountId
         self.details = details
@@ -59,7 +59,7 @@
         self.devices.append(objectsIn: devices)
     }
 
-    public static func ==(lhs: AccountModel, rhs: AccountModel) -> Bool {
+    public static func == (lhs: AccountModel, rhs: AccountModel) -> Bool {
         return lhs.id == rhs.id
     }
 
diff --git a/Ring/Ring/Account/AccountModelHelper.swift b/Ring/Ring/Account/AccountModelHelper.swift
index 041d9d6..6b9dadc 100644
--- a/Ring/Ring/Account/AccountModelHelper.swift
+++ b/Ring/Ring/Account/AccountModelHelper.swift
@@ -39,9 +39,9 @@
      - Returns: true if the account is considered as a SIP account
      */
     func isAccountSip() -> Bool {
-        let sipString = AccountType.SIP.rawValue
+        let sipString = AccountType.sip.rawValue
         let accountType = self.account.details?
-            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .AccountType))
+            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .accountType))
         return sipString.compare(accountType!) == ComparisonResult.orderedSame
     }
 
@@ -51,9 +51,9 @@
      - Returns: true if the account is considered as a Ring account
      */
     func isAccountRing() -> Bool {
-        let ringString = AccountType.Ring.rawValue
+        let ringString = AccountType.ring.rawValue
         let accountType = self.account.details?
-            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .AccountType))
+            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .accountType))
         return ringString.compare(accountType!) == ComparisonResult.orderedSame
     }
 
@@ -64,7 +64,7 @@
      */
     func isEnabled() -> Bool {
         return (self.account.details!
-            .getBool(forConfigKeyModel: ConfigKeyModel.init(withKey: .AccountEnable)))
+            .getBool(forConfigKeyModel: ConfigKeyModel.init(withKey: .accountEnable)))
     }
 
     /**
@@ -74,7 +74,7 @@
      */
     func getRegistrationState() -> String {
         return (self.account.volatileDetails!
-            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .AccountRegistrationStatus)))
+            .get(withConfigKeyModel: ConfigKeyModel.init(withKey: .accountRegistrationStatus)))
     }
 
     /**
@@ -84,16 +84,16 @@
      */
     func isInError() -> Bool {
         let state = self.getRegistrationState()
-        return (state.compare(AccountState.Error.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorAuth.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorConfStun.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorExistStun.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorGeneric.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorHost.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorNetwork.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorNotAcceptable.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorServiceUnavailable.rawValue) == ComparisonResult.orderedSame) ||
-            (state.compare(AccountState.ErrorRequestTimeout.rawValue) == ComparisonResult.orderedSame)
+        return (state.compare(AccountState.error.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorAuth.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorConfStun.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorExistStun.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorGeneric.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorHost.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorNetwork.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorNotAcceptable.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorServiceUnavailable.rawValue) == ComparisonResult.orderedSame) ||
+            (state.compare(AccountState.errorRequestTimeout.rawValue) == ComparisonResult.orderedSame)
     }
 
     /**
@@ -102,18 +102,16 @@
      - Parameter: a list of credentials to apply to the account. A nil parameter will clear the
      credentials of the account.
      */
-    mutating func setCredentials(_ credentials: Array<Dictionary<String, String>>?) -> AccountModel {
+    mutating func setCredentials(_ credentials: [[String: String]]?) -> AccountModel {
         self.account.credentialDetails.removeAll()
         if credentials != nil {
             for (credential) in credentials! {
                 do {
                     let accountCredentialModel = try AccountCredentialsModel(withRawaData: credential)
                     self.account.credentialDetails.append(accountCredentialModel)
-                }
-                catch CredentialsError.NotEnoughData {
+                } catch CredentialsError.notEnoughData {
                     print("Not enough data to create a credential")
-                }
-                catch {
+                } catch {
                     print("Unexpected error")
                 }
             }
@@ -121,9 +119,9 @@
         return self.account
     }
 
-    var ringId :String? {
+    var ringId: String? {
 
-        let accountUsernameKey = ConfigKeyModel(withKey: ConfigKey.AccountUsername)
+        let accountUsernameKey = ConfigKeyModel(withKey: ConfigKey.accountUsername)
         let accountUsername = self.account.details?.get(withConfigKeyModel: accountUsernameKey)
 
         let ringIdPrefix = "ring:"
diff --git a/Ring/Ring/Account/ConfigKeyModel.swift b/Ring/Ring/Account/ConfigKeyModel.swift
index 6ed4263..4d83323 100644
--- a/Ring/Ring/Account/ConfigKeyModel.swift
+++ b/Ring/Ring/Account/ConfigKeyModel.swift
@@ -22,81 +22,81 @@
  The different configuration keys handled by Ring.
  */
 enum ConfigKey: String {
-    case Mailbox = "Account.mailbox"
-    case RegistrationExpire = "Account.registrationExpire"
-    case CredentialNumber = "Credential.count"
-    case AccountDTMFType = "Account.dtmfType"
-    case RingtonePath = "Account.ringtonePath"
-    case RingtoneEnabled = "Account.ringtoneEnabled"
-    case KeepAliveEnabled = "Account.keepAliveEnabled"
-    case LocalInterface = "Account.localInterface"
-    case PublishedSameAsLocal = "Account.publishedSameAsLocal"
-    case LocalPort = "Account.localPort"
-    case PublishedPort = "Account.publishedPort"
-    case PublishedAddress = "Account.publishedAddress"
-    case StunServer = "STUN.server"
-    case StunEnable = "STUN.enable"
-    case TurnServer = "TURN.server"
-    case TurnEnable = "TURN.enable"
-    case TurnUsername = "TURN.username"
-    case TurnPassword = "TURN.password"
-    case TurnRealm = "TURN.realm"
-    case AudioPortMin = "Account.audioPortMin"
-    case AudioPortMax = "Account.audioPortMax"
-    case AccountUserAgent = "Account.useragent"
-    case AccountUpnpEnabled = "Account.upnpEnabled"
-    case AccountRouteSet = "Account.routeset"
-    case AccountAutoAnswer = "Account.autoAnswer"
-    case AccountAlias = "Account.alias"
-    case AccountHostname = "Account.hostname"
-    case AccountUsername = "Account.username"
-    case AccountPassword = "Account.password"
-    case AccountRealm = "Account.realm"
-    case AccountType = "Account.type"
-    case AccountEnable = "Account.enable"
-    case AccountActive = "Account.active"
-    case AccountDeviceId = "Account.deviceID"
-    case VideoEnabled = "Account.videoEnabled"
-    case VideoPortMin = "Account.videoPortMin"
-    case VideoPortMax = "Account.videoPortMax"
-    case PresenceEnabled = "Account.presenceEnabled"
-    case ArchivePassword = "Account.archivePassword"
-    case ArchivePIN = "Account.archivePIN"
-    case DisplayName = "Account.displayName"
-    case EthAccount = "ETH.account"
-    case TLSListenerPort = "TLS.listenerPort"
-    case TLSEnable = "TLS.enable"
-    case TLSCaListFile = "TLS.certificateListFile"
-    case TLSPrivateKeyFile = "TLS.privateKeyFile"
-    case TLSPassword = "TLS.password"
-    case TLSMethod = "TLS.method"
-    case TLSCiphers = "TLS.ciphers"
-    case TLSServerName = "TLS.serverName"
-    case TLSVerifyServer = "TLS.verifyServer"
-    case TLSVerifyClient = "TLS.verifyClient"
-    case TLSRequireClientCertificate = "TLS.requireClientCertificate"
-    case TLSNegociationTimeoutSec = "TLS.negotiationTimeoutSec"
-    case AccountRegisteredName = "Account.registredName"
-    case AccountRegistrationStatus = "Account.registrationStatus"
-    case AccountRegistrationStateCode = "Account.registrationCode"
-    case AccountRegistrationStateDesc = "Account.registrationDescription"
-    case SRTPEnable = "SRTP.enable"
-    case SRTPKeyExchange = "SRTP.keyExchange"
-    case SRTPEncryptionAlgo = "SRTP.encryptionAlgorithm"
-    case SRTPRTPFallback = "SRTP.rtpFallback"
-    case RingNsAccount = "RingNS.account"
-    case RingNsHost = "RingNS.host"
-    case DHTPort = "DHT.port"
-    case DHTPublicIn = "DHT.PublicInCalls"
-    case AccountAllowCertFromHistory = "Account.allowCertFromHistory"
-    case AccountAllowCertFromTrusted = "Account.allowCertFromTrusted"
-    case AccountAllowCertFromContact = "Account.allowCertFromContact"
-    case AccountHasCustomUserAgent = "Account.hasCustomUserAgent"
-    case AccountActiveCallLimit = "Account.activeCallLimit"
-    case TLSCertificateFile = "TLS.certificateFile"
-    case RingNsURI = "RingNS.uri"
-    case AccountPresenceSubscribeSupported = "Account.presenceSubscribeSupported"
-    case AccountDeviceName = "Account.deviceName"
+    case mailbox = "Account.mailbox"
+    case registrationExpire = "Account.registrationExpire"
+    case credentialNumber = "Credential.count"
+    case accountDTMFType = "Account.dtmfType"
+    case ringtonePath = "Account.ringtonePath"
+    case ringtoneEnabled = "Account.ringtoneEnabled"
+    case keepAliveEnabled = "Account.keepAliveEnabled"
+    case localInterface = "Account.localInterface"
+    case publishedSameAsLocal = "Account.publishedSameAsLocal"
+    case localPort = "Account.localPort"
+    case publishedPort = "Account.publishedPort"
+    case publishedAddress = "Account.publishedAddress"
+    case stunServer = "STUN.server"
+    case stunEnable = "STUN.enable"
+    case turnServer = "TURN.server"
+    case turnEnable = "TURN.enable"
+    case turnUsername = "TURN.username"
+    case turnPassword = "TURN.password"
+    case turnRealm = "TURN.realm"
+    case audioPortMin = "Account.audioPortMin"
+    case audioPortMax = "Account.audioPortMax"
+    case accountUserAgent = "Account.useragent"
+    case accountUpnpEnabled = "Account.upnpEnabled"
+    case accountRouteSet = "Account.routeset"
+    case accountAutoAnswer = "Account.autoAnswer"
+    case accountAlias = "Account.alias"
+    case accountHostname = "Account.hostname"
+    case accountUsername = "Account.username"
+    case accountPassword = "Account.password"
+    case accountRealm = "Account.realm"
+    case accountType = "Account.type"
+    case accountEnable = "Account.enable"
+    case accountActive = "Account.active"
+    case accountDeviceId = "Account.deviceID"
+    case videoEnabled = "Account.videoEnabled"
+    case videoPortMin = "Account.videoPortMin"
+    case videoPortMax = "Account.videoPortMax"
+    case presenceEnabled = "Account.presenceEnabled"
+    case archivePassword = "Account.archivePassword"
+    case archivePIN = "Account.archivePIN"
+    case displayName = "Account.displayName"
+    case ethAccount = "ETH.account"
+    case tlsListenerPort = "TLS.listenerPort"
+    case tlsEnable = "TLS.enable"
+    case tlsCaListFile = "TLS.certificateListFile"
+    case tlsPrivateKeyFile = "TLS.privateKeyFile"
+    case tlsPassword = "TLS.password"
+    case tlsMethod = "TLS.method"
+    case tlsCiphers = "TLS.ciphers"
+    case tlsServerName = "TLS.serverName"
+    case tlsVerifyServer = "TLS.verifyServer"
+    case tlsVerifyClient = "TLS.verifyClient"
+    case tlsRequireClientCertificate = "TLS.requireClientCertificate"
+    case tlsNegociationTimeoutSec = "TLS.negotiationTimeoutSec"
+    case accountRegisteredName = "Account.registredName"
+    case accountRegistrationStatus = "Account.registrationStatus"
+    case accountRegistrationStateCode = "Account.registrationCode"
+    case accountRegistrationStateDesc = "Account.registrationDescription"
+    case srtpEnable = "SRTP.enable"
+    case srtpKeyExchange = "SRTP.keyExchange"
+    case srtpEncryptionAlgo = "SRTP.encryptionAlgorithm"
+    case srtpRTPFallback = "SRTP.rtpFallback"
+    case ringNsAccount = "RingNS.account"
+    case ringNsHost = "RingNS.host"
+    case dhtPort = "DHT.port"
+    case dhtPublicIn = "DHT.PublicInCalls"
+    case accountAllowCertFromHistory = "Account.allowCertFromHistory"
+    case accountAllowCertFromTrusted = "Account.allowCertFromTrusted"
+    case accountAllowCertFromContact = "Account.allowCertFromContact"
+    case accountHasCustomUserAgent = "Account.hasCustomUserAgent"
+    case accountActiveCallLimit = "Account.activeCallLimit"
+    case tlsCertificateFile = "TLS.certificateFile"
+    case ringNsURI = "RingNS.uri"
+    case accountPresenceSubscribeSupported = "Account.presenceSubscribeSupported"
+    case accountDeviceName = "Account.deviceName"
 }
 
 /**
@@ -111,15 +111,15 @@
     /**
      List of all the ConfigKeys that are considered as TwoStates configurations.
      */
-    let twoStates: Array<ConfigKey> = [.AccountEnable,
-                                       .VideoEnabled,
-                                       .RingtoneEnabled,
-                                       .KeepAliveEnabled,
-                                       .PublishedSameAsLocal,
-                                       .StunEnable,
-                                       .TurnEnable,
-                                       .AccountAutoAnswer,
-                                       .AccountUpnpEnabled]
+    let twoStates: [ConfigKey] = [.accountEnable,
+                                  .videoEnabled,
+                                  .ringtoneEnabled,
+                                  .keepAliveEnabled,
+                                  .publishedSameAsLocal,
+                                  .stunEnable,
+                                  .turnEnable,
+                                  .accountAutoAnswer,
+                                  .accountUpnpEnabled]
 
     /**
      Constructor.
diff --git a/Ring/Ring/Account/CreateRingAccountViewModel.swift b/Ring/Ring/Account/CreateRingAccountViewModel.swift
index 91eda06..97fd4bc 100644
--- a/Ring/Ring/Account/CreateRingAccountViewModel.swift
+++ b/Ring/Ring/Account/CreateRingAccountViewModel.swift
@@ -53,29 +53,29 @@
      */
     fileprivate var nameService: NameService
 
-    //MARK: - Rx Variables and Observers
+    // MARK: - Rx Variables and Observers
 
     var username = Variable<String>("")
     var password = Variable<String>("")
     var repeatPassword = Variable<String>("")
 
-    var passwordValid :Observable<Bool>!
-    var passwordsEqual :Observable<Bool>!
-    var canCreateAccount :Observable<Bool>!
+    var passwordValid: Observable<Bool>!
+    var passwordsEqual: Observable<Bool>!
+    var canCreateAccount: Observable<Bool>!
     var registerUsername = Variable<Bool>(true)
 
-    var hasNewPassword :Observable<Bool>!
-    var hidePasswordError :Observable<Bool>!
-    var hideRepeatPasswordError :Observable<Bool>!
+    var hasNewPassword: Observable<Bool>!
+    var hidePasswordError: Observable<Bool>!
+    var hideRepeatPasswordError: Observable<Bool>!
 
     var accountCreationState = PublishSubject<AccountCreationState>()
 
     /**
      Message presented to the user in function of the status of the current username lookup request
      */
-    var usernameValidationMessage :Observable<String>!
+    var usernameValidationMessage: Observable<String>!
 
-    //MARK: -
+    // MARK: -
 
     /**
      Default constructor
@@ -121,15 +121,14 @@
         }.shareReplay(1).observeOn(MainScheduler.instance)
 
         self.passwordsEqual = Observable<Bool>.combineLatest(self.password.asObservable(),
-                                                             self.repeatPassword.asObservable()) { password,repeatPassword in
+                                                             self.repeatPassword.asObservable()) { password, repeatPassword in
                                                                 return password == repeatPassword
         }.shareReplay(1).observeOn(MainScheduler.instance)
 
         self.canCreateAccount = Observable<Bool>.combineLatest(self.registerUsername.asObservable(),
                                                                self.nameService.usernameValidationStatus,
                                                                self.passwordValid,
-                                                               self.passwordsEqual)
-        { registerUsername, usernameValidationStatus, passwordValid, passwordsEquals in
+                                                               self.passwordsEqual) { registerUsername, usernameValidationStatus, passwordValid, passwordsEquals in
             if registerUsername {
                 return usernameValidationStatus == .valid && passwordValid && passwordsEquals
             } else {
@@ -158,7 +157,7 @@
         }).shareReplay(1).observeOn(MainScheduler.instance)
 
         hasNewPassword = self.password.asObservable().map({ password in
-            return password.characters.count > 0
+            return !password.characters.isEmpty
         })
 
         hidePasswordError = Observable<Bool>.combineLatest(self.passwordValid, hasNewPassword) { isPasswordValid, hasNewPassword in
@@ -166,10 +165,10 @@
         }
 
         let hasRepeatPassword = self.repeatPassword.asObservable().map({ repeatPassword in
-            return repeatPassword.characters.count > 0
+            return !repeatPassword.characters.isEmpty
         })
 
-        hideRepeatPasswordError = Observable<Bool>.combineLatest(self.passwordValid,self.passwordsEqual, hasRepeatPassword) { isPasswordValid, isPasswordsEquals, hasRepeatPassword in
+        hideRepeatPasswordError = Observable<Bool>.combineLatest(self.passwordValid, self.passwordsEqual, hasRepeatPassword) { isPasswordValid, isPasswordsEquals, hasRepeatPassword in
             return !isPasswordValid || isPasswordsEquals || !hasRepeatPassword
         }
     }
@@ -188,11 +187,11 @@
         self.accountService
             .sharedResponseStream
             .filter({ event in
-                return event.eventType == ServiceEventType.RegistrationStateChanged &&
-                    event.getEventInput(ServiceEventInput.RegistrationState) == Unregistered &&
+                return event.eventType == ServiceEventType.registrationStateChanged &&
+                    event.getEventInput(ServiceEventInput.registrationState) == Unregistered &&
                     self.registerUsername.value
             })
-            .subscribe(onNext:{ [unowned self] event in
+            .subscribe(onNext: { [unowned self] _ in
 
                 //Launch the process of name registration
                 if let currentAccountId = self.accountService.currentAccount?.id {
@@ -207,20 +206,20 @@
         self.accountService
             .sharedResponseStream
             .subscribe(onNext: { [unowned self] event in
-                if event.getEventInput(ServiceEventInput.RegistrationState) == Unregistered {
+                if event.getEventInput(ServiceEventInput.registrationState) == Unregistered {
                     self.accountCreationState.onNext(.success)
-                } else if event.getEventInput(ServiceEventInput.RegistrationState) == ErrorGeneric {
+                } else if event.getEventInput(ServiceEventInput.registrationState) == ErrorGeneric {
                     self.accountCreationState.onError(AccountCreationError.generic)
-                } else if event.getEventInput(ServiceEventInput.RegistrationState) == ErrorNetwork {
+                } else if event.getEventInput(ServiceEventInput.registrationState) == ErrorNetwork {
                     self.accountCreationState.onError(AccountCreationError.network)
                 }
-            }, onError: { error in
+            }, onError: { _ in
                 self.accountCreationState.onError(AccountCreationError.unknown)
             }).addDisposableTo(disposeBag)
     }
 }
 
-//MARK: Account Creation state
+// MARK: Account Creation state
 
 enum AccountCreationState {
     case started
diff --git a/Ring/Ring/AppDelegate.swift b/Ring/Ring/AppDelegate.swift
index 783b1b8..7c1705e 100644
--- a/Ring/Ring/AppDelegate.swift
+++ b/Ring/Ring/AppDelegate.swift
@@ -38,21 +38,15 @@
     }
 
     func applicationWillResignActive(_ application: UIApplication) {
-        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
-        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
     }
 
     func applicationDidEnterBackground(_ application: UIApplication) {
-        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
-        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
     }
 
     func applicationWillEnterForeground(_ application: UIApplication) {
-        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
     }
 
     func applicationDidBecomeActive(_ application: UIApplication) {
-        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
     }
 
     func applicationWillTerminate(_ application: UIApplication) {
@@ -65,11 +59,11 @@
         do {
             try AppDelegate.daemonService.startDaemon()
             AppDelegate.accountService.loadAccounts()
-        } catch StartDaemonError.InitializationFailure {
+        } catch StartDaemonError.initializationFailure {
             print("Daemon failed to initialize.")
-        } catch StartDaemonError.StartFailure {
+        } catch StartDaemonError.startFailure {
             print("Daemon failed to start.")
-        } catch StartDaemonError.DaemonAlreadyRunning {
+        } catch StartDaemonError.daemonAlreadyRunning {
             print("Daemon already running.")
         } catch {
             print("Unknown error in Daemon start.")
@@ -79,11 +73,10 @@
     fileprivate func stopDaemon() {
         do {
             try AppDelegate.daemonService.stopDaemon()
-        } catch StopDaemonError.DaemonNotRunning {
+        } catch StopDaemonError.daemonNotRunning {
             print("Daemon failed to stop because it was not already running.")
         } catch {
             print("Unknown error in Daemon stop.")
         }
     }
 }
-
diff --git a/Ring/Ring/Contacts/ContactModel.swift b/Ring/Ring/Contacts/ContactModel.swift
index d18eb95..1437d62 100644
--- a/Ring/Ring/Contacts/ContactModel.swift
+++ b/Ring/Ring/Contacts/ContactModel.swift
@@ -20,7 +20,7 @@
 
 import RealmSwift
 
-class ContactModel :Object {
+class ContactModel: Object {
 
     dynamic var ringId: String = ""
     dynamic var userName: String?
@@ -30,7 +30,7 @@
         self.ringId = ringId
     }
 
-    public static func ==(lhs: ContactModel, rhs: ContactModel) -> Bool {
+    public static func == (lhs: ContactModel, rhs: ContactModel) -> Bool {
         return lhs.ringId == rhs.ringId
     }
 }
diff --git a/Ring/Ring/Contacts/ContactViewModel.swift b/Ring/Ring/Contacts/ContactViewModel.swift
index 1797f65..9cb498f 100644
--- a/Ring/Ring/Contacts/ContactViewModel.swift
+++ b/Ring/Ring/Contacts/ContactViewModel.swift
@@ -26,7 +26,13 @@
     private let nameService = AppDelegate.nameService
     private let disposeBag = DisposeBag()
     private let contact: ContactModel
-    private let realm = try! Realm()
+    private lazy var realm: Realm = {
+        guard let realm = try? Realm() else {
+            fatalError("Enable to instantiate Realm")
+        }
+
+        return realm
+    }()
 
     let userName = Variable("")
 
@@ -49,8 +55,12 @@
             }).subscribe(onNext: { [unowned self] lookupNameResponse in
                 if lookupNameResponse.state == .found {
 
-                    try! self.realm.write {
-                        self.contact.userName = lookupNameResponse.name
+                    do {
+                        try self.realm.write { [unowned self] in
+                            self.contact.userName = lookupNameResponse.name
+                        }
+                    } catch let error {
+                        print ("Realm persistence with error: \(error)")
                     }
 
                     self.userName.value = lookupNameResponse.name
diff --git a/Ring/Ring/Conversations/ConversationModel.swift b/Ring/Ring/Conversations/ConversationModel.swift
index e5a718c..ea83ee6 100644
--- a/Ring/Ring/Conversations/ConversationModel.swift
+++ b/Ring/Ring/Conversations/ConversationModel.swift
@@ -20,10 +20,10 @@
 
 import RealmSwift
 
-class ConversationModel :Object {
+class ConversationModel: Object {
 
     let messages = List<MessageModel>()
-    dynamic var recipient :ContactModel?
+    dynamic var recipient: ContactModel?
     dynamic var accountId: String = ""
 
     convenience init(withRecipient recipient: ContactModel, accountId: String) {
diff --git a/Ring/Ring/Conversations/ConversationViewController.swift b/Ring/Ring/Conversations/ConversationViewController.swift
index 2c5240c..221444e 100644
--- a/Ring/Ring/Conversations/ConversationViewController.swift
+++ b/Ring/Ring/Conversations/ConversationViewController.swift
@@ -27,7 +27,7 @@
 
     var viewModel: ConversationViewModel?
     var textFieldShouldEndEditing = false
-    var bottomOffset :CGFloat = 0
+    var bottomOffset: CGFloat = 0
 
     @IBOutlet weak var tableView: UITableView!
     @IBOutlet weak var spinnerView: UIView!
@@ -52,7 +52,8 @@
     func keyboardWillShow(withNotification notification: Notification) {
 
         let userInfo: Dictionary = notification.userInfo!
-        let keyboardFrame: NSValue = userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue
+        guard let keyboardFrame: NSValue = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
+
         let keyboardRectangle = keyboardFrame.cgRectValue
         let keyboardHeight = keyboardRectangle.height
 
@@ -102,13 +103,13 @@
         //Bind the TableView to the ViewModel
         self.viewModel?.messages
             .bind(to: tableView.rx.items(cellIdentifier: "MessageCellId",
-                                         cellType: MessageCell.self)) { index, messageViewModel, cell in
+                                         cellType: MessageCell.self)) { _, messageViewModel, cell in
                 cell.messageLabel.text = messageViewModel.content
                 cell.bubblePosition = messageViewModel.bubblePosition()
         }.addDisposableTo(disposeBag)
 
         //Scroll to bottom when reloaded
-        self.tableView.rx.methodInvoked(#selector(UITableView.reloadData)).subscribe(onNext: { element in
+        self.tableView.rx.methodInvoked(#selector(UITableView.reloadData)).subscribe(onNext: { _ in
             self.scrollToBottomIfNeed()
             self.updateBottomOffset()
         }).addDisposableTo(disposeBag)
@@ -158,7 +159,7 @@
     func setupBindings() {
 
         //Binds the keyboard Send button action to the ViewModel
-        self.messageAccessoryView.messageTextField.rx.controlEvent(.editingDidEndOnExit).subscribe(onNext: { event in
+        self.messageAccessoryView.messageTextField.rx.controlEvent(.editingDidEndOnExit).subscribe(onNext: { _ in
             self.viewModel?.sendMessage(withContent: self.messageAccessoryView.messageTextField.text!)
             self.messageAccessoryView.messageTextField.text = ""
         }).addDisposableTo(disposeBag)
diff --git a/Ring/Ring/Conversations/ConversationViewModel.swift b/Ring/Ring/Conversations/ConversationViewModel.swift
index 696773d..d11cc97 100644
--- a/Ring/Ring/Conversations/ConversationViewModel.swift
+++ b/Ring/Ring/Conversations/ConversationViewModel.swift
@@ -25,7 +25,13 @@
 class ConversationViewModel {
 
     let conversation: ConversationModel
-    let realm = try! Realm()
+    private lazy var realm: Realm = {
+        guard let realm = try? Realm() else {
+            fatalError("Enable to instantiate Realm")
+        }
+
+        return realm
+    }()
 
     //Displays the entire date ( for messages received before the current week )
     private let dateFormatter = DateFormatter()
@@ -35,7 +41,7 @@
 
     private let disposeBag = DisposeBag()
 
-    let messages :Observable<[MessageViewModel]>
+    let messages: Observable<[MessageViewModel]>
 
     //Services
     private let conversationsService = AppDelegate.conversationsService
@@ -63,14 +69,20 @@
         if let userName = self.conversation.recipient?.userName {
             return Variable(userName)
         } else {
-            let tmp :Variable<String> = ContactHelper.lookupUserName(forRingId: self.conversation.recipient!.ringId,
+            let tmp: Variable<String> = ContactHelper.lookupUserName(forRingId: self.conversation.recipient!.ringId,
                                                 nameService: AppDelegate.nameService,
                                                 disposeBag: self.disposeBag)
 
-            tmp.asObservable().subscribe(onNext: { userNameFound in
-                try! self.realm.write {
-                    self.conversation.recipient?.userName = userNameFound
+            tmp.asObservable().subscribe(onNext: { [unowned self] userNameFound in
+
+                do {
+                    try self.realm.write {
+                        self.conversation.recipient?.userName = userNameFound
+                    }
+                } catch let error {
+                    print ("Realm persistence with error: \(error)")
                 }
+
             }).addDisposableTo(self.disposeBag)
 
             return tmp
@@ -129,7 +141,7 @@
     }
 
     var hideDate: Bool {
-        return self.conversation.messages.count == 0
+        return self.conversation.messages.isEmpty
     }
 
     func sendMessage(withContent content: String) {
diff --git a/Ring/Ring/MainTabBar/MainTabBarViewController.swift b/Ring/Ring/MainTabBar/MainTabBarViewController.swift
index 72cdb8b..20f2eae 100644
--- a/Ring/Ring/MainTabBar/MainTabBarViewController.swift
+++ b/Ring/Ring/MainTabBar/MainTabBarViewController.swift
@@ -26,7 +26,7 @@
     override func viewDidLoad() {
         super.viewDidLoad()
         UITabBarItem.appearance()
-            .setTitleTextAttributes( [NSForegroundColorAttributeName : Colors.ringMainColor], for: .selected)
+            .setTitleTextAttributes( [NSForegroundColorAttributeName: Colors.ringMainColor], for: .selected)
     }
 
     override func viewDidAppear(_ animated: Bool) {
diff --git a/Ring/Ring/Messages/MessageAccessoryView.swift b/Ring/Ring/Messages/MessageAccessoryView.swift
index 3e285bc..1d01570 100644
--- a/Ring/Ring/Messages/MessageAccessoryView.swift
+++ b/Ring/Ring/Messages/MessageAccessoryView.swift
@@ -25,8 +25,10 @@
     @IBOutlet weak var messageTextField: UITextField!
 
     class func instanceFromNib() -> MessageAccessoryView {
-        return UINib(nibName: "MessageAccessoryView", bundle: nil)
-            .instantiate(withOwner: nil, options: nil).first as! MessageAccessoryView
+        guard let view = UINib(nibName: "MessageAccessoryView", bundle: nil).instantiate(withOwner: nil, options: nil).first as? MessageAccessoryView  else {
+            fatalError("The view you are trying to instantiate is not a MessageAccessoryView")
+        }
+        return view
     }
 
 }
diff --git a/Ring/Ring/Messages/MessageViewModel.swift b/Ring/Ring/Messages/MessageViewModel.swift
index ea74b87..254af6c 100644
--- a/Ring/Ring/Messages/MessageViewModel.swift
+++ b/Ring/Ring/Messages/MessageViewModel.swift
@@ -23,7 +23,7 @@
 class MessageViewModel {
 
     fileprivate let accountService = AppDelegate.accountService
-    fileprivate var message :MessageModel
+    fileprivate var message: MessageModel
 
     init(withMessage message: MessageModel) {
         self.message = message
diff --git a/Ring/Ring/Services/AccountsService.swift b/Ring/Ring/Services/AccountsService.swift
index 9c6014c..0345c04 100644
--- a/Ring/Ring/Services/AccountsService.swift
+++ b/Ring/Ring/Services/AccountsService.swift
@@ -24,8 +24,8 @@
 import RealmSwift
 
 enum AddAccountError: Error {
-    case TemplateNotConform
-    case UnknownError
+    case templateNotConform
+    case unknownError
 }
 
 class AccountsService: AccountAdapterDelegate {
@@ -41,7 +41,7 @@
 
      - SeeAlso: `accounts`
      */
-    fileprivate var accountList: Array<AccountModel>
+    fileprivate var accountList: [AccountModel]
 
     fileprivate let disposeBag = DisposeBag()
 
@@ -60,7 +60,7 @@
      Accounts list public interface.
      Can be used to access by constant the list of accounts.
      */
-    fileprivate(set) var accounts: Array<AccountModel> {
+    fileprivate(set) var accounts: [AccountModel] {
         set {
             accountList = newValue
         }
@@ -126,8 +126,9 @@
 
     func loadAccounts() {
         for accountId in accountAdapter.getAccountList() {
-            let account = AccountModel(withAccountId: accountId as! String)
-            self.accountList.append(account)
+            if  let id = accountId as? String {
+                self.accountList.append(AccountModel(withAccountId: id))
+            }
         }
 
         reloadAccounts()
@@ -135,7 +136,7 @@
 
     // MARK: - Methods
     func hasAccounts() -> Bool {
-        return accountList.count > 0
+        return !accountList.isEmpty
     }
 
     fileprivate func reloadAccounts() {
@@ -165,12 +166,12 @@
         do {
             var ringDetails = try self.getRingInitialAccountDetails()
             if username != nil {
-                ringDetails.updateValue(username!, forKey: ConfigKey.AccountRegisteredName.rawValue)
+                ringDetails.updateValue(username!, forKey: ConfigKey.accountRegisteredName.rawValue)
             }
-            ringDetails.updateValue(password, forKey: ConfigKey.ArchivePassword.rawValue)
+            ringDetails.updateValue(password, forKey: ConfigKey.archivePassword.rawValue)
             let accountId = self.accountAdapter.addAccount(ringDetails)
             guard accountId != nil else {
-                throw AddAccountError.UnknownError
+                throw AddAccountError.unknownError
             }
 
             var account = self.getAccount(fromAccountId: accountId!)
@@ -189,15 +190,14 @@
                 //TODO: set registration state as ready for a SIP account
 
                 let accountModelHelper = AccountModelHelper(withAccount: account!)
-                var accountAddedEvent = ServiceEvent(withEventType: .AccountAdded)
-                accountAddedEvent.addEventInput(.Id, value: account?.id)
-                accountAddedEvent.addEventInput(.State, value: accountModelHelper.getRegistrationState())
+                var accountAddedEvent = ServiceEvent(withEventType: .accountAdded)
+                accountAddedEvent.addEventInput(.id, value: account?.id)
+                accountAddedEvent.addEventInput(.state, value: accountModelHelper.getRegistrationState())
                 self.responseStream.onNext(accountAddedEvent)
             }
 
             self.currentAccount = account
-        }
-        catch {
+        } catch {
             self.responseStream.onError(error)
         }
     }
@@ -236,7 +236,7 @@
      */
     func getAccountDetails(fromAccountId id: String) -> AccountConfigModel {
         let details: NSDictionary = accountAdapter.getAccountDetails(id) as NSDictionary
-        let accountDetailsDict = details as NSDictionary? as? Dictionary<String, String> ?? nil
+        let accountDetailsDict = details as NSDictionary? as? [String: String] ?? nil
         let accountDetails = AccountConfigModel(withDetails: accountDetailsDict)
         return accountDetails
     }
@@ -250,7 +250,7 @@
      */
     func getVolatileAccountDetails(fromAccountId id: String) -> AccountConfigModel {
         let details: NSDictionary = accountAdapter.getVolatileAccountDetails(id) as NSDictionary
-        let accountDetailsDict = details as NSDictionary? as? Dictionary<String, String> ?? nil
+        let accountDetailsDict = details as NSDictionary? as? [String: String] ?? nil
         let accountDetails = AccountConfigModel(withDetails: accountDetailsDict)
         return accountDetails
     }
@@ -264,7 +264,7 @@
      */
     func getAccountCredentials(fromAccountId id: String) throws -> List<AccountCredentialsModel> {
         let creds: NSArray = accountAdapter.getCredentials(id) as NSArray
-        let rawCredentials = creds as NSArray? as? Array<Dictionary<String, String>> ?? nil
+        let rawCredentials = creds as NSArray? as? [[String: String]] ?? nil
 
         if let rawCredentials = rawCredentials {
             let credentialsList = List<AccountCredentialsModel>()
@@ -272,17 +272,17 @@
                 do {
                     let credentials = try AccountCredentialsModel(withRawaData: rawCredentials)
                     credentialsList.append(credentials)
-                } catch CredentialsError.NotEnoughData {
+                } catch CredentialsError.notEnoughData {
                     print("Not enough data to build a credential object.")
-                    throw CredentialsError.NotEnoughData
+                    throw CredentialsError.notEnoughData
                 } catch {
                     print("Unexpected error.")
-                    throw AccountModelError.UnexpectedError
+                    throw AccountModelError.unexpectedError
                 }
             }
             return credentialsList
         } else {
-            throw AccountModelError.UnexpectedError
+            throw AccountModelError.unexpectedError
         }
     }
 
@@ -297,8 +297,11 @@
         let knownRingDevices = accountAdapter.getKnownRingDevices(id)! as NSDictionary
 
         var devices = [DeviceModel]()
+
         for key in knownRingDevices.allKeys {
-            devices.append(DeviceModel(withDeviceId: key as! String))
+            if let key = key as? String {
+                devices.append(DeviceModel(withDeviceId: key))
+            }
         }
 
         return devices
@@ -309,14 +312,14 @@
 
      - Returns the details.
      */
-    fileprivate func getInitialAccountDetails() throws -> Dictionary<String, String> {
-        let details: NSMutableDictionary = accountAdapter.getAccountTemplate(AccountType.Ring.rawValue)
-        var accountDetails = details as NSDictionary? as? Dictionary<String, String> ?? nil
+    fileprivate func getInitialAccountDetails() throws -> [String: String] {
+        let details: NSMutableDictionary = accountAdapter.getAccountTemplate(AccountType.ring.rawValue)
+        var accountDetails = details as NSDictionary? as? [String: String] ?? nil
         if accountDetails == nil {
-            throw AddAccountError.TemplateNotConform
+            throw AddAccountError.templateNotConform
         }
-        accountDetails!.updateValue("false", forKey: ConfigKey.VideoEnabled.rawValue)
-        accountDetails!.updateValue("sipinfo", forKey: ConfigKey.AccountDTMFType.rawValue)
+        accountDetails!.updateValue("false", forKey: ConfigKey.videoEnabled.rawValue)
+        accountDetails!.updateValue("sipinfo", forKey: ConfigKey.accountDTMFType.rawValue)
         return accountDetails!
     }
 
@@ -325,12 +328,12 @@
 
      - Returns the details.
      */
-    fileprivate func getRingInitialAccountDetails() throws -> Dictionary<String, String> {
+    fileprivate func getRingInitialAccountDetails() throws -> [String: String] {
         do {
             var defaultDetails = try getInitialAccountDetails()
-            defaultDetails.updateValue("Ring", forKey: ConfigKey.AccountAlias.rawValue)
-            defaultDetails.updateValue("bootstrap.ring.cx", forKey: ConfigKey.AccountHostname.rawValue)
-            defaultDetails.updateValue("true", forKey: ConfigKey.AccountUpnpEnabled.rawValue)
+            defaultDetails.updateValue("Ring", forKey: ConfigKey.accountAlias.rawValue)
+            defaultDetails.updateValue("bootstrap.ring.cx", forKey: ConfigKey.accountHostname.rawValue)
+            defaultDetails.updateValue("true", forKey: ConfigKey.accountUpnpEnabled.rawValue)
             return defaultDetails
         } catch {
             throw error
@@ -348,7 +351,7 @@
         print("Accounts changed.")
         reloadAccounts()
 
-        let event = ServiceEvent(withEventType: .AccountsChanged)
+        let event = ServiceEvent(withEventType: .accountsChanged)
         self.responseStream.onNext(event)
     }
 
@@ -356,8 +359,8 @@
         print("RegistrationStateChanged.")
         reloadAccounts()
 
-        var event = ServiceEvent(withEventType: .RegistrationStateChanged)
-        event.addEventInput(.RegistrationState, value: response.state)
+        var event = ServiceEvent(withEventType: .registrationStateChanged)
+        event.addEventInput(.registrationState, value: response.state)
         self.responseStream.onNext(event)
     }
 
diff --git a/Ring/Ring/Services/ConversationsService.swift b/Ring/Ring/Services/ConversationsService.swift
index 1d432a1..28a9df6 100644
--- a/Ring/Ring/Services/ConversationsService.swift
+++ b/Ring/Ring/Services/ConversationsService.swift
@@ -24,18 +24,25 @@
 
 class ConversationsService: MessagesAdapterDelegate {
 
-    fileprivate let messageAdapter :MessagesAdapter
+    fileprivate let messageAdapter: MessagesAdapter
     fileprivate let disposeBag = DisposeBag()
     fileprivate let textPlainMIMEType = "text/plain"
-    fileprivate let realm :Realm = try! Realm()
-    fileprivate let results :Results<ConversationModel>!
 
-    var conversations :Observable<Results<ConversationModel>>
+    private var realm: Realm!
 
-    init(withMessageAdapter messageAdapter: MessagesAdapter) {
-        self.messageAdapter = messageAdapter
-        self.results = realm.objects(ConversationModel.self)
-        self.conversations = Observable.collection(from: results)
+    fileprivate let results: Results<ConversationModel>
+
+    var conversations: Observable<Results<ConversationModel>>
+
+    init(withMessageAdapter adapter: MessagesAdapter) {
+        guard let realm = try? Realm() else {
+            fatalError("Enable to instantiate Realm")
+        }
+
+        messageAdapter = adapter
+        self.realm = realm
+        results = realm.objects(ConversationModel.self)
+        conversations = Observable.collection(from: results)
         MessagesAdapter.delegate = self
     }
 
@@ -44,7 +51,7 @@
                      to recipient: ContactModel) -> Completable {
 
         return Completable.create(subscribe: { [unowned self] completable in
-            let contentDict = [self.textPlainMIMEType : content]
+            let contentDict = [self.textPlainMIMEType: content]
             self.messageAdapter.sendMessage(withContent: contentDict, withAccountId: senderAccount.id, to: recipient.ringId)
 
             let accountHelper = AccountModelHelper(withAccount: senderAccount)
@@ -61,10 +68,15 @@
 
     func addConversation(conversation: ConversationModel) -> Completable {
         return Completable.create(subscribe: { [unowned self] completable in
-            try! self.realm.write {
-                self.realm.add(conversation)
+            do {
+                try self.realm.write { [unowned self] in
+                    self.realm.add(conversation)
+                }
+                completable(.completed)
+            } catch let error {
+                completable(.error(error))
             }
-            completable(.completed)
+
             return Disposables.create { }
         })
     }
@@ -86,18 +98,25 @@
             if currentConversation == nil {
                 currentConversation = ConversationModel(withRecipient: ContactModel(withRingId: recipientRingId), accountId: currentAccountId)
 
-                try! self.realm.write {
-                    self.realm.add(currentConversation!)
+                do {
+                    try self.realm.write { [unowned self] in
+                        self.realm.add(currentConversation!)
+                    }
+                } catch let error {
+                    completable(.error(error))
                 }
             }
 
             //Add the received message into the conversation
-            try! self.realm.write {
-                currentConversation?.messages.append(message)
+            do {
+                try self.realm.write {
+                    currentConversation?.messages.append(message)
+                }
+                completable(.completed)
+            } catch let error {
+                completable(.error(error))
             }
 
-            completable(.completed)
-
             return Disposables.create { }
 
         })
@@ -116,13 +135,17 @@
                 return messages.status != .read
             })
 
-            try! self.realm.write {
-                for message in unreadMessages {
-                    message.status = .read
+            do {
+                try self.realm.write {
+                    for message in unreadMessages {
+                        message.status = .read
+                    }
                 }
-            }
+                completable(.completed)
 
-            completable(.completed)
+            } catch let error {
+                completable(.error(error))
+            }
 
             return Disposables.create { }
 
@@ -143,7 +166,7 @@
 
     //MARK: Message Adapter delegate
 
-    func didReceiveMessage(_ message: Dictionary<String, String>, from senderAccount: String,
+    func didReceiveMessage(_ message: [String: String], from senderAccount: String,
                            to receiverAccountId: String) {
 
         if let content = message[textPlainMIMEType] {
diff --git a/Ring/Ring/Services/DaemonService.swift b/Ring/Ring/Services/DaemonService.swift
index 656f7fc..ff91fe4 100644
--- a/Ring/Ring/Services/DaemonService.swift
+++ b/Ring/Ring/Services/DaemonService.swift
@@ -28,9 +28,9 @@
  - StartFailure: the daemon failed to start.
  */
 enum StartDaemonError: Error {
-    case DaemonAlreadyRunning
-    case InitializationFailure
-    case StartFailure
+    case daemonAlreadyRunning
+    case initializationFailure
+    case startFailure
 }
 
 /**
@@ -39,7 +39,7 @@
  - DaemonNotRunning: the daemon is not running and can not be stopped.
  */
 enum StopDaemonError: Error {
-    case DaemonNotRunning
+    case daemonNotRunning
 }
 
 /**
@@ -78,7 +78,7 @@
      */
     func startDaemon() throws {
         guard !self.daemonStarted else {
-            throw StartDaemonError.DaemonAlreadyRunning
+            throw StartDaemonError.daemonAlreadyRunning
         }
 
         print("Starting daemon...")
@@ -88,13 +88,11 @@
                 self.startRingServicePolling()
                 self.daemonStarted = true
                 print("Daemon started.")
+            } else {
+                throw StartDaemonError.startFailure
             }
-            else {
-                throw StartDaemonError.StartFailure
-            }
-        }
-        else {
-            throw StartDaemonError.InitializationFailure
+        } else {
+            throw StartDaemonError.initializationFailure
         }
     }
 
@@ -105,7 +103,7 @@
      */
     func stopDaemon() throws {
         guard self.daemonStarted else {
-            throw StopDaemonError.DaemonNotRunning
+            throw StopDaemonError.daemonNotRunning
         }
 
         print("Stopping daemon...")
diff --git a/Ring/Ring/Services/MessagesAdapterDelegate.swift b/Ring/Ring/Services/MessagesAdapterDelegate.swift
index dc50514..22ba215 100644
--- a/Ring/Ring/Services/MessagesAdapterDelegate.swift
+++ b/Ring/Ring/Services/MessagesAdapterDelegate.swift
@@ -20,7 +20,7 @@
 
 @objc protocol MessagesAdapterDelegate {
 
-    func didReceiveMessage(_ message: Dictionary<String, String>, from senderAccount: String,
+    func didReceiveMessage(_ message: [String: String], from senderAccount: String,
                            to receiverAccountId: String)
 
     func messageStatusChanged(_ status: MessageStatus, for messageId: UInt64, from senderAccountId: String,
diff --git a/Ring/Ring/Services/NameService.swift b/Ring/Ring/Services/NameService.swift
index c15dceb..0c83657 100644
--- a/Ring/Ring/Services/NameService.swift
+++ b/Ring/Ring/Services/NameService.swift
@@ -37,7 +37,7 @@
     /**
      Used to make lookup name request to the daemon
     */
-    fileprivate let nameRegistrationAdapter :NameRegistrationAdapter
+    fileprivate let nameRegistrationAdapter: NameRegistrationAdapter
 
     fileprivate var delayedLookupNameCall: DispatchWorkItem?
 
@@ -94,7 +94,7 @@
         self.nameRegistrationAdapter.registerName(withAccount: account, password: password, name: name)
     }
 
-    //MARK: NameService delegate
+    // MARK: NameService delegate
 
     internal func registeredNameFound(with response: LookupNameResponse) {
 
diff --git a/Ring/Ring/Services/ServiceEvent.swift b/Ring/Ring/Services/ServiceEvent.swift
index 93f39b6..0e40e86 100644
--- a/Ring/Ring/Services/ServiceEvent.swift
+++ b/Ring/Ring/Services/ServiceEvent.swift
@@ -25,18 +25,18 @@
  - AccountAdded: an account has been added
  */
 enum ServiceEventType {
-    case AccountAdded
-    case AccountsChanged
-    case RegistrationStateChanged
+    case accountAdded
+    case accountsChanged
+    case registrationStateChanged
 }
 
 /**
  Keys that can be set as keys of the private input dictionary
  */
 enum ServiceEventInput {
-    case Id
-    case State
-    case RegistrationState
+    case id
+    case state
+    case registrationState
 }
 
 /**
@@ -56,7 +56,7 @@
     /**
      Contains all the metadata of the event.
      */
-    fileprivate var inputs = Dictionary<ServiceEventInput, Any>()
+    fileprivate var inputs = [ServiceEventInput: Any]()
 
     /**
      Initializer
diff --git a/Ring/Ring/Settings/MeViewController.swift b/Ring/Ring/Settings/MeViewController.swift
index 7e580c0..995e0c0 100644
--- a/Ring/Ring/Settings/MeViewController.swift
+++ b/Ring/Ring/Settings/MeViewController.swift
@@ -32,7 +32,7 @@
     override func viewDidLoad() {
         super.viewDidLoad()
 
-        if accountService.accounts.count > 0 {
+        if !accountService.accounts.isEmpty {
 //            let acc = accountService.accounts[0]
 //            nameLabel.text = acc.displayName
 //            if let username = acc.username {
@@ -64,7 +64,7 @@
 
     // MARK: - TableView
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 1;
+        return 1
     }
 
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -74,15 +74,17 @@
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 
         if indexPath.row < accountService.accounts.count {
-            let cell = tableView.dequeueReusableCell(withIdentifier: "accountTableCell", for: indexPath) as! AccountTableViewCell
-            let account = accountService.accounts[indexPath.row]
+            if let cell = tableView.dequeueReusableCell(withIdentifier: "accountTableCell", for: indexPath) as? AccountTableViewCell {
+                let account = accountService.accounts[indexPath.row]
 
-            cell.account = account
-//            cell.accountNameLabel.text = account.alias
-//            cell.activeSwitch.setOn(account.isEnabled, animated: false)
-//            cell.accountTypeLabel.text = account.accountType.rawValue
-
-            return cell
+                cell.account = account
+                //            cell.accountNameLabel.text = account.alias
+                //            cell.activeSwitch.setOn(account.isEnabled, animated: false)
+                //            cell.accountTypeLabel.text = account.accountType.rawValue
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: "accountTableCell", for: indexPath)
+            }
         } else {
             let cell = tableView.dequeueReusableCell(withIdentifier: "addAccountTableCell", for: indexPath)
             return cell
@@ -104,7 +106,7 @@
     }
 
     func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
-        if (editingStyle == UITableViewCellEditingStyle.delete) {
+        if editingStyle == UITableViewCellEditingStyle.delete {
             accountService.removeAccount(indexPath.row)
             accountTableView.reloadData()
         }
@@ -119,9 +121,9 @@
 
     // MARK: - Navigation
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        if segue.identifier == "accountDetails" {
-            let cell = sender as! AccountTableViewCell
-            let vc = segue.destination as! AccountDetailsViewController
+        if  segue.identifier == "accountDetails",
+            let cell = sender as? AccountTableViewCell,
+            let vc = segue.destination as? AccountDetailsViewController {
             vc.account = cell.account
         }
     }
diff --git a/Ring/Ring/Smartlist/SmartlistViewController.swift b/Ring/Ring/Smartlist/SmartlistViewController.swift
index 6b33ff0..a0e2b8a 100644
--- a/Ring/Ring/Smartlist/SmartlistViewController.swift
+++ b/Ring/Ring/Smartlist/SmartlistViewController.swift
@@ -28,10 +28,10 @@
 fileprivate let conversationCellNibName = "ConversationCell"
 fileprivate let showMessages = "ShowMessages"
 
-fileprivate let smartlistRowHeight :CGFloat = 64.0
-fileprivate let tableHeaderViewHeight :CGFloat = 24.0
-fileprivate let firstSectionHeightForHeader :CGFloat = 31.0 //Compensate the offset due to the label on the top of the tableView
-fileprivate let defaultSectionHeightForHeader :CGFloat = 55.0
+fileprivate let smartlistRowHeight: CGFloat = 64.0
+fileprivate let tableHeaderViewHeight: CGFloat = 24.0
+fileprivate let firstSectionHeightForHeader: CGFloat = 31.0 //Compensate the offset due to the label on the top of the tableView
+fileprivate let defaultSectionHeightForHeader: CGFloat = 55.0
 
 class SmartlistViewController: UIViewController {
 
@@ -49,7 +49,6 @@
 
     fileprivate let disposeBag = DisposeBag()
 
-
     //ConverationViewModel to be passed to the Messages screen
     fileprivate var selectedItem: ConversationViewModel?
 
@@ -94,7 +93,7 @@
 
     func keyboardWillShow(withNotification notification: Notification) {
         let userInfo: Dictionary = notification.userInfo!
-        let keyboardFrame: NSValue = userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue
+        guard let keyboardFrame: NSValue = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
         let keyboardRectangle = keyboardFrame.cgRectValue
         let keyboardHeight = keyboardRectangle.height
         let tabBarHeight = (self.tabBarController?.tabBar.frame.size.height)!
@@ -122,14 +121,20 @@
         //Configure cells closure for the datasources
         let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, ConversationSection.Item)
             -> UITableViewCell = {
-            (ds: TableViewSectionedDataSource<ConversationSection>, tv: UITableView, ip: IndexPath, item: ConversationSection.Item) in
-            let cell = tv.dequeueReusableCell(withIdentifier:conversationCellIdentifier, for: ip) as! ConversationCell
-            item.userName.asObservable().bind(to: cell.nameLabel.rx.text).addDisposableTo(self.disposeBag)
-            cell.newMessagesLabel.text = item.unreadMessages
-            cell.lastMessageDateLabel.text = item.lastMessageReceivedDate
-            cell.newMessagesIndicator.isHidden = item.hideNewMessagesLabel
-            cell.lastMessagePreviewLabel.text = item.lastMessage
-            return cell
+                (   dataSource: TableViewSectionedDataSource<ConversationSection>,
+                tableView: UITableView,
+                indexPath: IndexPath,
+                item: ConversationSection.Item) in
+                if let cell = tableView.dequeueReusableCell(withIdentifier: conversationCellIdentifier, for: indexPath) as? ConversationCell {
+                    item.userName.asObservable().bind(to: cell.nameLabel.rx.text).addDisposableTo(self.disposeBag)
+                    cell.newMessagesLabel.text = item.unreadMessages
+                    cell.lastMessageDateLabel.text = item.lastMessageReceivedDate
+                    cell.newMessagesIndicator.isHidden = item.hideNewMessagesLabel
+                    cell.lastMessagePreviewLabel.text = item.lastMessage
+                    return cell
+                } else {
+                    return tableView.dequeueReusableCell(withIdentifier: conversationCellIdentifier, for: indexPath)
+                }
         }
 
         //Allows to delete
@@ -150,8 +155,8 @@
             .addDisposableTo(disposeBag)
 
         //Set header titles
-        searchResultsDatasource.titleForHeaderInSection = { ds, index in
-            return ds.sectionModels[index].header
+        searchResultsDatasource.titleForHeaderInSection = { dataSource, index in
+            return dataSource.sectionModels[index].header
         }
     }
 
diff --git a/Ring/Ring/Smartlist/SmartlistViewModel.swift b/Ring/Ring/Smartlist/SmartlistViewModel.swift
index 292c4ba..24fead9 100644
--- a/Ring/Ring/Smartlist/SmartlistViewModel.swift
+++ b/Ring/Ring/Smartlist/SmartlistViewModel.swift
@@ -30,9 +30,9 @@
     fileprivate let accountsService: AccountsService
 
     let searchBarText = Variable<String>("")
-    var isSearching :Observable<Bool>!
-    var conversations :Observable<[ConversationSection]>!
-    var searchResults :Observable<[ConversationSection]>!
+    var isSearching: Observable<Bool>!
+    var conversations: Observable<[ConversationSection]>!
+    var searchResults: Observable<[ConversationSection]>!
     var hideNoConversationsMessage: Observable<Bool>!
     var searchStatus = PublishSubject<String>()
 
@@ -47,7 +47,7 @@
         self.accountsService = accountsService
 
         //Create observable from sorted conversations and flatMap them to view models
-        let conversationsObservable :Observable<[ConversationViewModel]> = self.conversationsService.conversations.asObservable().map({ conversations in
+        let conversationsObservable: Observable<[ConversationViewModel]> = self.conversationsService.conversations.asObservable().map({ conversations in
             return conversations.sorted(by: { conversation1, conversations2 in
 
                 guard let lastMessage1 = conversation1.messages.last,
@@ -80,7 +80,9 @@
         }).observeOn(MainScheduler.instance)
 
         //Create observable from filtered conversatiosn and contact founds viewModels to ConversationSection
-        self.searchResults = Observable<[ConversationSection]>.combineLatest(self.contactFoundConversation.asObservable(), self.filteredResults.asObservable(), resultSelector: { contactFoundConversation, filteredResults in
+        self.searchResults = Observable<[ConversationSection]>.combineLatest(self.contactFoundConversation.asObservable(),
+                                                                             self.filteredResults.asObservable(),
+                                                                             resultSelector: { contactFoundConversation, filteredResults in
 
             var sections = [ConversationSection]()
 
@@ -89,7 +91,7 @@
                 sections.append(ConversationSection(header: headerTitle, items: [contactFoundConversation!]))
             }
 
-            if filteredResults.count > 0 {
+            if !filteredResults.isEmpty {
                 let headerTitle = NSLocalizedString("Conversations", tableName: "Smartlist", comment: "")
                 sections.append(ConversationSection(header: headerTitle, items: filteredResults))
             }
@@ -99,12 +101,12 @@
 
         self.hideNoConversationsMessage = Observable
             .combineLatest( self.conversations, self.searchBarText.asObservable(), resultSelector: { conversations, searchBarText in
-            return conversations.first!.items.count > 0 || searchBarText.characters.count > 0
+            return !conversations.first!.items.isEmpty || !searchBarText.characters.isEmpty
         }).observeOn(MainScheduler.instance)
 
         //Observes if the user is searching
         self.isSearching = searchBarText.asObservable().map({ text in
-            return text.characters.count > 0
+            return !text.characters.isEmpty
         }).observeOn(MainScheduler.instance)
 
         //Observes search bar text
@@ -133,7 +135,7 @@
 
                 self.searchStatus.onNext("")
             } else {
-                if self.filteredResults.value.count == 0 {
+                if self.filteredResults.value.isEmpty {
                     let searchStatusText = NSLocalizedString("NoResults", tableName: "Smartlist", comment: "")
                     self.searchStatus.onNext(searchStatusText)
                 } else {
@@ -149,7 +151,7 @@
         self.filteredResults.value.removeAll()
         self.searchStatus.onNext("")
 
-        if text.characters.count > 0 {
+        if !text.isEmpty {
 
             //Filter conversations by user name or RingId
             let filteredConversations = self.conversationViewModels.filter({ conversationViewModel in
@@ -160,7 +162,7 @@
                 }
             })
 
-            if filteredConversations.count > 0 {
+            if !filteredConversations.isEmpty {
                 self.filteredResults.value = filteredConversations
             }
 
diff --git a/Ring/Ring/UI/RoundedButton.swift b/Ring/Ring/UI/RoundedButton.swift
index 11a10c9..1f51c4e 100644
--- a/Ring/Ring/UI/RoundedButton.swift
+++ b/Ring/Ring/UI/RoundedButton.swift
@@ -29,7 +29,7 @@
         self.layer.borderWidth = 1.0
         self.clipsToBounds = true
         self.layer.cornerRadius = 15.0
-        self.contentEdgeInsets = UIEdgeInsetsMake(8.0, 8.0, 8.0, 8.0)
+        self.contentEdgeInsets = UIEdgeInsets(top: 8.0, left: 8.0, bottom: 8.0, right: 8.0)
 
         //Text colors
         self.setTitleColor(UIColor.white, for: .normal)
diff --git a/Ring/Ring/Walkthrough/CreateProfileViewController.swift b/Ring/Ring/Walkthrough/CreateProfileViewController.swift
index e5e473a..83e1a2b 100644
--- a/Ring/Ring/Walkthrough/CreateProfileViewController.swift
+++ b/Ring/Ring/Walkthrough/CreateProfileViewController.swift
@@ -27,7 +27,7 @@
 
 class CreateProfileViewController: UIViewController {
 
-    var profileCreationType :ProfileCreationType?
+    var profileCreationType: ProfileCreationType?
 
     @IBAction func skip(_ sender: Any) {
         if profileCreationType == .linkDeviceToAccount {
diff --git a/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift b/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
index 290bc22..00bd418 100644
--- a/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
+++ b/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
@@ -103,7 +103,9 @@
                 }
             },
             onError: { [unowned self] error in
-                self.showErrorAlert(error as! AccountCreationError)
+                if let error = error as? AccountCreationError {
+                    self.showErrorAlert(error)
+                }
                 self.setCreateAccountAsIdle()
         }).addDisposableTo(mDisposeBag)
 
@@ -111,7 +113,7 @@
         self.mAccountViewModel.registerUsername.asObservable()
             .subscribe(onNext: { [weak self] showUsernameField in
                 self?.toggleRegisterSwitch(showUsernameField)
-        }).addDisposableTo(mDisposeBag)
+            }).addDisposableTo(mDisposeBag)
 
         //Enables create account button
         self.mAccountViewModel.canCreateAccount
@@ -128,42 +130,42 @@
         self.tableView.rowHeight = UITableViewAutomaticDimension
 
         self.mCreateAccountTitleLabel.text = NSLocalizedString("CreateAccountFormTitle",
-                                                              tableName: LocalizedStringTableNames.walkthrough,
-                                                              comment: "")
+                                                               tableName: LocalizedStringTableNames.walkthrough,
+                                                               comment: "")
     }
 
     fileprivate func setCreateAccountAsLoading() {
-            print("Creating account...")
-            self.mCreateAccountButton.setTitle("Loading...", for: .normal)
-            self.mCreateAccountButton.isUserInteractionEnabled = false
+        print("Creating account...")
+        self.mCreateAccountButton.setTitle("Loading...", for: .normal)
+        self.mCreateAccountButton.isUserInteractionEnabled = false
 
-            let title = NSLocalizedString("WaitCreateAccountTitle",
-                                          tableName:LocalizedStringTableNames.walkthrough,
-                                          comment: "")
+        let title = NSLocalizedString("WaitCreateAccountTitle",
+                                      tableName:LocalizedStringTableNames.walkthrough,
+                                      comment: "")
 
-            HUD.show(.labeledProgress(title: title,subtitle: nil))
+        HUD.show(.labeledProgress(title: title, subtitle: nil))
     }
 
     fileprivate func setCreateAccountAsIdle() {
-            self.mCreateAccountButton.setTitle("Create a Ring account", for: .normal)
-            self.mCreateAccountButton.isUserInteractionEnabled = true
-            HUD.hide()
+        self.mCreateAccountButton.setTitle("Create a Ring account", for: .normal)
+        self.mCreateAccountButton.isUserInteractionEnabled = true
+        HUD.hide()
     }
 
     fileprivate func showDeviceAddedAlert() {
-            let title = NSLocalizedString("AccountAddedTitle",
-                                          tableName: LocalizedStringTableNames.walkthrough,
-                                          comment: "")
+        let title = NSLocalizedString("AccountAddedTitle",
+                                      tableName: LocalizedStringTableNames.walkthrough,
+                                      comment: "")
 
-            HUD.flash(.labeledSuccess(title: title, subtitle: nil), delay: alertFlashDuration)
+        HUD.flash(.labeledSuccess(title: title, subtitle: nil), delay: alertFlashDuration)
     }
 
     fileprivate func showErrorAlert(_ error: AccountCreationError) {
-            let alert = UIAlertController.init(title: error.title,
-                                               message: error.message,
-                                               preferredStyle: .alert)
-            alert.addAction(UIAlertAction.init(title: "OK", style: .default, handler: nil))
-            self.present(alert, animated: true, completion: nil)
+        let alert = UIAlertController.init(title: error.title,
+                                           message: error.message,
+                                           preferredStyle: .alert)
+        alert.addAction(UIAlertAction.init(title: "OK", style: .default, handler: nil))
+        self.present(alert, animated: true, completion: nil)
     }
 
     /**
@@ -186,11 +188,11 @@
 
     }
 
-    //MARK: TableView datasource
-    fileprivate var mCells :[CreateRingAccountCellType] = [.registerPublicUsername,
-                                                          .passwordNotice,
-                                                          .newPasswordField,
-                                                          .repeatPasswordField]
+    // MARK: TableView datasource
+    fileprivate var mCells: [CreateRingAccountCellType] = [.registerPublicUsername,
+                                                           .passwordNotice,
+                                                           .newPasswordField,
+                                                           .repeatPasswordField]
 
     override func numberOfSections(in tableView: UITableView) -> Int {
         return 1
@@ -205,97 +207,115 @@
         let currentCellType = mCells[indexPath.row]
 
         if currentCellType == .registerPublicUsername {
-            let cell = tableView.dequeueReusableCell(withIdentifier: mSwitchCellId,
-                                                     for: indexPath) as! SwitchCell
-            cell.titleLabel.text = NSLocalizedString("RegisterPublicUsername",
-                                                     tableName: LocalizedStringTableNames.walkthrough,
-                                                     comment: "")
-            cell.titleLabel.textColor = .white
+            if let cell = tableView.dequeueReusableCell(withIdentifier: mSwitchCellId,
+                                                        for: indexPath) as? SwitchCell {
+                cell.titleLabel.text = NSLocalizedString("RegisterPublicUsername",
+                                                         tableName: LocalizedStringTableNames.walkthrough,
+                                                         comment: "")
+                cell.titleLabel.textColor = .white
 
-            _ = cell.registerSwitch.rx.value.bind(to: self.mAccountViewModel.registerUsername)
-                .addDisposableTo(mDisposeBag)
+                _ = cell.registerSwitch.rx.value.bind(to: self.mAccountViewModel.registerUsername)
+                    .addDisposableTo(mDisposeBag)
 
-            return cell
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: mSwitchCellId, for: indexPath)
+            }
+
         } else if currentCellType == .usernameField {
-            let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
-                                                     for: indexPath) as! TextFieldCell
-            cell.textField.isSecureTextEntry = false
-            cell.textField.placeholder = NSLocalizedString("EnterNewUsernamePlaceholder",
-                                                           tableName: LocalizedStringTableNames.walkthrough,
-                                                           comment: "")
+            if let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
+                                                        for: indexPath) as? TextFieldCell {
+                cell.textField.isSecureTextEntry = false
+                cell.textField.placeholder = NSLocalizedString("EnterNewUsernamePlaceholder",
+                                                               tableName: LocalizedStringTableNames.walkthrough,
+                                                               comment: "")
 
-            //Binds the username field value to the ViewModel
-            _ = cell.textField.rx.text.orEmpty
-                .throttle(textFieldThrottlingDuration, scheduler: MainScheduler.instance)
-                .distinctUntilChanged()
-                .bind(to: self.mAccountViewModel.username)
-                .addDisposableTo(mDisposeBag)
+                //Binds the username field value to the ViewModel
+                _ = cell.textField.rx.text.orEmpty
+                    .throttle(textFieldThrottlingDuration, scheduler: MainScheduler.instance)
+                    .distinctUntilChanged()
+                    .bind(to: self.mAccountViewModel.username)
+                    .addDisposableTo(mDisposeBag)
 
-            //Switch to new password cell when return button is touched
-            _ = cell.textField.rx.controlEvent(.editingDidEndOnExit).subscribe(onNext: {
-                self.switchToCell(withType: .newPasswordField)
-            }).addDisposableTo(mDisposeBag)
+                //Switch to new password cell when return button is touched
+                _ = cell.textField.rx.controlEvent(.editingDidEndOnExit).subscribe(onNext: {
+                    self.switchToCell(withType: .newPasswordField)
+                }).addDisposableTo(mDisposeBag)
 
-            _ = self.mAccountViewModel.usernameValidationMessage
-                .bind(to: cell.errorMessageLabel.rx.text)
-                .addDisposableTo(mDisposeBag)
+                _ = self.mAccountViewModel.usernameValidationMessage
+                    .bind(to: cell.errorMessageLabel.rx.text)
+                    .addDisposableTo(mDisposeBag)
 
-            return cell
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId, for: indexPath)
+            }
+
         } else if currentCellType == .passwordNotice {
-            let cell = tableView.dequeueReusableCell(withIdentifier: mTextCellId,
-                                                     for: indexPath) as! TextCell
-            cell.label.text = NSLocalizedString("ChooseStrongPassword",
-                                                tableName: LocalizedStringTableNames.walkthrough,
-                                                comment: "")
-            return cell
+            if let cell = tableView.dequeueReusableCell(withIdentifier: mTextCellId, for: indexPath) as? TextCell {
+                cell.label.text = NSLocalizedString("ChooseStrongPassword",
+                                                    tableName: LocalizedStringTableNames.walkthrough,
+                                                    comment: "")
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: mTextCellId, for: indexPath)
+            }
+
         } else if currentCellType == .newPasswordField {
-            let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
-                                                     for: indexPath) as! TextFieldCell
-            cell.textField.isSecureTextEntry = true
-            cell.textField.placeholder = NSLocalizedString("NewPasswordPlaceholder",
-                                                           tableName: LocalizedStringTableNames.walkthrough,
-                                                           comment: "")
+            if let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
+                                                        for: indexPath) as? TextFieldCell {
+                cell.textField.isSecureTextEntry = true
+                cell.textField.placeholder = NSLocalizedString("NewPasswordPlaceholder",
+                                                               tableName: LocalizedStringTableNames.walkthrough,
+                                                               comment: "")
 
-            cell.errorMessageLabel.text = NSLocalizedString("PasswordCharactersNumberError",
-                                                            tableName: LocalizedStringTableNames.walkthrough,
-                                                            comment: "")
+                cell.errorMessageLabel.text = NSLocalizedString("PasswordCharactersNumberError",
+                                                                tableName: LocalizedStringTableNames.walkthrough,
+                                                                comment: "")
 
-            //Binds the password field value to the ViewModel
-            _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.password)
-                .addDisposableTo(mDisposeBag)
+                //Binds the password field value to the ViewModel
+                _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.password)
+                    .addDisposableTo(mDisposeBag)
 
-            //Binds the observer to show the error label if the field is not empty
-            _ = self.mAccountViewModel.hidePasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
-                .addDisposableTo(mDisposeBag)
+                //Binds the observer to show the error label if the field is not empty
+                _ = self.mAccountViewModel.hidePasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
+                    .addDisposableTo(mDisposeBag)
 
-            //Switch to the repeat pasword cell when return button is touched
-            _ = cell.textField.rx.controlEvent(.editingDidEndOnExit)
-                .subscribe(onNext: {
-                self.switchToCell(withType: .repeatPasswordField)
-            }).addDisposableTo(mDisposeBag)
+                //Switch to the repeat pasword cell when return button is touched
+                _ = cell.textField.rx.controlEvent(.editingDidEndOnExit)
+                    .subscribe(onNext: {
+                        self.switchToCell(withType: .repeatPasswordField)
+                    }).addDisposableTo(mDisposeBag)
 
-            return cell
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId, for: indexPath)
+            }
+
         } else {
-            let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
-                                                     for: indexPath) as! TextFieldCell
-            cell.textField.isSecureTextEntry = true
-            cell.textField.placeholder = NSLocalizedString("RepeatPasswordPlaceholder",
-                                                           tableName: LocalizedStringTableNames.walkthrough,
-                                                           comment: "")
+            if let cell = tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId,
+                                                        for: indexPath) as? TextFieldCell {
+                cell.textField.isSecureTextEntry = true
+                cell.textField.placeholder = NSLocalizedString("RepeatPasswordPlaceholder",
+                                                               tableName: LocalizedStringTableNames.walkthrough,
+                                                               comment: "")
 
-            cell.errorMessageLabel.text = NSLocalizedString("PasswordNotMatchingError",
-                                                            tableName: LocalizedStringTableNames.walkthrough,
-                                                            comment: "")
+                cell.errorMessageLabel.text = NSLocalizedString("PasswordNotMatchingError",
+                                                                tableName: LocalizedStringTableNames.walkthrough,
+                                                                comment: "")
 
-            //Binds the repeat password field value to the ViewModel
-            _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.repeatPassword)
-                .addDisposableTo(mDisposeBag)
+                //Binds the repeat password field value to the ViewModel
+                _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.repeatPassword)
+                    .addDisposableTo(mDisposeBag)
 
-            //Binds the observer to the text field 'hidden' property
-            _ = self.mAccountViewModel.hideRepeatPasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
-                .addDisposableTo(mDisposeBag)
+                //Binds the observer to the text field 'hidden' property
+                _ = self.mAccountViewModel.hideRepeatPasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
+                    .addDisposableTo(mDisposeBag)
 
-            return cell
+                return cell
+            } else {
+                return tableView.dequeueReusableCell(withIdentifier: mTextFieldCellId, for: indexPath)
+            }
         }
     }
 
diff --git a/Ring/Ring/Walkthrough/LinkDeviceToAccountViewController.swift b/Ring/Ring/Walkthrough/LinkDeviceToAccountViewController.swift
index f93b81d..0ba158f 100644
--- a/Ring/Ring/Walkthrough/LinkDeviceToAccountViewController.swift
+++ b/Ring/Ring/Walkthrough/LinkDeviceToAccountViewController.swift
@@ -24,8 +24,6 @@
 
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        
     }
 
 }
diff --git a/Ring/Ring/Walkthrough/WelcomeViewController.swift b/Ring/Ring/Walkthrough/WelcomeViewController.swift
index e9f9064..5f6c478 100644
--- a/Ring/Ring/Walkthrough/WelcomeViewController.swift
+++ b/Ring/Ring/Walkthrough/WelcomeViewController.swift
@@ -59,7 +59,7 @@
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
         self.navigationController?.setNavigationBarHidden(false, animated: true)
 
-        var profileCreationType :ProfileCreationType?
+        var profileCreationType: ProfileCreationType?
 
         if segue.identifier == createProfileSegueIdentifier {
             profileCreationType = .createProfile
diff --git a/Ring/RingTests/AccountModelHelperTests.swift b/Ring/RingTests/AccountModelHelperTests.swift
index 889c751..b5063d2 100644
--- a/Ring/RingTests/AccountModelHelperTests.swift
+++ b/Ring/RingTests/AccountModelHelperTests.swift
@@ -45,15 +45,15 @@
      Tests that the SIP account type is properly detected.
      */
     func testIsSip() {
-        var data = Dictionary<String, String>()
-        data[ConfigKey.AccountType.rawValue] = AccountType.SIP.rawValue
+        var data = [String: String]()
+        data[ConfigKey.accountType.rawValue] = AccountType.sip.rawValue
         var config = AccountConfigModel(withDetails: data)
         account?.details = config
 
         var helper = AccountModelHelper(withAccount: account!)
         XCTAssertTrue(helper.isAccountSip())
 
-        data[ConfigKey.AccountType.rawValue] = AccountType.Ring.rawValue
+        data[ConfigKey.accountType.rawValue] = AccountType.ring.rawValue
         config = AccountConfigModel(withDetails: data)
         account?.details = config
 
@@ -65,15 +65,15 @@
      Tests that the Ring account type is properly detected.
      */
     func testIsRing() {
-        var data = Dictionary<String, String>()
-        data[ConfigKey.AccountType.rawValue] = AccountType.Ring.rawValue
+        var data = [String: String]()
+        data[ConfigKey.accountType.rawValue] = AccountType.ring.rawValue
         var config = AccountConfigModel(withDetails: data)
         account?.details = config
 
         var helper = AccountModelHelper(withAccount: account!)
         XCTAssertTrue(helper.isAccountRing())
 
-        data[ConfigKey.AccountType.rawValue] = AccountType.SIP.rawValue
+        data[ConfigKey.accountType.rawValue] = AccountType.sip.rawValue
         config = AccountConfigModel(withDetails: data)
         account?.details = config
 
@@ -85,21 +85,21 @@
      Tests that the account's enabled state is properly detected.
      */
     func testIsEnabled() {
-        var data = Dictionary<String, String>()
-        data[ConfigKey.AccountEnable.rawValue] = "true"
+        var data = [String: String]()
+        data[ConfigKey.accountEnable.rawValue] = "true"
         var config = AccountConfigModel(withDetails: data)
         account?.details = config
 
         var helper = AccountModelHelper(withAccount: account!)
         XCTAssertTrue(helper.isEnabled())
 
-        data[ConfigKey.AccountEnable.rawValue] = "false"
+        data[ConfigKey.accountEnable.rawValue] = "false"
         config = AccountConfigModel(withDetails: data)
         account?.details = config
         helper = AccountModelHelper(withAccount: account!)
         XCTAssertFalse(helper.isEnabled())
 
-        data.removeValue(forKey: ConfigKey.AccountEnable.rawValue)
+        data.removeValue(forKey: ConfigKey.accountEnable.rawValue)
         config = AccountConfigModel(withDetails: data)
         account?.details = config
         helper = AccountModelHelper(withAccount: account!)
@@ -110,34 +110,34 @@
      Tests that the account's registration state is properly detected.
      */
     func testRegistrationState() {
-        var data = Dictionary<String, String>()
-        data[ConfigKey.AccountRegistrationStatus.rawValue] = AccountState.Registered.rawValue
+        var data = [String: String]()
+        data[ConfigKey.accountRegistrationStatus.rawValue] = AccountState.registered.rawValue
         var config = AccountConfigModel(withDetails: data)
         account?.volatileDetails = config
 
         var helper = AccountModelHelper(withAccount: account!)
-        XCTAssertEqual(helper.getRegistrationState(), AccountState.Registered.rawValue)
+        XCTAssertEqual(helper.getRegistrationState(), AccountState.registered.rawValue)
 
-        data[ConfigKey.AccountRegistrationStatus.rawValue] = AccountState.Error.rawValue
+        data[ConfigKey.accountRegistrationStatus.rawValue] = AccountState.error.rawValue
         config = AccountConfigModel(withDetails: data)
         account?.volatileDetails = config
         helper = AccountModelHelper(withAccount: account!)
-        XCTAssertNotEqual(helper.getRegistrationState(), AccountState.Registered.rawValue)
+        XCTAssertNotEqual(helper.getRegistrationState(), AccountState.registered.rawValue)
     }
 
     /**
      Tests that the account's error state is properly detected.
      */
     func testIsInError() {
-        var data = Dictionary<String, String>()
-        data[ConfigKey.AccountRegistrationStatus.rawValue] = AccountState.Registered.rawValue
+        var data = [String: String]()
+        data[ConfigKey.accountRegistrationStatus.rawValue] = AccountState.registered.rawValue
         var config = AccountConfigModel(withDetails: data)
         account?.volatileDetails = config
 
         var helper = AccountModelHelper(withAccount: account!)
-        XCTAssertFalse(helper.isInError());
+        XCTAssertFalse(helper.isInError())
 
-        data[ConfigKey.AccountRegistrationStatus.rawValue] = AccountState.Error.rawValue
+        data[ConfigKey.accountRegistrationStatus.rawValue] = AccountState.error.rawValue
         config = AccountConfigModel(withDetails: data)
         account?.volatileDetails = config
         helper = AccountModelHelper(withAccount: account!)
@@ -152,11 +152,11 @@
         let password = "password"
         let realm = "realm"
 
-        var credentials = Array<Dictionary<String, String>>()
-        var credential = Dictionary<String, String>()
-        credential[ConfigKey.AccountUsername.rawValue] = username
-        credential[ConfigKey.AccountPassword.rawValue] = password
-        credential[ConfigKey.AccountRealm.rawValue] = realm
+        var credentials = [[String: String]]()
+        var credential = [String: String]()
+        credential[ConfigKey.accountUsername.rawValue] = username
+        credential[ConfigKey.accountPassword.rawValue] = password
+        credential[ConfigKey.accountRealm.rawValue] = realm
         credentials.append(credential)
 
         var helper = AccountModelHelper(withAccount: account!)
diff --git a/Ring/RingTests/DaemonServiceTests.swift b/Ring/RingTests/DaemonServiceTests.swift
index bf814c2..6de3375 100644
--- a/Ring/RingTests/DaemonServiceTests.swift
+++ b/Ring/RingTests/DaemonServiceTests.swift
@@ -71,7 +71,7 @@
     func testAlreadyRunningException() {
         let daemonService = testStart()
         XCTAssertThrowsError(try daemonService.startDaemon()) { (error) in
-            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.DaemonAlreadyRunning)
+            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.daemonAlreadyRunning)
         }
     }
 
@@ -81,7 +81,7 @@
     func testDaemonNotRunningException() {
         let daemonService = DaemonService.init(dRingAdaptor: DRingAdapter())
         XCTAssertThrowsError(try daemonService.stopDaemon()) { (error) in
-            XCTAssertEqual(error as? StopDaemonError, StopDaemonError.DaemonNotRunning)
+            XCTAssertEqual(error as? StopDaemonError, StopDaemonError.daemonNotRunning)
         }
     }
 
@@ -92,7 +92,7 @@
     func testDaemonFailToInit() {
         let daemonService = DaemonService.init(dRingAdaptor: FixtureFailInitDRingAdapter())
         XCTAssertThrowsError(try daemonService.startDaemon()) { (error) in
-            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.InitializationFailure)
+            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.initializationFailure)
         }
     }
 
@@ -103,7 +103,7 @@
     func testDaemonFailToStart() {
         let daemonService = DaemonService.init(dRingAdaptor: FixtureFailStartDRingAdapter())
         XCTAssertThrowsError(try daemonService.startDaemon()) { (error) in
-            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.StartFailure)
+            XCTAssertEqual(error as? StartDaemonError, StartDaemonError.startFailure)
         }
     }
 }
diff --git a/Ring/RingTests/ServiceEventTests.swift b/Ring/RingTests/ServiceEventTests.swift
index 6836c14..6f17c44 100644
--- a/Ring/RingTests/ServiceEventTests.swift
+++ b/Ring/RingTests/ServiceEventTests.swift
@@ -30,7 +30,7 @@
     fileprivate var event: ServiceEvent?
 
     override func setUp() {
-        self.event = ServiceEvent(withEventType: .AccountsChanged)
+        self.event = ServiceEvent(withEventType: .accountsChanged)
     }
 
     /**
@@ -38,7 +38,7 @@
      */
     func testCreateEvent() {
         XCTAssertNotNil(self.event)
-        XCTAssertTrue(self.event?.eventType == ServiceEventType.AccountsChanged)
+        XCTAssertTrue(self.event?.eventType == ServiceEventType.accountsChanged)
     }
 
     /**
@@ -46,9 +46,9 @@
      */
     func testAddStringMetadata() {
         let testString = "Identifier"
-        self.event?.addEventInput(.Id, value: testString)
+        self.event?.addEventInput(.id, value: testString)
 
-        let resultString: String = (self.event?.getEventInput(.Id))!
+        let resultString: String = (self.event?.getEventInput(.id))!
         XCTAssertEqual(resultString, testString)
     }
 
@@ -57,9 +57,9 @@
      */
     func testAddIntMetadata() {
         let testInt = 1
-        self.event?.addEventInput(.Id, value: testInt)
+        self.event?.addEventInput(.id, value: testInt)
 
-        let resultInt: Int = (self.event?.getEventInput(.Id))!
+        let resultInt: Int = (self.event?.getEventInput(.id))!
         XCTAssertEqual(resultInt, testInt)
     }
 }
diff --git a/Ring/RingUITests/RingUITests.swift b/Ring/RingUITests/RingUITests.swift
index c6f7123..a7f33c3 100644
--- a/Ring/RingUITests/RingUITests.swift
+++ b/Ring/RingUITests/RingUITests.swift
@@ -9,12 +9,12 @@
 import XCTest
 
 class RingUITests: XCTestCase {
-        
+
     override func setUp() {
         super.setUp()
-        
+
         // Put setup code here. This method is called before the invocation of each test method in the class.
-        
+
         // In UI tests it is usually best to stop immediately when a failure occurs.
         continueAfterFailure = false
         // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
@@ -22,15 +22,15 @@
 
         // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
     }
-    
+
     override func tearDown() {
         // Put teardown code here. This method is called after the invocation of each test method in the class.
         super.tearDown()
     }
-    
+
     func testExample() {
         // Use recording to get started writing UI tests.
         // Use XCTAssert and related functions to verify your tests produce the correct results.
     }
-    
+
 }