Skip to content

Commit 4765a9a

Browse files
committed
Make library build on all platforms
1 parent 930dbf5 commit 4765a9a

File tree

6 files changed

+23
-0
lines changed

6 files changed

+23
-0
lines changed

Release Notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33

44
## 1.7.1
55

6+
### 💡 Behavior changes
7+
68
This release renames `ActionButton` and `ActionButtonStyle` to `FormActionButton` and `FormActionButtonStyle`, since the name "action button" is too general.
79

10+
### 🐛 Bug fixes
11+
12+
* This release fixes build errors on tvOS and macOS.
13+
814
### 🗑 Deprecations
915

1016
* `ActionButton` and `ActionButtonStyle` has been deprecated.

Sources/SwiftUIKit/Data/StandardScanCodeGenerator.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,12 @@ private extension StandardScanCodeGenerator {
5252
}
5353
}
5454
#endif
55+
56+
#if os(macOS)
57+
private extension ImageResource {
58+
59+
convenience init(cgImage: CGImage) {
60+
self.init(cgImage: cgImage, size: .zero)
61+
}
62+
}
63+
#endif

Sources/SwiftUIKit/Views/Form/FormActionButton.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2021 Daniel Saidi. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import SwiftUI
1011

1112
/**
@@ -113,3 +114,4 @@ private extension Image {
113114
Image(systemName: name)
114115
}
115116
}
117+
#endif

Sources/SwiftUIKit/Views/Form/FormTextEditor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2021 Daniel Saidi. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import SwiftUI
1011

1112
/**
@@ -82,3 +83,4 @@ In the cold November rain
8283
}
8384
}
8485
}
86+
#endif

Sources/SwiftUIKit/Views/Form/FormTextField.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2021 Daniel Saidi. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import SwiftUI
1011

1112
/**
@@ -51,3 +52,4 @@ struct FormTextField_Previews: PreviewProvider {
5152
}
5253
}
5354
}
55+
#endif
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
#if os(iOS)
12
@available(iOS 14, *)
23
@available(*, deprecated, renamed: "FormActionButton")
34
public typealias ActionButton = FormActionButton
45

56
@available(*, deprecated, renamed: "FormActionButtonStyle")
67
public typealias ActionButtonStyle = FormActionButtonStyle
8+
#endif

0 commit comments

Comments
 (0)