From 71dba65db71b114ea3b24d749532be7627af94db Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Mon, 5 Jan 2026 15:24:17 +0100 Subject: [PATCH 1/4] Use native lineHeight viewModifier on iOS 26 --- Sources/ACKategories/SwiftUIExtensions/FontModifier.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/ACKategories/SwiftUIExtensions/FontModifier.swift b/Sources/ACKategories/SwiftUIExtensions/FontModifier.swift index 55e6ce9..be6e161 100644 --- a/Sources/ACKategories/SwiftUIExtensions/FontModifier.swift +++ b/Sources/ACKategories/SwiftUIExtensions/FontModifier.swift @@ -10,6 +10,8 @@ public extension View { /// - font: The font to use in this view. /// - lineHeight: The line height to use in this view. /// - textStyle: The text style for relative font scaling. If `nil`is specified then dynamic type is turned off. + /// + /// On iOS 26 and above uses native [lineHeight](https://developer.apple.com/documentation/swiftui/environmentvalues/lineheight) view modifier. @ViewBuilder func font( _ font: UIFont, lineHeight: Double?, @@ -19,7 +21,10 @@ public extension View { let customFont = textStyle .map { Font.custom(font.fontName, size: font.pointSize, relativeTo: $0) } ?? Font(font) - if let lineHeight { + if #available(iOS 26.0, tvOS 26.0, watchOS 26.0, *), let lineHeight { + self.font(customFont) + .lineHeight(.exact(points: lineHeight)) + } else if let lineHeight { self.font(customFont) .lineSpacing(lineHeight - font.lineHeight) .padding(.vertical, (lineHeight - font.lineHeight) / 2) From a4725fc73673232a83c9d79372ca5f84fb32efa1 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Mon, 5 Jan 2026 16:00:32 +0100 Subject: [PATCH 2/4] Use latest macOS --- .github/workflows/build.yml | 4 ++-- .github/workflows/docbuild.yml | 2 +- .github/workflows/tests.yml | 4 ++-- .github/xcode-version | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 .github/xcode-version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8651187..784a5f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: carthage: name: Carthage - runs-on: macos-15 + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Build @@ -22,7 +22,7 @@ jobs: ${{ runner.os }}-carthage- spm: name: SPM - runs-on: macos-15 + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Build diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index e0567f9..4dbed8a 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -21,7 +21,7 @@ jobs: # Must be set to this for deploying to GitHub Pages name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: macos-15 + runs-on: macos-latest steps: - name: Checkout 🛎️ uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f5f25e..4cc805e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: [workflow_call] jobs: xcodebuild: name: Xcodebuild - runs-on: macos-15 + runs-on: macos-latest env: IOS_DEVICE: iPhone 16 Pro steps: @@ -47,7 +47,7 @@ jobs: path: Tests-tvOS.xcresult spm: name: SPM - runs-on: macos-15 + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: SPM build diff --git a/.github/xcode-version b/.github/xcode-version deleted file mode 100644 index 441e3fb..0000000 --- a/.github/xcode-version +++ /dev/null @@ -1 +0,0 @@ -15.4 \ No newline at end of file From e7b7b8df500eef41fed6dd27bc8cd98b7b800feb Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Mon, 5 Jan 2026 16:04:22 +0100 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4171a..8b3f1da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ## Next +- Update `font(_:lineHeight:textStyle:)` viewModifier to use native [`lineHeight`](https://developer.apple.com/documentation/swiftui/environmentvalues/lineheight) on +26.0 systems ([#154](https://github.com/AckeeCZ/ACKategories/pull/154), kudos to @olejnjak) + ## 6.16.0 - Add SwiftUI extension `View+FrameSize` ([#153](https://github.com/AckeeCZ/ACKategories/pull/153), kudos to @lukashromadnik) From 5e17cc9607a9a7624274da4eea5e81cd1d5f78be Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Mon, 5 Jan 2026 16:14:50 +0100 Subject: [PATCH 4/4] Update Xcode version --- .github/workflows/build.yml | 3 +++ .github/workflows/docbuild.yml | 3 +++ .github/workflows/tests.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 784a5f1..9284bed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ on: branches: - main +env: + DEVELOPER_DIR: /Applications/Xcode_26.1.1.app/Contents/Developer + jobs: carthage: name: Carthage diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index 4dbed8a..f21bf9f 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -14,6 +14,9 @@ concurrency: group: "pages" cancel-in-progress: true +env: + DEVELOPER_DIR: /Applications/Xcode_26.1.1.app/Contents/Developer + jobs: # Single deploy job since we're just deploying deploy: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cc805e..fe4c6bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,6 +2,9 @@ name: Tests on: [workflow_call] +env: + DEVELOPER_DIR: /Applications/Xcode_26.1.1.app/Contents/Developer + jobs: xcodebuild: name: Xcodebuild