diff --git a/Package.swift b/Package.swift index 2c6601fb955ac822efb8dcfd0bf129af5052b47d..b8f43d824ae319c2f02e73dbdc273420c745b043 100644 --- a/Package.swift +++ b/Package.swift @@ -116,7 +116,7 @@ let package = Package( ), .package( url: "https://git.xx.network/elixxir/client-ios-db.git", - branch: "feature/blocked-and-banned-contacts" + .upToNextMajor(from: "1.1.0") ), .package( url: "https://github.com/firebase/firebase-ios-sdk.git", diff --git a/Sources/LaunchFeature/LaunchViewModel.swift b/Sources/LaunchFeature/LaunchViewModel.swift index 9dea87edf7217a2c0077187d1b71ffc12bf427d2..9f815af4e330e0e1e973f93d25b1b8f187efcab7 100644 --- a/Sources/LaunchFeature/LaunchViewModel.swift +++ b/Sources/LaunchFeature/LaunchViewModel.swift @@ -86,8 +86,7 @@ final class LaunchViewModel { Task { do { network.writeLogs() - let bannedList = try await fetchBannedList() - process(bannedList: bannedList) + let _ = try await fetchBannedList() network.updateNDF { [weak self] in guard let self = self else { return } @@ -209,14 +208,9 @@ final class LaunchViewModel { } private func fetchBannedList() async throws -> Data { - let request = URLRequest( - url: URL(string: "https://elixxir-bins.s3.us-west-1.amazonaws.com/client/bannedUsers/banned.csv")!, - cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, - timeoutInterval: 5 - ) - + let url = URL(string: "https://elixxir-bins.s3.us-west-1.amazonaws.com/client/bannedUsers/banned.csv") return try await withCheckedThrowingContinuation { continuation in - URLSession.shared.dataTask(with: request) { data, _, error in + URLSession.shared.dataTask(with: url!) { data, _, error in if let error = error { return continuation.resume(throwing: error) } @@ -226,15 +220,4 @@ final class LaunchViewModel { }.resume() } } - - private func process(bannedList: Data) { - if let csv: CSV = try? CSV<Enumerated>( - string: String(data: bannedList, encoding: .utf8)!, - loadColumns: false - ) { - /// csv.rows[0][0] == userId - /// csv.rows[0][1] == username - csv.rows.forEach { print("^^^ Banned row: \($0)") } - } - } } diff --git a/Sources/OnboardingFeature/Controllers/OnboardingStartController.swift b/Sources/OnboardingFeature/Controllers/OnboardingStartController.swift index 7ef1bae86c8297f1b674f486e93955587afe284b..d9b970329040862abe2222493c0ecaf0ee2b34c4 100644 --- a/Sources/OnboardingFeature/Controllers/OnboardingStartController.swift +++ b/Sources/OnboardingFeature/Controllers/OnboardingStartController.swift @@ -27,6 +27,7 @@ public final class OnboardingStartController: UIViewController { public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationItem.backButtonTitle = "" navigationController?.navigationBar.customize(translucent: true) } diff --git a/Sources/OnboardingFeature/Controllers/OnboardingUsernameController.swift b/Sources/OnboardingFeature/Controllers/OnboardingUsernameController.swift index b1d3feb5cf5047be6cab2948051f4392973c85cc..761128f1f148f9a1ba02b46da99de5a7f30bc6f3 100644 --- a/Sources/OnboardingFeature/Controllers/OnboardingUsernameController.swift +++ b/Sources/OnboardingFeature/Controllers/OnboardingUsernameController.swift @@ -23,6 +23,7 @@ public final class OnboardingUsernameController: UIViewController { public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) statusBarController.style.send(.darkContent) + navigationItem.backButtonTitle = "" navigationController?.navigationBar.customize(translucent: true) } @@ -49,26 +50,6 @@ public final class OnboardingUsernameController: UIViewController { } } - private func setupNavigationBar() { - navigationItem.backButtonTitle = "" - - let backButton = UIButton() - backButton.setImage(Asset.navigationBarBack.image, for: .normal) - backButton.tintColor = Asset.neutralActive.color - backButton.imageView?.contentMode = .center - backButton.snp.makeConstraints { $0.width.equalTo(50) } - backButton - .publisher(for: .touchUpInside) - .receive(on: DispatchQueue.main) - .sink { [unowned self] in - navigationController?.popViewController(animated: true) - }.store(in: &cancellables) - - navigationItem.leftBarButtonItem = UIBarButtonItem( - customView: UIStackView(arrangedSubviews: [backButton]) - ) - } - private func setupScrollView() { scrollViewController.scrollView.backgroundColor = .white diff --git a/Sources/Shared/Extensions/NavigationBar.swift b/Sources/Shared/Extensions/NavigationBar.swift index 2b4d8d254ed4554cbeb8d58dc94df1c0f0f48754..b7efcb698321a974752e5c07cab1542ca0d26d80 100644 --- a/Sources/Shared/Extensions/NavigationBar.swift +++ b/Sources/Shared/Extensions/NavigationBar.swift @@ -4,14 +4,18 @@ public extension UINavigationBar { func customize( translucent: Bool = false, backgroundColor: UIColor = .clear, - shadowColor: UIColor? = nil + shadowColor: UIColor? = nil, + tint: UIColor = Asset.neutralActive.color ) { isTranslucent = translucent let barAppearance = UINavigationBarAppearance() barAppearance.backgroundColor = backgroundColor barAppearance.backgroundEffect = .none barAppearance.shadowColor = shadowColor + + tintColor = tint + compactAppearance = barAppearance standardAppearance = barAppearance - scrollEdgeAppearance = standardAppearance + scrollEdgeAppearance = barAppearance } } diff --git a/Sources/TermsFeature/TermsConditionsController.swift b/Sources/TermsFeature/TermsConditionsController.swift index ea017dd0f01aa1b6a86be0a02f15677d061a9ed1..0a5b3b5bb86885b214e3799a00e3c6d4f6d170f2 100644 --- a/Sources/TermsFeature/TermsConditionsController.swift +++ b/Sources/TermsFeature/TermsConditionsController.swift @@ -36,27 +36,9 @@ public final class TermsConditionsController: UIViewController { public override func viewDidLoad() { super.viewDidLoad() - navigationItem.backButtonTitle = "" - - let backButton = UIButton() - backButton.setImage(Asset.navigationBarBack.image, for: .normal) - backButton.tintColor = Asset.neutralActive.color - backButton.imageView?.contentMode = .center - backButton.snp.makeConstraints { $0.width.equalTo(50) } - backButton - .publisher(for: .touchUpInside) - .receive(on: DispatchQueue.main) - .sink { [unowned self] in - navigationController?.popViewController(animated: true) - }.store(in: &cancellables) - - navigationItem.leftBarButtonItem = UIBarButtonItem( - customView: UIStackView(arrangedSubviews: [backButton]) - ) - screenView.radioComponent - .radioButton.publisher(for: .touchUpInside) - .receive(on: DispatchQueue.main) + .radioButton + .publisher(for: .touchUpInside) .sink { [unowned self] in screenView.radioComponent.isEnabled.toggle() screenView.nextButton.isEnabled = screenView.radioComponent.isEnabled @@ -64,7 +46,6 @@ public final class TermsConditionsController: UIViewController { screenView.nextButton .publisher(for: .touchUpInside) - .receive(on: DispatchQueue.main) .sink { [unowned self] in didAcceptTerms = true @@ -77,7 +58,6 @@ public final class TermsConditionsController: UIViewController { screenView.showTermsButton .publisher(for: .touchUpInside) - .receive(on: DispatchQueue.main) .sink { _ in // TODO }.store(in: &cancellables) diff --git a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved index 453f1d5d557a06e08739d65208b67e6ff2d655c0..2edfffa23ebd11df1784b06aa0e734df8c56269a 100644 --- a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://git.xx.network/elixxir/client-ios-db.git", "state" : { - "branch" : "feature/blocked-and-banned-contacts", - "revision" : "b35a3779c276471aa6e79f047e1c843e49b0dea8" + "revision" : "f8e3e0088de8301d6c4816e12f0aca1d6f02a280", + "version" : "1.1.0" } }, {