diff --git a/Ring/Ring/Calls/CallViewController.swift b/Ring/Ring/Calls/CallViewController.swift index 019ea5f912a6826e7ea0035692c64b1d4a62189a..2943e042a66b42fbb5ab6ac15dcb0b1b9666e5ba 100644 --- a/Ring/Ring/Calls/CallViewController.swift +++ b/Ring/Ring/Calls/CallViewController.swift @@ -553,7 +553,7 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased, Con } if self.viewModel.isAudioOnly { let device = UIDevice.modelName - if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { + if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { self.durationLabel.isHidden = true self.buttonsContainerBottomConstraint.constant = -10 } diff --git a/Ring/Ring/Calls/Conference/ContactPickerViewController.swift b/Ring/Ring/Calls/Conference/ContactPickerViewController.swift index 13cc51dac941bf514d1fad707f151a603185f3dc..8c85ad9655ad6ab15ba5a8170cd058957ecf1a46 100644 --- a/Ring/Ring/Calls/Conference/ContactPickerViewController.swift +++ b/Ring/Ring/Calls/Conference/ContactPickerViewController.swift @@ -107,7 +107,7 @@ class ContactPickerViewController: UIViewController, StoryboardBased, ViewModelB private func setupDataSources() { let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, ContactPickerSection.Item) -> UITableViewCell = { - ( dataSource: TableViewSectionedDataSource<ContactPickerSection>, + ( _: TableViewSectionedDataSource<ContactPickerSection>, tableView: UITableView, indexPath: IndexPath, contactItem: ContactPickerSection.Item) in diff --git a/Ring/Ring/Constants/Generated/Images.swift b/Ring/Ring/Constants/Generated/Images.swift index 9676ff147c2e14011bee070d9b205451f97c9332..f346b31378146f3f63df729a0317903168303904 100644 --- a/Ring/Ring/Constants/Generated/Images.swift +++ b/Ring/Ring/Constants/Generated/Images.swift @@ -135,7 +135,8 @@ internal struct ImageAsset { #if os(iOS) || os(tvOS) let image = Image(named: name, in: bundle, compatibleWith: nil) #elseif os(macOS) - let image = bundle.image(forResource: NSImage.Name(name)) + let name = NSImage.Name(self.name) + let image = (bundle == .main) ? NSImage(named: name) : bundle.image(forResource: name) #elseif os(watchOS) let image = Image(named: name) #endif @@ -164,7 +165,11 @@ internal extension ImageAsset.Image { // swiftlint:disable convenience_type private final class BundleToken { static let bundle: Bundle = { - Bundle(for: BundleToken.self) + #if SWIFT_PACKAGE + return Bundle.module + #else + return Bundle(for: BundleToken.self) + #endif }() } // swiftlint:enable convenience_type diff --git a/Ring/Ring/Constants/Generated/Strings.swift b/Ring/Ring/Constants/Generated/Strings.swift index 6a4f8f14c75736c19b207703ac325f9c4ccf82b6..32308c53de3968b1adbb79951c266cd40d7b85a7 100644 --- a/Ring/Ring/Constants/Generated/Strings.swift +++ b/Ring/Ring/Constants/Generated/Strings.swift @@ -8,7 +8,7 @@ import Foundation // MARK: - Strings // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length -// swiftlint:disable nesting type_body_length type_name +// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces internal enum L10n { internal enum Account { @@ -499,9 +499,9 @@ internal enum L10n { } internal enum LinkToAccountManager { - /// Enter account manager URI + /// Enter JAMS URL internal static let accountManagerLabel = L10n.tr("Localizable", "linkToAccountManager.accountManagerLabel") - /// Account manager + /// JAMS URL internal static let accountManagerPlaceholder = L10n.tr("Localizable", "linkToAccountManager.accountManagerPlaceholder") /// Enter Password internal static let passwordLabel = L10n.tr("Localizable", "linkToAccountManager.passwordLabel") @@ -592,7 +592,7 @@ internal enum L10n { } internal enum Welcome { - /// Connect to account manager + /// Connect to a JAMS server internal static let connectToManager = L10n.tr("Localizable", "welcome.connectToManager") /// Create a Jami account internal static let createAccount = L10n.tr("Localizable", "welcome.createAccount") @@ -605,7 +605,7 @@ internal enum L10n { } } // swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length -// swiftlint:enable nesting type_body_length type_name +// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces // MARK: - Implementation Details @@ -619,7 +619,11 @@ extension L10n { // swiftlint:disable convenience_type private final class BundleToken { static let bundle: Bundle = { - Bundle(for: BundleToken.self) + #if SWIFT_PACKAGE + return Bundle.module + #else + return Bundle(for: BundleToken.self) + #endif }() } // swiftlint:enable convenience_type diff --git a/Ring/Ring/Dialpad/DialpadViewController.swift b/Ring/Ring/Dialpad/DialpadViewController.swift index 091781db2f60d4247ff6239e9dba104f80e9cc94..7d6051f0445a31d2f87950bdf36e9900e6932cc8 100644 --- a/Ring/Ring/Dialpad/DialpadViewController.swift +++ b/Ring/Ring/Dialpad/DialpadViewController.swift @@ -44,7 +44,7 @@ class DialpadViewController: UIViewController, StoryboardBased, ViewModelBased { collectionView.backgroundColor = UIColor.jamiBackgroundColor self.applyL10n() let device = UIDevice.modelName - if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { + if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { labelTopConstraint.constant = 15 labelBottomConstraint.constant = 15 } diff --git a/Ring/Ring/Features/Conversations/Conversation/MessageViewModel.swift b/Ring/Ring/Features/Conversations/Conversation/MessageViewModel.swift index caf2e16568f70684c796439c85902d0fc4999900..c401b65f908877a902f363761451fae12188d5d8 100644 --- a/Ring/Ring/Features/Conversations/Conversation/MessageViewModel.swift +++ b/Ring/Ring/Features/Conversations/Conversation/MessageViewModel.swift @@ -42,7 +42,7 @@ enum MessageSequencing { enum GeneratedMessageType: String { case receivedContactRequest = "Contact request received" - case contactAdded = "Contact added" + case contactAdded = "Contact added" case missedIncomingCall = "Missed incoming call" case missedOutgoingCall = "Missed outgoing call" case incomingCall = "Incoming call" diff --git a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift index dc7459940e6cb071d0be49fadf2a7b8f0a766e99..b8f711818db6e229c5dd364cf573b4a26b7634e8 100644 --- a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift +++ b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift @@ -351,7 +351,7 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased //Configure cells closure for the datasources let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, ConversationSection.Item) -> UITableViewCell = { - ( dataSource: TableViewSectionedDataSource<ConversationSection>, + ( _: TableViewSectionedDataSource<ConversationSection>, tableView: UITableView, indexPath: IndexPath, conversationItem: ConversationSection.Item) in diff --git a/Ring/Ring/Features/Conversations/views/JamiSearchView/JamiSearchView.swift b/Ring/Ring/Features/Conversations/views/JamiSearchView/JamiSearchView.swift index 11f4d469c9569c42a723366cb54ed596dbca3ffd..f22fcb349665309566a3ea51b56488080518064f 100644 --- a/Ring/Ring/Features/Conversations/views/JamiSearchView/JamiSearchView.swift +++ b/Ring/Ring/Features/Conversations/views/JamiSearchView/JamiSearchView.swift @@ -70,7 +70,7 @@ class JamiSearchView: NSObject { self.searchResultsTableView.rx.setDelegate(self).disposed(by: disposeBag) let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, ConversationSection.Item) -> UITableViewCell = { - (dataSource: TableViewSectionedDataSource<ConversationSection>, + (_: TableViewSectionedDataSource<ConversationSection>, tableView: UITableView, indexPath: IndexPath, conversationItem: ConversationSection.Item) in diff --git a/Ring/Ring/Features/Me/Me/MeViewController.swift b/Ring/Ring/Features/Me/Me/MeViewController.swift index ba9649e273c3aa6ddc45f33747a1c9f533ae9438..a236c2c61e69d7f7d026e114c934c5f213414a4a 100644 --- a/Ring/Ring/Features/Me/Me/MeViewController.swift +++ b/Ring/Ring/Features/Me/Me/MeViewController.swift @@ -300,7 +300,7 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas ( dataSource: TableViewSectionedDataSource<SettingsSection>, tableView: UITableView, indexPath: IndexPath, - item: SettingsSection.Item) in + _: SettingsSection.Item) in switch dataSource[indexPath] { case .autoRegistration: diff --git a/Ring/Ring/Features/Me/Me/MeViewModel.swift b/Ring/Ring/Features/Me/Me/MeViewModel.swift index 2d0c25c2797d49939b828c6b0d9fed2f774542f3..45de8c5a9e3f84b3dd4a362463627e4bd14389b4 100644 --- a/Ring/Ring/Features/Me/Me/MeViewModel.swift +++ b/Ring/Ring/Features/Me/Me/MeViewModel.swift @@ -127,7 +127,7 @@ class MeViewModel: ViewModel, Stateable { lazy var accountCredentials: Observable<SettingsSection> = { return Observable .combineLatest(userName.startWith(""), ringId.startWith("")) { (name, ringID) in - var items: [SettingsSection.SectionRow] = [.sectionHeader(title: L10n.AccountPage.credentialsHeader), + var items: [SettingsSection.SectionRow] = [.sectionHeader(title: L10n.AccountPage.credentialsHeader), .jamiID(label: ringID)] items.append(.jamiUserName(label: name)) items.append(.shareAccountDetails) diff --git a/Ring/Ring/GeneralSettings/GeneralSettingsViewController.swift b/Ring/Ring/GeneralSettings/GeneralSettingsViewController.swift index 2e19ae5e8b201467136037b03f32761cb3940fd3..83a79fbf972f61d89252d047cd86af0f342d18db 100644 --- a/Ring/Ring/GeneralSettings/GeneralSettingsViewController.swift +++ b/Ring/Ring/GeneralSettings/GeneralSettingsViewController.swift @@ -61,9 +61,9 @@ class GeneralSettingsViewController: UIViewController, StoryboardBased, ViewMode let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, GeneralSettingsSection.Item) -> UITableViewCell = { ( dataSource: TableViewSectionedDataSource<GeneralSettingsSection>, - tableView: UITableView, + _: UITableView, indexPath: IndexPath, - item: GeneralSettingsSection.Item) in + _: GeneralSettingsSection.Item) in switch dataSource[indexPath] { case .hardwareAcceleration: diff --git a/Ring/Ring/Models/AccountCredentialsModel.swift b/Ring/Ring/Models/AccountCredentialsModel.swift index e916ae37133d62af4761bf2c24a72154a56d1f67..6142afdd26e9ac5e117e07cb355094b08c15bca3 100644 --- a/Ring/Ring/Models/AccountCredentialsModel.swift +++ b/Ring/Ring/Models/AccountCredentialsModel.swift @@ -80,9 +80,9 @@ class AccountCredentialsModel: Object { func toDictionary() -> [String: String] { var dictionary = [String: String]() - dictionary[ConfigKey.accountUsername.rawValue] = self.username - dictionary[ConfigKey.accountPassword.rawValue] = self.password - dictionary[ConfigKey.accountRealm.rawValue] = self.accountRealm + dictionary[ConfigKey.accountUsername.rawValue] = self.username + dictionary[ConfigKey.accountPassword.rawValue] = self.password + dictionary[ConfigKey.accountRealm.rawValue] = self.accountRealm return dictionary } } diff --git a/Ring/Ring/Services/ConversationsManager.swift b/Ring/Ring/Services/ConversationsManager.swift index 8225bb61d698b40ae07184904257826eec7d4368..dfcf2e962890033151f40e43ba2dc1f9ab86a3ac 100644 --- a/Ring/Ring/Services/ConversationsManager.swift +++ b/Ring/Ring/Services/ConversationsManager.swift @@ -66,7 +66,7 @@ class ConversationsManager: MessagesAdapterDelegate { var data = [String: String]() data[NotificationUserInfoKeys.messageContent.rawValue] = event.getEventInput(ServiceEventInput.content) data[NotificationUserInfoKeys.participantID.rawValue] = event.getEventInput(ServiceEventInput.peerUri) - data[NotificationUserInfoKeys.accountID.rawValue] = event.getEventInput(ServiceEventInput.accountId) + data[NotificationUserInfoKeys.accountID.rawValue] = event.getEventInput(ServiceEventInput.accountId) guard let contactUri = data[NotificationUserInfoKeys.participantID.rawValue], let hash = JamiURI(schema: URIType.ring, infoHach: contactUri).hash else { return }