Skip to content

Commit f0c7ba4

Browse files
committed
Initial iOS platform support
Make the library compile on iOS
1 parent 46640c3 commit f0c7ba4

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import PackageDescription
55
let package = Package(
66
name: "swiftui-app-icon-creator",
77
platforms: [
8-
.macOS(.v11)
8+
.macOS(.v11),
9+
.iOS(.v13),
910
],
1011
products: [
1112
.library(

Sources/AppIconCreator/IconImage.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if os(macOS)
12
import SwiftUI
23

34
public struct IconImage {
@@ -98,3 +99,4 @@ extension NSImage {
9899
return imageRep.representation(using: .png, properties: [.compressionFactor: 1])!
99100
}
100101
}
102+
#endif

Sources/AppIconCreator/IconPreview.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if os(macOS)
12
import SwiftUI
23

34
public struct IconPreview<Icon: View>: View {
@@ -41,3 +42,4 @@ public struct IconPreview<Icon: View>: View {
4142
}
4243
}
4344
}
45+
#endif

Sources/AppIconCreator/IconPreviews.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if os(macOS)
12
import SwiftUI
23

34
public struct IconPreviews<Icon: View>: View {
@@ -20,3 +21,4 @@ public struct IconPreviews<Icon: View>: View {
2021
.fixedSize()
2122
}
2223
}
24+
#endif

Sources/AppIconCreator/IconView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ public struct IconView: View, Equatable {
1414

1515
struct IconView_Preivews: PreviewProvider {
1616
static var previews: some View {
17+
#if os(macOS)
1718
IconPreviews(
1819
icon: IconView(),
1920
configs: .iOS
2021
)
22+
#endif
2123
}
2224
}

0 commit comments

Comments
 (0)