From 66d23432c19923f3501609192040719cacbe2513 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 11 May 2022 19:22:22 +0800 Subject: [PATCH 1/3] fix: pick server table margin not works issue --- .../PickServer/MastodonPickServerViewController.swift | 11 ++++++----- .../PickServer/MastodonPickServerViewModel.swift | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift index ffc7708f5..d05b446ae 100644 --- a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift +++ b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift @@ -92,7 +92,7 @@ extension MastodonPickServerViewController { tableView.topAnchor.constraint(equalTo: view.topAnchor), tableView.leadingAnchor.constraint(equalTo: view.leadingAnchor), tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor), - tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + tableView.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor), ]) navigationActionView.translatesAutoresizingMaskIntoConstraints = false @@ -107,10 +107,10 @@ extension MastodonPickServerViewController { ]) navigationActionView - .observe(\.bounds, options: [.initial, .new]) { [weak self] navigationActionView, _ in + .observe(\.bounds, options: [.initial, .new]) { [weak self] _, _ in guard let self = self else { return } - let inset = navigationActionView.frame.height - self.tableView.contentInset.bottom = inset + let inset = self.navigationActionView.frame.height + self.viewModel.additionalTableViewInsets.bottom = inset } .store(in: &observations) @@ -149,7 +149,8 @@ extension MastodonPickServerViewController { KeyboardResponderService .configure( scrollView: tableView, - layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher() + layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher(), + additionalSafeAreaInsets: viewModel.$additionalTableViewInsets.eraseToAnyPublisher() ) .store(in: &disposeBag) diff --git a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewModel.swift b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewModel.swift index 749843880..b077cbbe1 100644 --- a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewModel.swift +++ b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewModel.swift @@ -46,7 +46,8 @@ class MastodonPickServerViewModel: NSObject { let unindexedServers = CurrentValueSubject<[Mastodon.Entity.Server]?, Never>([]) // set nil when loading let viewWillAppear = PassthroughSubject() let viewDidAppear = CurrentValueSubject(Void()) - + @Published var additionalTableViewInsets: UIEdgeInsets = .zero + // output var diffableDataSource: UITableViewDiffableDataSource? private(set) lazy var loadIndexedServerStateMachine: GKStateMachine = { From 9d0e2b68b45054cfe04f0ce559323085b162f55c Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 11 May 2022 19:39:58 +0800 Subject: [PATCH 2/3] chore: workaround CocoaPods CDN issue --- .github/scripts/setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 9b52d5b9e..0fc93db11 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -1,5 +1,8 @@ #!/bin/bash +# workaround https://github.com/CocoaPods/CocoaPods/issues/11355 +echo "$(echo -n 'source "https://github.com/CocoaPods/Specs.git"\n'; cat Podfile)" > Podfile + # Install Ruby Bundler gem install bundler:2.3.11 From ea6c9fc87e1348be26ed6f0bb6af4dd79099e221 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 11 May 2022 19:53:40 +0800 Subject: [PATCH 3/3] chore: update setup.sh --- .github/scripts/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 0fc93db11..845730f1f 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash # workaround https://github.com/CocoaPods/CocoaPods/issues/11355 -echo "$(echo -n 'source "https://github.com/CocoaPods/Specs.git"\n'; cat Podfile)" > Podfile +sed -i '' $'1s/^/source "https:\\/\\/github.com\\/CocoaPods\\/Specs.git"\\\n\\\n/' Podfile # Install Ruby Bundler gem install bundler:2.3.11