Skip to content

Commit

Permalink
Bugfix - FrameUp should now compile on Xcode 15 on macOS 14.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlintott committed Oct 15, 2024
1 parent 09041e0 commit a119617
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Example/FrameUpExample/TextExamples/TextExamples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ struct TextExamples: View {
var body: some View {
Section {
if #available(iOS 18, macOS 15, watchOS 11, tvOS 18, visionOS 2, *) {
/// This check ensures this code only builds in Xcode 16+
#if compiler(>=6)
NavigationLink(destination: UnclippedTextExample()) {
Label("Unclipped Text", systemImage: "character.textbox")
}
#else
UnavailableView(availableInLaterVersion: true)
#endif
} else {
UnavailableView(availableInLaterVersion: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import FrameUp
import SwiftUI

/// This check ensures this code only builds in Xcode 16+
#if compiler(>=6)
@available(iOS 18, macOS 15, watchOS 11, tvOS 18, visionOS 2, *)
struct UnclippedTextExample: View {
var body: some View {
Expand Down Expand Up @@ -75,3 +77,4 @@ struct UnclippedTextExample: View {
#Preview {
UnclippedTextExample()
}
#endif
3 changes: 3 additions & 0 deletions Sources/FrameUp/Text/UnclippedTextRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import SwiftUI

/// This check ensures this code only builds in Xcode 16+
#if compiler(>=6)
@available(iOS 18, macOS 15, watchOS 11, tvOS 18, visionOS 2, *)
struct UnclippedTextRenderer: TextRenderer {
func draw(layout: Text.Layout, in context: inout GraphicsContext) {
Expand Down Expand Up @@ -94,3 +96,4 @@ public extension View {
.multilineTextAlignment(.center)
.padding()
}
#endif

0 comments on commit a119617

Please sign in to comment.