diff --git a/ElixxirDAppsSDK.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElixxirDAppsSDK.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000000000000000000000000000000000..e43a69cb6c559e10fbf522010ed8be3cdd70ad3c --- /dev/null +++ b/ElixxirDAppsSDK.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "swiftui-app-icon-creator", + "kind" : "remoteSourceControl", + "location" : "https://github.com/darrarski/swiftui-app-icon-creator.git", + "state" : { + "revision" : "f0c7ba4e66d3dc8135ccf9146afc05f9dff3c4ff", + "version" : "1.2.0" + } + } + ], + "version" : 2 +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 2100aa97ca77c2d763d05fb98707ddfe74265160..d8f0c3c630fed6827584b1e3940ce0a36c6e0e55 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 312C371B28475E62003E9E39 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; 312C371D28475E63003E9E39 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 312C3728284761DC003E9E39 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 31B3342F2847669900865D82 /* ExampleAppIcon */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = ExampleAppIcon; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -38,6 +39,7 @@ children = ( 312C371828475E62003E9E39 /* ExampleApp */, 312C3727284761C7003E9E39 /* ExampleApp (iOS) */, + 31B3342F2847669900865D82 /* ExampleAppIcon */, 312C371728475E62003E9E39 /* Products */, ); sourceTree = "<group>"; diff --git a/Example/ExampleAppIcon/.gitignore b/Example/ExampleAppIcon/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3b29812086f28a2b21884e57ead495ffd9434178 --- /dev/null +++ b/Example/ExampleAppIcon/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/ExampleAppIcon.xcscheme b/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/ExampleAppIcon.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..577a588463331de08076d97e67d30ddfa7eb6e70 --- /dev/null +++ b/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/ExampleAppIcon.xcscheme @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1330" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ExampleAppIcon" + BuildableName = "ExampleAppIcon" + BlueprintName = "ExampleAppIcon" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ExampleAppIcon" + BuildableName = "ExampleAppIcon" + BlueprintName = "ExampleAppIcon" + ReferencedContainer = "container:"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/example-app-icon-export.xcscheme b/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/example-app-icon-export.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..e903b8e44600283e207b4b588d9799cbd1a78f8e --- /dev/null +++ b/Example/ExampleAppIcon/.swiftpm/xcode/xcshareddata/xcschemes/example-app-icon-export.xcscheme @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1330" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "example-app-icon-export" + BuildableName = "example-app-icon-export" + BlueprintName = "example-app-icon-export" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "example-app-icon-export" + BuildableName = "example-app-icon-export" + BlueprintName = "example-app-icon-export" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildableProductRunnable> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "example-app-icon-export" + BuildableName = "example-app-icon-export" + BlueprintName = "example-app-icon-export" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Example/ExampleAppIcon/Package.swift b/Example/ExampleAppIcon/Package.swift new file mode 100644 index 0000000000000000000000000000000000000000..d7a9c8bdd343f98a34609faa7f18f473c534833f --- /dev/null +++ b/Example/ExampleAppIcon/Package.swift @@ -0,0 +1,42 @@ +// swift-tools-version: 5.6 +import PackageDescription + +let package = Package( + name: "example-app-icon", + platforms: [ + .macOS(.v12), + ], + products: [ + .library( + name: "ExampleAppIcon", + targets: ["ExampleAppIcon"] + ), + .executable( + name: "example-app-icon-export", + targets: ["ExampleAppIconExport"] + ), + ], + dependencies: [ + .package( + url: "https://github.com/darrarski/swiftui-app-icon-creator.git", + .upToNextMajor(from: "1.2.0") + ), + ], + targets: [ + .target( + name: "ExampleAppIcon", + dependencies: [ + .product( + name: "AppIconCreator", + package: "swiftui-app-icon-creator" + ), + ] + ), + .executableTarget( + name: "ExampleAppIconExport", + dependencies: [ + .target(name: "ExampleAppIcon"), + ] + ) + ] +) diff --git a/Example/ExampleAppIcon/Sources/ExampleAppIcon/ExampleAppIcon.swift b/Example/ExampleAppIcon/Sources/ExampleAppIcon/ExampleAppIcon.swift new file mode 100644 index 0000000000000000000000000000000000000000..0c24ca0094213d7c58dc5b02361b6bc45cbf96a1 --- /dev/null +++ b/Example/ExampleAppIcon/Sources/ExampleAppIcon/ExampleAppIcon.swift @@ -0,0 +1,73 @@ +import SwiftUI +import AppIconCreator + +public struct ExampleAppIconView: View { + public init() {} + + public var body: some View { + GeometryReader { geometry in + ZStack { + Image(systemName: "cube.transparent") + .resizable() + .scaledToFit() + .foregroundColor(.black.opacity(0.2)) + .padding(geometry.size.width * 0.1) + .mask( + ZStack { + Rectangle() + + Image(systemName: "cube") + .resizable() + .scaledToFit() + .blendMode(.destinationOut) + .padding(geometry.size.width * 0.1) + + Circle() + .blendMode(.destinationOut) + .padding(geometry.size.width * 0.24) + } + ) + + Circle() + .fill(.black.opacity(0.3)) + .padding(geometry.size.width * 0.3) + .mask { + ZStack { + Rectangle() + Image(systemName: "cube") + .resizable() + .scaledToFit() + .blendMode(.destinationOut) + .padding(geometry.size.width * 0.1) + } + } + + Image(systemName: "cube") + .resizable() + .scaledToFit() + .foregroundColor(.black.opacity(0.5)) + .padding(geometry.size.width * 0.1) + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background { + LinearGradient( + gradient: Gradient(colors: [ + Color(cgColor: CGColor(red: 0.49, green: 0.94, blue: 0.94, alpha: 1)), + Color(cgColor: CGColor(red: 0.16, green: 0.81, blue: 0.86, alpha: 1)), + ]), + startPoint: .top, + endPoint: .bottom + ) + } + } + } +} + +struct ExampleAppIconView_Previews: PreviewProvider { + static var previews: some View { + IconPreviews( + icon: ExampleAppIconView(), + configs: .iOS + ) + } +} diff --git a/Example/ExampleAppIcon/Sources/ExampleAppIconExport/main.swift b/Example/ExampleAppIcon/Sources/ExampleAppIconExport/main.swift new file mode 100644 index 0000000000000000000000000000000000000000..8716d9685176e228b8906f78351f2b27b732ef5b --- /dev/null +++ b/Example/ExampleAppIcon/Sources/ExampleAppIconExport/main.swift @@ -0,0 +1,24 @@ +import AppIconCreator +import ExampleAppIcon +import Foundation + +extension URL { + func deletingLastPathComponent() -> URL { + var url = self + url.deleteLastPathComponent() + return url + } +} + +let exportURL = URL(fileURLWithPath: #file) + .deletingLastPathComponent() + .deletingLastPathComponent() + .deletingLastPathComponent() + .deletingLastPathComponent() + .appendingPathComponent("ExampleApp") + .appendingPathComponent("Assets.xcassets") + .appendingPathComponent("AppIcon.appiconset") + +[IconImage] + .images(for: ExampleAppIconView(), with: .iOS) + .forEach { $0.save(to: exportURL) }