diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 250eb86..3884c72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,52 +21,74 @@ jobs: - uses: actions/checkout@v2 - name: Run tests run: swift test --enable-test-discovery --enable-code-coverage | xcpretty - build-ventura: + build-sonoma: strategy: matrix: xcode: - - '14.3.1' - - '15.2' - runs-on: macos-13 + - '15.4' + runs-on: macos-14 steps: - uses: actions/checkout@v2 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run Build run: swift build - unit_test-ventura: + unit_test-sonoma: strategy: matrix: xcode: - - '14.3.1' - - '15.2' - runs-on: macos-13 + - '15.4' + runs-on: macos-14 steps: - uses: actions/checkout@v2 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run tests run: swift test --enable-test-discovery --enable-code-coverage | xcpretty - build-sonoma: + + build-sequioa: strategy: matrix: xcode: - - '15.4' - - '16.1' - runs-on: macos-14 + - '16.4' + runs-on: macos-15 steps: - uses: actions/checkout@v2 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run Build run: swift build - unit_test-sonoma: + unit_test-sequioa: strategy: matrix: xcode: - - '15.4' - - '16.1' - runs-on: macos-14 + - '16.4' + runs-on: macos-15 + steps: + - uses: actions/checkout@v2 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Run tests + run: swift test --enable-test-discovery --enable-code-coverage | xcpretty + + build-tahoe: + strategy: + matrix: + xcode: + - '26.0' + runs-on: macos-26 + steps: + - uses: actions/checkout@v2 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Run Build + run: swift build + unit_test-tahoe: + strategy: + matrix: + xcode: + - '26.0' + runs-on: macos-26 steps: - uses: actions/checkout@v2 - name: Select Xcode ${{ matrix.xcode }} diff --git a/Sources/TPTweak/TPTweakGroupViewController.swift b/Sources/TPTweak/TPTweakGroupViewController.swift index d01bb7a..5390daa 100644 --- a/Sources/TPTweak/TPTweakGroupViewController.swift +++ b/Sources/TPTweak/TPTweakGroupViewController.swift @@ -57,6 +57,10 @@ public final class TPTweakGroupViewController: UIViewController { setupView() + if #available(iOS 11.0, *) { + table.contentInsetAdjustmentBehavior = .always + } + data = fetchUserDefinedRows() table.reloadData() diff --git a/Sources/TPTweak/TPTweakOptionsViewController.swift b/Sources/TPTweak/TPTweakOptionsViewController.swift index 24c4fdc..15e7982 100644 --- a/Sources/TPTweak/TPTweakOptionsViewController.swift +++ b/Sources/TPTweak/TPTweakOptionsViewController.swift @@ -66,6 +66,28 @@ internal final class TPTweakOptionsViewController: UIViewController, override internal func viewDidLoad() { super.viewDidLoad() + + if #available(iOS 11.0, *) { + table.contentInsetAdjustmentBehavior = .always + } + + if #available(iOS 13.0, *) { + let appearance = UINavigationBarAppearance() + appearance.configureWithDefaultBackground() + appearance.titleTextAttributes = [.foregroundColor: UIColor.label] + appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.standardAppearance = appearance + navigationItem.compactAppearance = appearance + + let scrollEdgeAppearance = UINavigationBarAppearance() + scrollEdgeAppearance.configureWithTransparentBackground() + scrollEdgeAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] + scrollEdgeAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.scrollEdgeAppearance = scrollEdgeAppearance + } + table.reloadData() } diff --git a/Sources/TPTweak/TPTweakPickerViewController.swift b/Sources/TPTweak/TPTweakPickerViewController.swift index eab414f..2f92b7c 100644 --- a/Sources/TPTweak/TPTweakPickerViewController.swift +++ b/Sources/TPTweak/TPTweakPickerViewController.swift @@ -115,16 +115,29 @@ internal final class TPTweakPickerViewController: UIViewController { override internal func viewDidLoad() { super.viewDidLoad() - table.reloadData() - } - - override internal func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - if #available(iOS 12.0, *) { - navigationController?.navigationBar.prefersLargeTitles = false - navigationController?.navigationItem.largeTitleDisplayMode = .never + if #available(iOS 11.0, *) { + table.contentInsetAdjustmentBehavior = .always } + + if #available(iOS 13.0, *) { + let appearance = UINavigationBarAppearance() + appearance.configureWithDefaultBackground() + appearance.titleTextAttributes = [.foregroundColor: UIColor.label] + appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.standardAppearance = appearance + navigationItem.compactAppearance = appearance + + let scrollEdgeAppearance = UINavigationBarAppearance() + scrollEdgeAppearance.configureWithTransparentBackground() + scrollEdgeAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] + scrollEdgeAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.scrollEdgeAppearance = scrollEdgeAppearance + } + + table.reloadData() } internal required init?(coder _: NSCoder) { diff --git a/Sources/TPTweak/TPTweakViewController.swift b/Sources/TPTweak/TPTweakViewController.swift index ac1d027..7e35909 100644 --- a/Sources/TPTweak/TPTweakViewController.swift +++ b/Sources/TPTweak/TPTweakViewController.swift @@ -30,17 +30,10 @@ public final class TPTweakWithNavigatationViewController: UINavigationController } if #available(iOS 12.0, *) { - navigationBar.prefersLargeTitles = false + navigationBar.prefersLargeTitles = true } - navigationBar.isTranslucent = false - - if #available(iOS 13.0, *) { - navigationBar.tintColor = .systemBlue - navigationBar.titleTextAttributes = [.foregroundColor: UIColor.label] - navigationBar.barTintColor = .systemGroupedBackground - navigationBar.backgroundColor = .systemGroupedBackground - } + navigationBar.isTranslucent = true } public override func viewWillAppear(_ animated: Bool) { @@ -134,7 +127,7 @@ public final class TPTweakViewController: UIViewController { searchController.delegate = self searchController.searchBar.placeholder = " Search..." searchController.searchBar.searchBarStyle = .prominent - searchController.searchBar.isTranslucent = false + searchController.searchBar.isTranslucent = true searchController.hidesNavigationBarDuringPresentation = false searchController.searchBar.sizeToFit() @@ -161,8 +154,29 @@ public final class TPTweakViewController: UIViewController { super.viewDidLoad() if #available(iOS 11.0, *) { + navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never } + + if #available(iOS 13.0, *) { + let appearance = UINavigationBarAppearance() + appearance.configureWithDefaultBackground() + appearance.titleTextAttributes = [.foregroundColor: UIColor.label] + appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.standardAppearance = appearance + navigationItem.compactAppearance = appearance + + let scrollEdgeAppearance = UINavigationBarAppearance() + scrollEdgeAppearance.configureWithTransparentBackground() + scrollEdgeAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] + scrollEdgeAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] + + navigationItem.scrollEdgeAppearance = scrollEdgeAppearance + } + + // enable extending bottom content to create overflow effect with tabbar in ios 26 liquid glass + edgesForExtendedLayout = [.bottom, .top] // listen to minimize the view controller NotificationCenter.default.addObserver( @@ -202,13 +216,6 @@ public final class TPTweakViewController: UIViewController { } } - public override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - // sync size to child vc - viewController?.view.frame = view.bounds - } - internal required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -252,6 +259,15 @@ public final class TPTweakViewController: UIViewController { // add child self.addChild(viewController) view.addSubview(viewController.view) + + viewController.view.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + viewController.view.topAnchor.constraint(equalTo: view.topAnchor), + viewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + viewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + viewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) + ]) + viewController.didMove(toParent: self) if userChangeLayout { diff --git a/assets/tptewak_settings.png b/assets/tptewak_settings.png index 15e2ad0..58ea41b 100644 Binary files a/assets/tptewak_settings.png and b/assets/tptewak_settings.png differ diff --git a/assets/tptweak_home.png b/assets/tptweak_home.png index 7272f34..9d2bfc3 100644 Binary files a/assets/tptweak_home.png and b/assets/tptweak_home.png differ diff --git a/assets/tptweak_home_flatten.png b/assets/tptweak_home_flatten.png index 0bd69b7..af66fae 100644 Binary files a/assets/tptweak_home_flatten.png and b/assets/tptweak_home_flatten.png differ diff --git a/assets/tptweak_number_selection_example.png b/assets/tptweak_number_selection_example.png index b4103aa..3450a24 100644 Binary files a/assets/tptweak_number_selection_example.png and b/assets/tptweak_number_selection_example.png differ diff --git a/assets/tptweak_string_selection_example.png b/assets/tptweak_string_selection_example.png index bd7f450..25023cc 100644 Binary files a/assets/tptweak_string_selection_example.png and b/assets/tptweak_string_selection_example.png differ