├── assets └── screenshot1.png ├── SwiftUI-Metal-Starting-Point ├── Assets.xcassets │ ├── Contents.json │ ├── AccentColor.colorset │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Shader_App.swift ├── TestViews │ ├── TestLayerEffect.metal │ ├── TestColorEffect.metal │ ├── TestDistortionEffect.metal │ ├── ColorEffectView.swift │ ├── LayerEffectView.swift │ └── DistortionEffectView.swift ├── ContentView.swift └── ExampleContent.swift ├── SwiftUI-Metal-Starting-Point.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── megabits.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── project.pbxproj ├── LICENSE └── README.md /assets/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megabitsenmzq/SwiftUI-Metal-Starting-Point/HEAD/assets/screenshot1.png -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/Shader_App.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Shader_TestApp.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/06/04. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Shader_TestApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/TestLayerEffect.metal: -------------------------------------------------------------------------------- 1 | // 2 | // TestLayerEffect.metal 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/11/30. 6 | // 7 | 8 | #include 9 | #include 10 | using namespace metal; 11 | 12 | [[ stitchable ]] half4 testLayerEffect(float2 position, SwiftUI::Layer layer, float4 bounds, float time) { 13 | 14 | // Example 15 | float2 a = 1 / ((sin(time) + 2) / 3); 16 | return layer.sample(fmod(position * a, bounds.zw)); 17 | } 18 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/TestColorEffect.metal: -------------------------------------------------------------------------------- 1 | // 2 | // TestColorEffect.metal 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/06/04. 6 | // 7 | 8 | #include 9 | using namespace metal; 10 | 11 | [[ stitchable ]] half4 testColorEffect(float2 position, half4 color, float4 bounds, float time) { 12 | 13 | // Example 14 | float2 positionInSize = position/bounds.zw; 15 | half a = smoothstep(1.0, 0.0, positionInSize.y * sin(time)); 16 | return color * a; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/TestDistortionEffect.metal: -------------------------------------------------------------------------------- 1 | // 2 | // TestDistortionEffect.metal 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/11/30. 6 | // 7 | 8 | #include 9 | using namespace metal; 10 | 11 | [[ stitchable ]] float2 testDistortionEffect(float2 position, float4 bounds, float time) { 12 | 13 | // Example 14 | float2 positionInSize = position / bounds.zw; 15 | float size = sin(time) * 100; 16 | return float2(position.x + positionInSize.y * size, position.y + positionInSize.x * size); 17 | } 18 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/06/04. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | @State var startDate = Date() 12 | var body: some View { 13 | TabView { 14 | ColorEffectView() 15 | .tabItem({ Label("Color", systemImage: "paintpalette") }) 16 | DistortionEffectView() 17 | .tabItem({ Label("Distortion", systemImage: "water.waves") }) 18 | LayerEffectView() 19 | .tabItem({ Label("Layer", systemImage: "square.2.layers.3d") }) 20 | } 21 | } 22 | } 23 | 24 | #Preview { 25 | ContentView() 26 | } 27 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point.xcodeproj/xcuserdata/megabits.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Shader Test.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | SwiftUI-Metal-Starting-Point.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | SwiftUI-Metal-Templates.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 0 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/ColorEffectView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorEffectView.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/11/30. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ColorEffectView: View { 11 | @State var startDate = Date() 12 | var body: some View { 13 | TimelineView(.animation) { timeline in 14 | let time = startDate.distance(to: timeline.date) 15 | 16 | ExampleContent() 17 | .colorEffect( 18 | ShaderLibrary.testColorEffect( 19 | .boundingRect, 20 | .float(time) 21 | ) 22 | ) 23 | .clipped() 24 | } 25 | } 26 | } 27 | 28 | #Preview { 29 | ColorEffectView() 30 | } 31 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/LayerEffectView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LayerEffectView.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/11/30. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct LayerEffectView: View { 11 | @State var startDate = Date() 12 | 13 | var body: some View { 14 | TimelineView(.animation) { timeline in 15 | let time = startDate.distance(to: timeline.date) 16 | ExampleContent() 17 | .layerEffect( 18 | ShaderLibrary.testLayerEffect( 19 | .boundingRect, 20 | .float(time) 21 | ), 22 | maxSampleOffset: .init(width: 800, height: 800) 23 | ) 24 | .clipped() 25 | } 26 | } 27 | } 28 | 29 | #Preview { 30 | LayerEffectView() 31 | } 32 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/TestViews/DistortionEffectView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DistortionEffectView.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/11/30. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct DistortionEffectView: View { 11 | @State var startDate = Date() 12 | 13 | var body: some View { 14 | TimelineView(.animation) { timeline in 15 | let time = startDate.distance(to: timeline.date) 16 | ExampleContent() 17 | .distortionEffect( 18 | ShaderLibrary.testDistortionEffect( 19 | .boundingRect, 20 | .float(time) 21 | ), maxSampleOffset: .init(width: 800, height: 800) 22 | ) 23 | .clipped() 24 | } 25 | } 26 | } 27 | 28 | #Preview { 29 | DistortionEffectView() 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Jinyu Meng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI Metal Shader Starting Point 2 | A template to kick start your SwiftUI Metal project. 3 | 4 | ![screenshot1](assets/screenshot1.png) 5 | 6 | This project aims to create an easy starting point for you to create your own Metal shader to use with SwiftUI. 7 | 8 | It includes examples of the three main ways to use Shader with SwiftUI. You can learn the basics of shaders in SwiftUI from this project or experiment with your shaders. 9 | 10 | While using this project, you can split the window with the view on one side and the shader on the other. After you modify the shader, you can click the view once to let it update the preview. Xcode won't update the preview if you only doing stuff in the shader part. 11 | 12 | ## This setup provides: 13 | 14 | - Example graphics content: A material for you to preview the results. 15 | - TimeLineView: Use to create animated shaders. 16 | - Bounding box: A bounding box parameter is passed to shaders. 17 | 18 | ## The three SwiftUI shader APIs: 19 | 20 | - ColorEffect: Use to modify the color of specific pixels. Should return half4(r, g, b, a), the new color of the pixel. 21 | - DistortionEffect: Use to move specific pixels. Should return float2(x, y), the new absolute position of the pixel. 22 | - LayerEffect: Use to sample on any position of the layer to get its color as the new color of the pixel. Use `layer.sample(float2 position);` to sample on position. Should return half4(r, g, b, a), the new color of the pixel. 23 | 24 | Combining these APIs, you can create stunning graphics in your SwiftUI view without the complex setup of Metal. 25 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point/ExampleContent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleContent.swift 3 | // SwiftUI-Metal-Starting-Point 4 | // 5 | // Created by Jinyu Meng on 2024/12/01. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ExampleContent: View { 11 | 12 | struct Triangle: Shape { 13 | func path(in rect: CGRect) -> Path { 14 | Path { path in 15 | path.move(to: CGPoint(x: rect.midX, y: rect.minY)) 16 | path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY)) 17 | path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY)) 18 | path.addLine(to: CGPoint(x: rect.midX, y: rect.minY)) 19 | } 20 | } 21 | } 22 | 23 | var body: some View { 24 | ZStack { 25 | Rectangle() 26 | .fill(Color.red) 27 | Rectangle() 28 | .fill(Color.green) 29 | .padding(50) 30 | .offset(x: 30) 31 | Rectangle() 32 | .fill(Color.blue) 33 | .padding(100) 34 | .offset(x: 40) 35 | Rectangle() 36 | .fill(Color.white) 37 | .padding(150) 38 | .offset(x: 50) 39 | Triangle() 40 | .foregroundStyle(.indigo) 41 | .opacity(0.3) 42 | .padding(20) 43 | VStack(spacing: 50) { 44 | Circle() 45 | .fill(Color.yellow) 46 | .frame(width: 150, height: 150) 47 | Circle() 48 | .fill(Color.mint) 49 | .frame(width: 100, height: 100) 50 | Circle() 51 | .fill(Color.pink) 52 | .frame(width: 50, height: 50) 53 | } 54 | } 55 | } 56 | } 57 | 58 | 59 | #Preview { 60 | ExampleContent() 61 | } 62 | -------------------------------------------------------------------------------- /SwiftUI-Metal-Starting-Point.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 70; 7 | objects = { 8 | 9 | /* Begin PBXFileReference section */ 10 | C07630602C0F53E200275D74 /* SwiftUI-Metal-Starting-Point.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI-Metal-Starting-Point.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 11 | /* End PBXFileReference section */ 12 | 13 | /* Begin PBXFileSystemSynchronizedRootGroup section */ 14 | C091C62F2CFAF50B00E52770 /* SwiftUI-Metal-Starting-Point */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = "SwiftUI-Metal-Starting-Point"; sourceTree = ""; }; 15 | /* End PBXFileSystemSynchronizedRootGroup section */ 16 | 17 | /* Begin PBXFrameworksBuildPhase section */ 18 | C076305D2C0F53E200275D74 /* Frameworks */ = { 19 | isa = PBXFrameworksBuildPhase; 20 | buildActionMask = 2147483647; 21 | files = ( 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXFrameworksBuildPhase section */ 26 | 27 | /* Begin PBXGroup section */ 28 | C07630572C0F53E200275D74 = { 29 | isa = PBXGroup; 30 | children = ( 31 | C091C62F2CFAF50B00E52770 /* SwiftUI-Metal-Starting-Point */, 32 | C07630612C0F53E200275D74 /* Products */, 33 | ); 34 | sourceTree = ""; 35 | }; 36 | C07630612C0F53E200275D74 /* Products */ = { 37 | isa = PBXGroup; 38 | children = ( 39 | C07630602C0F53E200275D74 /* SwiftUI-Metal-Starting-Point.app */, 40 | ); 41 | name = Products; 42 | sourceTree = ""; 43 | }; 44 | /* End PBXGroup section */ 45 | 46 | /* Begin PBXNativeTarget section */ 47 | C076305F2C0F53E200275D74 /* SwiftUI-Metal-Starting-Point */ = { 48 | isa = PBXNativeTarget; 49 | buildConfigurationList = C076306E2C0F53E300275D74 /* Build configuration list for PBXNativeTarget "SwiftUI-Metal-Starting-Point" */; 50 | buildPhases = ( 51 | C076305C2C0F53E200275D74 /* Sources */, 52 | C076305D2C0F53E200275D74 /* Frameworks */, 53 | C076305E2C0F53E200275D74 /* Resources */, 54 | ); 55 | buildRules = ( 56 | ); 57 | dependencies = ( 58 | ); 59 | fileSystemSynchronizedGroups = ( 60 | C091C62F2CFAF50B00E52770 /* SwiftUI-Metal-Starting-Point */, 61 | ); 62 | name = "SwiftUI-Metal-Starting-Point"; 63 | productName = "Shader Test"; 64 | productReference = C07630602C0F53E200275D74 /* SwiftUI-Metal-Starting-Point.app */; 65 | productType = "com.apple.product-type.application"; 66 | }; 67 | /* End PBXNativeTarget section */ 68 | 69 | /* Begin PBXProject section */ 70 | C07630582C0F53E200275D74 /* Project object */ = { 71 | isa = PBXProject; 72 | attributes = { 73 | BuildIndependentTargetsInParallel = 1; 74 | LastSwiftUpdateCheck = 1540; 75 | LastUpgradeCheck = 1540; 76 | TargetAttributes = { 77 | C076305F2C0F53E200275D74 = { 78 | CreatedOnToolsVersion = 15.4; 79 | }; 80 | }; 81 | }; 82 | buildConfigurationList = C076305B2C0F53E200275D74 /* Build configuration list for PBXProject "SwiftUI-Metal-Starting-Point" */; 83 | compatibilityVersion = "Xcode 14.0"; 84 | developmentRegion = en; 85 | hasScannedForEncodings = 0; 86 | knownRegions = ( 87 | en, 88 | Base, 89 | ); 90 | mainGroup = C07630572C0F53E200275D74; 91 | productRefGroup = C07630612C0F53E200275D74 /* Products */; 92 | projectDirPath = ""; 93 | projectRoot = ""; 94 | targets = ( 95 | C076305F2C0F53E200275D74 /* SwiftUI-Metal-Starting-Point */, 96 | ); 97 | }; 98 | /* End PBXProject section */ 99 | 100 | /* Begin PBXResourcesBuildPhase section */ 101 | C076305E2C0F53E200275D74 /* Resources */ = { 102 | isa = PBXResourcesBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXResourcesBuildPhase section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | C076305C2C0F53E200275D74 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | ); 116 | runOnlyForDeploymentPostprocessing = 0; 117 | }; 118 | /* End PBXSourcesBuildPhase section */ 119 | 120 | /* Begin XCBuildConfiguration section */ 121 | C076306C2C0F53E300275D74 /* Debug */ = { 122 | isa = XCBuildConfiguration; 123 | buildSettings = { 124 | ALWAYS_SEARCH_USER_PATHS = NO; 125 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 126 | CLANG_ANALYZER_NONNULL = YES; 127 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 128 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 129 | CLANG_ENABLE_MODULES = YES; 130 | CLANG_ENABLE_OBJC_ARC = YES; 131 | CLANG_ENABLE_OBJC_WEAK = YES; 132 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 133 | CLANG_WARN_BOOL_CONVERSION = YES; 134 | CLANG_WARN_COMMA = YES; 135 | CLANG_WARN_CONSTANT_CONVERSION = YES; 136 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 137 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 138 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 139 | CLANG_WARN_EMPTY_BODY = YES; 140 | CLANG_WARN_ENUM_CONVERSION = YES; 141 | CLANG_WARN_INFINITE_RECURSION = YES; 142 | CLANG_WARN_INT_CONVERSION = YES; 143 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 144 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 145 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 146 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 147 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 148 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 149 | CLANG_WARN_STRICT_PROTOTYPES = YES; 150 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 151 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 152 | CLANG_WARN_UNREACHABLE_CODE = YES; 153 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 154 | COPY_PHASE_STRIP = NO; 155 | DEBUG_INFORMATION_FORMAT = dwarf; 156 | ENABLE_STRICT_OBJC_MSGSEND = YES; 157 | ENABLE_TESTABILITY = YES; 158 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 159 | GCC_C_LANGUAGE_STANDARD = gnu17; 160 | GCC_DYNAMIC_NO_PIC = NO; 161 | GCC_NO_COMMON_BLOCKS = YES; 162 | GCC_OPTIMIZATION_LEVEL = 0; 163 | GCC_PREPROCESSOR_DEFINITIONS = ( 164 | "DEBUG=1", 165 | "$(inherited)", 166 | ); 167 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 168 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 169 | GCC_WARN_UNDECLARED_SELECTOR = YES; 170 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 171 | GCC_WARN_UNUSED_FUNCTION = YES; 172 | GCC_WARN_UNUSED_VARIABLE = YES; 173 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 174 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 175 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 176 | MTL_FAST_MATH = YES; 177 | ONLY_ACTIVE_ARCH = YES; 178 | SDKROOT = iphoneos; 179 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 180 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 181 | }; 182 | name = Debug; 183 | }; 184 | C076306D2C0F53E300275D74 /* Release */ = { 185 | isa = XCBuildConfiguration; 186 | buildSettings = { 187 | ALWAYS_SEARCH_USER_PATHS = NO; 188 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 189 | CLANG_ANALYZER_NONNULL = YES; 190 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 191 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 192 | CLANG_ENABLE_MODULES = YES; 193 | CLANG_ENABLE_OBJC_ARC = YES; 194 | CLANG_ENABLE_OBJC_WEAK = YES; 195 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 196 | CLANG_WARN_BOOL_CONVERSION = YES; 197 | CLANG_WARN_COMMA = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 201 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 202 | CLANG_WARN_EMPTY_BODY = YES; 203 | CLANG_WARN_ENUM_CONVERSION = YES; 204 | CLANG_WARN_INFINITE_RECURSION = YES; 205 | CLANG_WARN_INT_CONVERSION = YES; 206 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 207 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 208 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 209 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 210 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 211 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 212 | CLANG_WARN_STRICT_PROTOTYPES = YES; 213 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 214 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 215 | CLANG_WARN_UNREACHABLE_CODE = YES; 216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 217 | COPY_PHASE_STRIP = NO; 218 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 219 | ENABLE_NS_ASSERTIONS = NO; 220 | ENABLE_STRICT_OBJC_MSGSEND = YES; 221 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 222 | GCC_C_LANGUAGE_STANDARD = gnu17; 223 | GCC_NO_COMMON_BLOCKS = YES; 224 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 225 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 226 | GCC_WARN_UNDECLARED_SELECTOR = YES; 227 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 228 | GCC_WARN_UNUSED_FUNCTION = YES; 229 | GCC_WARN_UNUSED_VARIABLE = YES; 230 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 231 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 232 | MTL_ENABLE_DEBUG_INFO = NO; 233 | MTL_FAST_MATH = YES; 234 | SDKROOT = iphoneos; 235 | SWIFT_COMPILATION_MODE = wholemodule; 236 | VALIDATE_PRODUCT = YES; 237 | }; 238 | name = Release; 239 | }; 240 | C076306F2C0F53E300275D74 /* Debug */ = { 241 | isa = XCBuildConfiguration; 242 | buildSettings = { 243 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 244 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 245 | CODE_SIGN_STYLE = Automatic; 246 | CURRENT_PROJECT_VERSION = 1; 247 | DEVELOPMENT_ASSET_PATHS = ""; 248 | DEVELOPMENT_TEAM = QJN4A73F8D; 249 | ENABLE_PREVIEWS = YES; 250 | GENERATE_INFOPLIST_FILE = YES; 251 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 252 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 253 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 254 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 255 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 256 | IPHONEOS_DEPLOYMENT_TARGET = 17.0; 257 | LD_RUNPATH_SEARCH_PATHS = ( 258 | "$(inherited)", 259 | "@executable_path/Frameworks", 260 | ); 261 | MARKETING_VERSION = 1.0; 262 | PRODUCT_BUNDLE_IDENTIFIER = "com.JinyuMeng.SwiftUI-Metal-Starting-Point"; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | SWIFT_EMIT_LOC_STRINGS = YES; 265 | SWIFT_VERSION = 5.0; 266 | TARGETED_DEVICE_FAMILY = "1,2"; 267 | }; 268 | name = Debug; 269 | }; 270 | C07630702C0F53E300275D74 /* Release */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 275 | CODE_SIGN_STYLE = Automatic; 276 | CURRENT_PROJECT_VERSION = 1; 277 | DEVELOPMENT_ASSET_PATHS = ""; 278 | DEVELOPMENT_TEAM = QJN4A73F8D; 279 | ENABLE_PREVIEWS = YES; 280 | GENERATE_INFOPLIST_FILE = YES; 281 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 282 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 283 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 284 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 285 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 286 | IPHONEOS_DEPLOYMENT_TARGET = 17.0; 287 | LD_RUNPATH_SEARCH_PATHS = ( 288 | "$(inherited)", 289 | "@executable_path/Frameworks", 290 | ); 291 | MARKETING_VERSION = 1.0; 292 | PRODUCT_BUNDLE_IDENTIFIER = "com.JinyuMeng.SwiftUI-Metal-Starting-Point"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_EMIT_LOC_STRINGS = YES; 295 | SWIFT_VERSION = 5.0; 296 | TARGETED_DEVICE_FAMILY = "1,2"; 297 | }; 298 | name = Release; 299 | }; 300 | /* End XCBuildConfiguration section */ 301 | 302 | /* Begin XCConfigurationList section */ 303 | C076305B2C0F53E200275D74 /* Build configuration list for PBXProject "SwiftUI-Metal-Starting-Point" */ = { 304 | isa = XCConfigurationList; 305 | buildConfigurations = ( 306 | C076306C2C0F53E300275D74 /* Debug */, 307 | C076306D2C0F53E300275D74 /* Release */, 308 | ); 309 | defaultConfigurationIsVisible = 0; 310 | defaultConfigurationName = Release; 311 | }; 312 | C076306E2C0F53E300275D74 /* Build configuration list for PBXNativeTarget "SwiftUI-Metal-Starting-Point" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | C076306F2C0F53E300275D74 /* Debug */, 316 | C07630702C0F53E300275D74 /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | /* End XCConfigurationList section */ 322 | }; 323 | rootObject = C07630582C0F53E200275D74 /* Project object */; 324 | } 325 | --------------------------------------------------------------------------------