Skip to content
Snippets Groups Projects
Commit 91824225 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add ExampleAppIcon

parent bee18f2e
No related branches found
No related tags found
1 merge request!1Client management
{
"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
}
......@@ -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>";
......
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
<?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>
<?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>
// 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"),
]
)
]
)
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
)
}
}
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) }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment