Skip to content

Commit

Permalink
Initial iOS platform support
Browse files Browse the repository at this point in the history
Make the library compile on iOS
  • Loading branch information
darrarski committed Dec 22, 2021
1 parent 46640c3 commit f0c7ba4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import PackageDescription
let package = Package(
name: "swiftui-app-icon-creator",
platforms: [
.macOS(.v11)
.macOS(.v11),
.iOS(.v13),
],
products: [
.library(
Expand Down
2 changes: 2 additions & 0 deletions Sources/AppIconCreator/IconImage.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if os(macOS)
import SwiftUI

public struct IconImage {
Expand Down Expand Up @@ -98,3 +99,4 @@ extension NSImage {
return imageRep.representation(using: .png, properties: [.compressionFactor: 1])!
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/AppIconCreator/IconPreview.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if os(macOS)
import SwiftUI

public struct IconPreview<Icon: View>: View {
Expand Down Expand Up @@ -41,3 +42,4 @@ public struct IconPreview<Icon: View>: View {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/AppIconCreator/IconPreviews.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if os(macOS)
import SwiftUI

public struct IconPreviews<Icon: View>: View {
Expand All @@ -20,3 +21,4 @@ public struct IconPreviews<Icon: View>: View {
.fixedSize()
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/AppIconCreator/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public struct IconView: View, Equatable {

struct IconView_Preivews: PreviewProvider {
static var previews: some View {
#if os(macOS)
IconPreviews(
icon: IconView(),
configs: .iOS
)
#endif
}
}

0 comments on commit f0c7ba4

Please sign in to comment.