├── screenshots.png ├── Default-568h@2x.png ├── SwiftUI_Profile_Demo ├── Assets.xcassets │ ├── Contents.json │ ├── profile.imageset │ │ ├── Ip1bBCK4Q8WSRsOo0Ua66g_thumb_167.jpg │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── SwiftUI_Experiment.xcdatamodeld │ ├── .xccurrentversion │ └── SwiftUI_Experiment.xcdatamodel │ │ └── contents ├── colorSlider.swift ├── HeaderBanner.swift ├── Base.lproj │ └── LaunchScreen.storyboard ├── ProfileView.swift ├── UserSettings.swift ├── Info.plist ├── SceneDelegate.swift ├── SettingsView.swift └── AppDelegate.swift ├── SwiftUI_Profile_Demo.xcodeproj ├── xcuserdata │ └── patrickmifsud.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── project.pbxproj ├── SwiftUI_Profile_DemoTests ├── Info.plist └── SwiftUI_ExperimentTests.swift ├── SwiftUI_Profile_DemoUITests ├── Info.plist └── SwiftUI_ExperimentUITests.swift ├── README.md └── LICENSE /screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickmfsd/SwiftUI-Profile-Demo/HEAD/screenshots.png -------------------------------------------------------------------------------- /Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickmfsd/SwiftUI-Profile-Demo/HEAD/Default-568h@2x.png -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Assets.xcassets/profile.imageset/Ip1bBCK4Q8WSRsOo0Ua66g_thumb_167.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickmfsd/SwiftUI-Profile-Demo/HEAD/SwiftUI_Profile_Demo/Assets.xcassets/profile.imageset/Ip1bBCK4Q8WSRsOo0Ua66g_thumb_167.jpg -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo.xcodeproj/xcuserdata/patrickmifsud.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/SwiftUI_Experiment.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/SwiftUI_Experiment.xcdatamodeld/SwiftUI_Experiment.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Assets.xcassets/profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Ip1bBCK4Q8WSRsOo0Ua66g_thumb_167.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo.xcodeproj/xcuserdata/patrickmifsud.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwiftUI_Experiment.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | SwiftUI_Profile_Demo.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/colorSlider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // colorSlider.swift 3 | // SwiftUI_Experiment 4 | // 5 | // Created by Patrick Mifsud on 13/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct colorSlider: View { 12 | @Binding var value: Double 13 | var textColor: Color 14 | 15 | var body: some View { 16 | HStack { 17 | Text(verbatim: "0") 18 | .foregroundColor(textColor) 19 | Slider(value: $value, in: 0.0...1.0) 20 | Text(verbatim: "255") 21 | .foregroundColor(textColor) 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SwiftUI_Profile_DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SwiftUI_Profile_DemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/HeaderBanner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderProfileView.swift 3 | // SwiftUI_Experiment 4 | // 5 | // Created by Patrick Mifsud on 13/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct Header: View { 12 | @AppStorage("rValue") var rValue = DefaultSettings.rValue 13 | @AppStorage("gValue") var gValue = DefaultSettings.gValue 14 | @AppStorage("bValue") var bValue = DefaultSettings.bValue 15 | 16 | var body: some View { 17 | ZStack(alignment: .top) { 18 | Rectangle() 19 | .foregroundColor(Color(red: rValue, green: gValue, blue: bValue, opacity: 1.0)) 20 | .edgesIgnoringSafeArea(.top) 21 | .frame(height: 100) 22 | Image("profile") 23 | .clipShape(Circle()) 24 | .overlay(Circle().stroke(Color.white, lineWidth: 4)) 25 | .shadow(radius: 10) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI Profile Demo 2 | 3 | ![Screenshot](https://github.com/patrickmfsd/SwiftUI-Profile-Demo/blob/dev/screenshots.png) 4 | 5 | ## About 6 | This basic application demos using SwiftUI to create a User Profile. The app features the following: 7 | 8 | - Settings Page that appears as a `.sheet(...)` Modal. 9 | - RGB Sliders to adjust header background 10 | - `@AppStorage` is used to store RGB Slider values and String values for Profile Text. 11 | 12 | ## Change Log 13 | ### v1 14 | - RGB Sliders to adjust header background 15 | - Make Settings Page that appears as a Modal 16 | 17 | ### v2 18 | - Editable Name and Subtitle fields 19 | - Editable Description fields 20 | 21 | ## Todo 22 | - [ ] Implement Image Picker for Profile Image 23 | 24 | ## Requirements 25 | - Xcode 12+ 26 | - Swift 5.1+ 27 | - iPhone running iOS 14+ 28 | 29 | ## How To Use 30 | ⚠️ *This app is not available on the App Store.* 31 | 32 | 1. Clone or download the project to your local machine 33 | 2. Open the project in Xcode 34 | 3. Run in Xcode Simulator or on a iPhone running iOS 13 or newer. 35 | -------------------------------------------------------------------------------- /SwiftUI_Profile_DemoTests/SwiftUI_ExperimentTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUI_ExperimentTests.swift 3 | // SwiftUI_ExperimentTests 4 | // 5 | // Created by Patrick Mifsud on 4/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SwiftUI_Experiment 11 | 12 | class SwiftUI_ExperimentTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Patrick Mifsud 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 | -------------------------------------------------------------------------------- /SwiftUI_Profile_DemoUITests/SwiftUI_ExperimentUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUI_ExperimentUITests.swift 3 | // SwiftUI_ExperimentUITests 4 | // 5 | // Created by Patrick Mifsud on 4/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SwiftUI_ExperimentUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 20 | XCUIApplication().launch() 21 | 22 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 23 | } 24 | 25 | override func tearDown() { 26 | // Put teardown code here. This method is called after the invocation of each test method in the class. 27 | } 28 | 29 | func testExample() { 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/ProfileView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI_Experiment 4 | // 5 | // Created by Patrick Mifsud on 4/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ProfileView: View { 12 | @State var isPresented = false 13 | 14 | var body: some View { 15 | VStack { 16 | VStack { 17 | Header() 18 | ProfileText() 19 | } 20 | Spacer() 21 | Button ( 22 | action: { self.isPresented = true }, 23 | label: { 24 | Label("Edit", systemImage: "pencil") 25 | }) 26 | .sheet(isPresented: $isPresented, content: { 27 | SettingsView() 28 | }) 29 | } 30 | } 31 | } 32 | 33 | struct ProfileText: View { 34 | @AppStorage("name") var name = DefaultSettings.name 35 | @AppStorage("subtitle") var subtitle = DefaultSettings.subtitle 36 | @AppStorage("description") var description = DefaultSettings.description 37 | 38 | var body: some View { 39 | VStack(spacing: 15) { 40 | VStack(spacing: 5) { 41 | Text(name) 42 | .bold() 43 | .font(.title) 44 | Text(subtitle) 45 | .font(.body) 46 | .foregroundColor(.secondary) 47 | }.padding() 48 | Text(description) 49 | .multilineTextAlignment(.center) 50 | .padding() 51 | Spacer() 52 | } 53 | } 54 | } 55 | 56 | #if DEBUG 57 | struct ContentView_Previews : PreviewProvider { 58 | static var previews: some View { 59 | ProfileView() 60 | } 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/UserSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserSettings.swift 3 | // UserSettings 4 | // 5 | // Created by Patrick Mifsud on 25/8/21. 6 | // Copyright © 2021 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftUI 11 | 12 | enum DefaultSettings { 13 | // Color Slider Values 14 | static var rValue: Double = 150.0 15 | static var gValue: Double = 150.0 16 | static var bValue: Double = 150.0 17 | 18 | // Profile 19 | static var name: String = "Johny Appleseed" 20 | static var subtitle: String = "Developer" 21 | static var description: String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Non arcu risus quis varius quam. Faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Ornare suspendisse sed nisi lacus sed viverra tellus. Arcu odio ut sem nulla pharetra. Vitae congue mauris rhoncus aenean vel elit. Scelerisque eu ultrices vitae auctor eu." 22 | } 23 | 24 | //final class UserOptions { 25 | // var colorArray = [ 26 | // ColorSetting(id: 0, name: "Yellow", color: .yellow), 27 | // ColorSetting(id: 1, name: "Orange", color: .orange), 28 | // ColorSetting(id: 2, name: "Red", color: .red), 29 | // ColorSetting(id: 3, name: "Mint", color: .mint), 30 | // ColorSetting(id: 4, name: "Teal", color: .teal), 31 | // ColorSetting(id: 5, name: "Cyan", color: .cyan), 32 | // ColorSetting(id: 6, name: "Blue", color: .blue), 33 | // ColorSetting(id: 7, name: "Purple", color: .purple), 34 | // ColorSetting(id: 8, name: "Indigo", color: .indigo), 35 | // ColorSetting(id: 9, name: "Brown", color: .brown), 36 | // ColorSetting(id: 10, name: "Green", color: .green) 37 | // ] 38 | //} 39 | // 40 | //struct ColorSetting:Identifiable { 41 | // var id: Int 42 | // var name: String 43 | // var color: Color 44 | //} 45 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UISceneConfigurationName 35 | Default Configuration 36 | UISceneDelegateClassName 37 | $(PRODUCT_MODULE_NAME).SceneDelegate 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftUI_Experiment 4 | // 5 | // Created by Patrick Mifsud on 4/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Use a UIHostingController as window root view controller 23 | if let windowScene = scene as? UIWindowScene { 24 | let window = UIWindow(windowScene: windowScene) 25 | window.rootViewController = UIHostingController(rootView: ProfileView()) 26 | self.window = window 27 | window.makeKeyAndVisible() 28 | } 29 | } 30 | 31 | func sceneDidDisconnect(_ scene: UIScene) { 32 | // Called as the scene is being released by the system. 33 | // This occurs shortly after the scene enters the background, or when its session is discarded. 34 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 35 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 36 | } 37 | 38 | func sceneDidBecomeActive(_ scene: UIScene) { 39 | // Called when the scene has moved from an inactive state to an active state. 40 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 41 | } 42 | 43 | func sceneWillResignActive(_ scene: UIScene) { 44 | // Called when the scene will move from an active state to an inactive state. 45 | // This may occur due to temporary interruptions (ex. an incoming phone call). 46 | } 47 | 48 | func sceneWillEnterForeground(_ scene: UIScene) { 49 | // Called as the scene transitions from the background to the foreground. 50 | // Use this method to undo the changes made on entering the background. 51 | } 52 | 53 | func sceneDidEnterBackground(_ scene: UIScene) { 54 | // Called as the scene transitions from the foreground to the background. 55 | // Use this method to save data, release shared resources, and store enough scene-specific state information 56 | // to restore the scene back to its current state. 57 | 58 | // Save changes in the application's managed object context when the application transitions to the background. 59 | (UIApplication.shared.delegate as? AppDelegate)?.saveContext() 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/SettingsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsView.swift 3 | // SettingsView 4 | // 5 | // Created by Patrick Mifsud on 25/8/21. 6 | // Copyright © 2021 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SettingsView: View { 12 | @Environment(\.presentationMode) var presentationMode 13 | 14 | var body: some View { 15 | NavigationView { 16 | Form { 17 | HeaderBackgroundSliders() 18 | ProfileSettings() 19 | } 20 | .navigationBarTitle(Text("Settings")) 21 | .navigationBarItems( 22 | trailing: 23 | Button ( 24 | action: { 25 | self.presentationMode.wrappedValue.dismiss() 26 | }, 27 | label: { 28 | Text("Done") 29 | } 30 | ) 31 | ) 32 | } 33 | } 34 | } 35 | struct ProfileSettings: View { 36 | @AppStorage("name") var name = DefaultSettings.name 37 | @AppStorage("subtitle") var subtitle = DefaultSettings.subtitle 38 | @AppStorage("description") var description = DefaultSettings.description 39 | 40 | var body: some View { 41 | Section(header: Text("Profile")) { 42 | Button ( 43 | action: { 44 | // Action 45 | }, 46 | label: { 47 | Text("Pick Profile Image") 48 | } 49 | ) 50 | TextField("Name", text: $name) 51 | TextField("Subtitle", text: $subtitle) 52 | TextEditor(text: $description) 53 | } 54 | } 55 | } 56 | 57 | struct HeaderBackgroundSliders: View { 58 | @AppStorage("rValue") var rValue = DefaultSettings.rValue 59 | @AppStorage("gValue") var gValue = DefaultSettings.gValue 60 | @AppStorage("bValue") var bValue = DefaultSettings.bValue 61 | 62 | var body: some View { 63 | Section(header: Text("Header Background Color")) { 64 | HStack { 65 | VStack { 66 | RoundedRectangle(cornerRadius: 5) 67 | .frame(width: 100) 68 | .foregroundColor(Color(red: rValue, green: gValue, blue: bValue, opacity: 1.0)) 69 | } 70 | // VStack { 71 | // Text("R: \(Int(rValue * 255.0))") 72 | // Text("G: \(Int(gValue * 255.0))") 73 | // Text("B: \(Int(bValue * 255.0))") 74 | // } 75 | VStack { 76 | colorSlider(value: $rValue, textColor: .red) 77 | colorSlider(value: $gValue, textColor: .green) 78 | colorSlider(value: $bValue, textColor: .blue) 79 | } 80 | } 81 | } 82 | } 83 | } 84 | 85 | 86 | struct SettingsView_Previews: PreviewProvider { 87 | static var previews: some View { 88 | SettingsView() 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftUI_Experiment 4 | // 5 | // Created by Patrick Mifsud on 4/6/19. 6 | // Copyright © 2019 Patrick Mifsud. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillTerminate(_ application: UIApplication) { 23 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 24 | // Saves changes in the application's managed object context before the application terminates. 25 | self.saveContext() 26 | } 27 | 28 | // MARK: UISceneSession Lifecycle 29 | 30 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 31 | // Called when a new scene session is being created. 32 | // Use this method to select a configuration to create the new scene with. 33 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 34 | } 35 | 36 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 37 | // Called when the user discards a scene session. 38 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 39 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 40 | } 41 | 42 | // MARK: - Core Data stack 43 | 44 | lazy var persistentContainer: NSPersistentContainer = { 45 | /* 46 | The persistent container for the application. This implementation 47 | creates and returns a container, having loaded the store for the 48 | application to it. This property is optional since there are legitimate 49 | error conditions that could cause the creation of the store to fail. 50 | */ 51 | let container = NSPersistentContainer(name: "SwiftUI_Experiment") 52 | container.loadPersistentStores(completionHandler: { (storeDescription, error) in 53 | if let error = error as NSError? { 54 | // Replace this implementation with code to handle the error appropriately. 55 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 56 | 57 | /* 58 | Typical reasons for an error here include: 59 | * The parent directory does not exist, cannot be created, or disallows writing. 60 | * The persistent store is not accessible, due to permissions or data protection when the device is locked. 61 | * The device is out of space. 62 | * The store could not be migrated to the current model version. 63 | Check the error message to determine what the actual problem was. 64 | */ 65 | fatalError("Unresolved error \(error), \(error.userInfo)") 66 | } 67 | }) 68 | return container 69 | }() 70 | 71 | // MARK: - Core Data Saving support 72 | 73 | func saveContext () { 74 | let context = persistentContainer.viewContext 75 | if context.hasChanges { 76 | do { 77 | try context.save() 78 | } catch { 79 | // Replace this implementation with code to handle the error appropriately. 80 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 81 | let nserror = error as NSError 82 | fatalError("Unresolved error \(nserror), \(nserror.userInfo)") 83 | } 84 | } 85 | } 86 | 87 | } 88 | 89 | -------------------------------------------------------------------------------- /SwiftUI_Profile_Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 77CAC0CC26D617FE00A5A058 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77CAC0CB26D617FE00A5A058 /* SettingsView.swift */; }; 11 | 77CAC0CE26D6190B00A5A058 /* UserSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77CAC0CD26D6190B00A5A058 /* UserSettings.swift */; }; 12 | 77E27A8122A624370074B3A7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E27A8022A624370074B3A7 /* AppDelegate.swift */; }; 13 | 77E27A8322A624370074B3A7 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E27A8222A624370074B3A7 /* SceneDelegate.swift */; }; 14 | 77E27A8D22A624390074B3A7 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77E27A8C22A624390074B3A7 /* Preview Assets.xcassets */; }; 15 | 77E27A9022A624390074B3A7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77E27A8E22A624390074B3A7 /* LaunchScreen.storyboard */; }; 16 | 77E8EDED22B1EC5600EBE96C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77E8EDEC22B1EC5600EBE96C /* Assets.xcassets */; }; 17 | 77E8EDEF22B1EE4700EBE96C /* HeaderBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E8EDEE22B1EE4700EBE96C /* HeaderBanner.swift */; }; 18 | 77E8EDF122B1EF0100EBE96C /* colorSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E8EDF022B1EF0100EBE96C /* colorSlider.swift */; }; 19 | CD6673E922B8CD5200ECC116 /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6673E822B8CD5200ECC116 /* ProfileView.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 77CAC0CB26D617FE00A5A058 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 24 | 77CAC0CD26D6190B00A5A058 /* UserSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSettings.swift; sourceTree = ""; }; 25 | 77E27A7D22A624370074B3A7 /* SwiftUI_Profile_Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUI_Profile_Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 77E27A8022A624370074B3A7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | 77E27A8222A624370074B3A7 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 28 | 77E27A8C22A624390074B3A7 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 29 | 77E27A8F22A624390074B3A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 77E27A9122A624390074B3A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 77E27A9A22A624390074B3A7 /* SwiftUI_ExperimentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI_ExperimentTests.swift; sourceTree = ""; }; 32 | 77E27A9C22A624390074B3A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 77E27AA522A624390074B3A7 /* SwiftUI_ExperimentUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI_ExperimentUITests.swift; sourceTree = ""; }; 34 | 77E27AA722A624390074B3A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 77E8EDEC22B1EC5600EBE96C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 36 | 77E8EDEE22B1EE4700EBE96C /* HeaderBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderBanner.swift; sourceTree = ""; }; 37 | 77E8EDF022B1EF0100EBE96C /* colorSlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = colorSlider.swift; sourceTree = ""; }; 38 | CD6673E822B8CD5200ECC116 /* ProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 77E27A7A22A624370074B3A7 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 77D3284A22CF5E0200A8807B /* View */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | CD6673E822B8CD5200ECC116 /* ProfileView.swift */, 56 | 77E8EDEE22B1EE4700EBE96C /* HeaderBanner.swift */, 57 | 77E8EDF022B1EF0100EBE96C /* colorSlider.swift */, 58 | 77CAC0CB26D617FE00A5A058 /* SettingsView.swift */, 59 | 77CAC0CD26D6190B00A5A058 /* UserSettings.swift */, 60 | ); 61 | name = View; 62 | sourceTree = ""; 63 | }; 64 | 77E27A7422A624370074B3A7 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 77E27A7F22A624370074B3A7 /* SwiftUI_Profile_Demo */, 68 | 77E27A9922A624390074B3A7 /* SwiftUI_Profile_DemoTests */, 69 | 77E27AA422A624390074B3A7 /* SwiftUI_Profile_DemoUITests */, 70 | 77E27A7E22A624370074B3A7 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 77E27A7E22A624370074B3A7 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 77E27A7D22A624370074B3A7 /* SwiftUI_Profile_Demo.app */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 77E27A7F22A624370074B3A7 /* SwiftUI_Profile_Demo */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 77E8EDEC22B1EC5600EBE96C /* Assets.xcassets */, 86 | 77E27A8022A624370074B3A7 /* AppDelegate.swift */, 87 | 77E27A8222A624370074B3A7 /* SceneDelegate.swift */, 88 | 77D3284A22CF5E0200A8807B /* View */, 89 | 77E27A8E22A624390074B3A7 /* LaunchScreen.storyboard */, 90 | 77E27A9122A624390074B3A7 /* Info.plist */, 91 | 77E27A8B22A624390074B3A7 /* Preview Content */, 92 | ); 93 | path = SwiftUI_Profile_Demo; 94 | sourceTree = ""; 95 | }; 96 | 77E27A8B22A624390074B3A7 /* Preview Content */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 77E27A8C22A624390074B3A7 /* Preview Assets.xcassets */, 100 | ); 101 | path = "Preview Content"; 102 | sourceTree = ""; 103 | }; 104 | 77E27A9922A624390074B3A7 /* SwiftUI_Profile_DemoTests */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 77E27A9A22A624390074B3A7 /* SwiftUI_ExperimentTests.swift */, 108 | 77E27A9C22A624390074B3A7 /* Info.plist */, 109 | ); 110 | path = SwiftUI_Profile_DemoTests; 111 | sourceTree = ""; 112 | }; 113 | 77E27AA422A624390074B3A7 /* SwiftUI_Profile_DemoUITests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 77E27AA522A624390074B3A7 /* SwiftUI_ExperimentUITests.swift */, 117 | 77E27AA722A624390074B3A7 /* Info.plist */, 118 | ); 119 | path = SwiftUI_Profile_DemoUITests; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 77E27A7C22A624370074B3A7 /* SwiftUI_Profile_Demo */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 77E27AAA22A624390074B3A7 /* Build configuration list for PBXNativeTarget "SwiftUI_Profile_Demo" */; 128 | buildPhases = ( 129 | 77E27A7922A624370074B3A7 /* Sources */, 130 | 77E27A7A22A624370074B3A7 /* Frameworks */, 131 | 77E27A7B22A624370074B3A7 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = SwiftUI_Profile_Demo; 138 | productName = SwiftUI_Experiment; 139 | productReference = 77E27A7D22A624370074B3A7 /* SwiftUI_Profile_Demo.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | /* End PBXNativeTarget section */ 143 | 144 | /* Begin PBXProject section */ 145 | 77E27A7522A624370074B3A7 /* Project object */ = { 146 | isa = PBXProject; 147 | attributes = { 148 | LastSwiftUpdateCheck = 1100; 149 | LastUpgradeCheck = 1300; 150 | ORGANIZATIONNAME = "Patrick Mifsud"; 151 | TargetAttributes = { 152 | 77E27A7C22A624370074B3A7 = { 153 | CreatedOnToolsVersion = 11.0; 154 | }; 155 | }; 156 | }; 157 | buildConfigurationList = 77E27A7822A624370074B3A7 /* Build configuration list for PBXProject "SwiftUI_Profile_Demo" */; 158 | compatibilityVersion = "Xcode 9.3"; 159 | developmentRegion = en; 160 | hasScannedForEncodings = 0; 161 | knownRegions = ( 162 | en, 163 | Base, 164 | ); 165 | mainGroup = 77E27A7422A624370074B3A7; 166 | productRefGroup = 77E27A7E22A624370074B3A7 /* Products */; 167 | projectDirPath = ""; 168 | projectRoot = ""; 169 | targets = ( 170 | 77E27A7C22A624370074B3A7 /* SwiftUI_Profile_Demo */, 171 | ); 172 | }; 173 | /* End PBXProject section */ 174 | 175 | /* Begin PBXResourcesBuildPhase section */ 176 | 77E27A7B22A624370074B3A7 /* Resources */ = { 177 | isa = PBXResourcesBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | 77E27A9022A624390074B3A7 /* LaunchScreen.storyboard in Resources */, 181 | 77E8EDED22B1EC5600EBE96C /* Assets.xcassets in Resources */, 182 | 77E27A8D22A624390074B3A7 /* Preview Assets.xcassets in Resources */, 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | }; 186 | /* End PBXResourcesBuildPhase section */ 187 | 188 | /* Begin PBXSourcesBuildPhase section */ 189 | 77E27A7922A624370074B3A7 /* Sources */ = { 190 | isa = PBXSourcesBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | 77E8EDF122B1EF0100EBE96C /* colorSlider.swift in Sources */, 194 | 77E27A8122A624370074B3A7 /* AppDelegate.swift in Sources */, 195 | CD6673E922B8CD5200ECC116 /* ProfileView.swift in Sources */, 196 | 77CAC0CC26D617FE00A5A058 /* SettingsView.swift in Sources */, 197 | 77CAC0CE26D6190B00A5A058 /* UserSettings.swift in Sources */, 198 | 77E27A8322A624370074B3A7 /* SceneDelegate.swift in Sources */, 199 | 77E8EDEF22B1EE4700EBE96C /* HeaderBanner.swift in Sources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXSourcesBuildPhase section */ 204 | 205 | /* Begin PBXVariantGroup section */ 206 | 77E27A8E22A624390074B3A7 /* LaunchScreen.storyboard */ = { 207 | isa = PBXVariantGroup; 208 | children = ( 209 | 77E27A8F22A624390074B3A7 /* Base */, 210 | ); 211 | name = LaunchScreen.storyboard; 212 | sourceTree = ""; 213 | }; 214 | /* End PBXVariantGroup section */ 215 | 216 | /* Begin XCBuildConfiguration section */ 217 | 77E27AA822A624390074B3A7 /* Debug */ = { 218 | isa = XCBuildConfiguration; 219 | buildSettings = { 220 | ALWAYS_SEARCH_USER_PATHS = NO; 221 | CLANG_ANALYZER_NONNULL = YES; 222 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 223 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 224 | CLANG_CXX_LIBRARY = "libc++"; 225 | CLANG_ENABLE_MODULES = YES; 226 | CLANG_ENABLE_OBJC_ARC = YES; 227 | CLANG_ENABLE_OBJC_WEAK = YES; 228 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 229 | CLANG_WARN_BOOL_CONVERSION = YES; 230 | CLANG_WARN_COMMA = YES; 231 | CLANG_WARN_CONSTANT_CONVERSION = YES; 232 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 233 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 234 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INFINITE_RECURSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 241 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 244 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 245 | CLANG_WARN_STRICT_PROTOTYPES = YES; 246 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 247 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 248 | CLANG_WARN_UNREACHABLE_CODE = YES; 249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 250 | COPY_PHASE_STRIP = NO; 251 | DEBUG_INFORMATION_FORMAT = dwarf; 252 | ENABLE_STRICT_OBJC_MSGSEND = YES; 253 | ENABLE_TESTABILITY = YES; 254 | GCC_C_LANGUAGE_STANDARD = gnu11; 255 | GCC_DYNAMIC_NO_PIC = NO; 256 | GCC_NO_COMMON_BLOCKS = YES; 257 | GCC_OPTIMIZATION_LEVEL = 0; 258 | GCC_PREPROCESSOR_DEFINITIONS = ( 259 | "DEBUG=1", 260 | "$(inherited)", 261 | ); 262 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 264 | GCC_WARN_UNDECLARED_SELECTOR = YES; 265 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 266 | GCC_WARN_UNUSED_FUNCTION = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 269 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 270 | MTL_FAST_MATH = YES; 271 | ONLY_ACTIVE_ARCH = YES; 272 | SDKROOT = iphoneos; 273 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 274 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 275 | }; 276 | name = Debug; 277 | }; 278 | 77E27AA922A624390074B3A7 /* Release */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | ALWAYS_SEARCH_USER_PATHS = NO; 282 | CLANG_ANALYZER_NONNULL = YES; 283 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 285 | CLANG_CXX_LIBRARY = "libc++"; 286 | CLANG_ENABLE_MODULES = YES; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_ENABLE_OBJC_WEAK = YES; 289 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 290 | CLANG_WARN_BOOL_CONVERSION = YES; 291 | CLANG_WARN_COMMA = YES; 292 | CLANG_WARN_CONSTANT_CONVERSION = YES; 293 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 294 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 295 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 296 | CLANG_WARN_EMPTY_BODY = YES; 297 | CLANG_WARN_ENUM_CONVERSION = YES; 298 | CLANG_WARN_INFINITE_RECURSION = YES; 299 | CLANG_WARN_INT_CONVERSION = YES; 300 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 301 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 302 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 303 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 304 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 305 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 306 | CLANG_WARN_STRICT_PROTOTYPES = YES; 307 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 308 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 309 | CLANG_WARN_UNREACHABLE_CODE = YES; 310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 311 | COPY_PHASE_STRIP = NO; 312 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 313 | ENABLE_NS_ASSERTIONS = NO; 314 | ENABLE_STRICT_OBJC_MSGSEND = YES; 315 | GCC_C_LANGUAGE_STANDARD = gnu11; 316 | GCC_NO_COMMON_BLOCKS = YES; 317 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 318 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 319 | GCC_WARN_UNDECLARED_SELECTOR = YES; 320 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 321 | GCC_WARN_UNUSED_FUNCTION = YES; 322 | GCC_WARN_UNUSED_VARIABLE = YES; 323 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 324 | MTL_ENABLE_DEBUG_INFO = NO; 325 | MTL_FAST_MATH = YES; 326 | SDKROOT = iphoneos; 327 | SWIFT_COMPILATION_MODE = wholemodule; 328 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 329 | VALIDATE_PRODUCT = YES; 330 | }; 331 | name = Release; 332 | }; 333 | 77E27AAB22A624390074B3A7 /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 337 | CODE_SIGN_STYLE = Automatic; 338 | CURRENT_PROJECT_VERSION = 04; 339 | DEVELOPMENT_ASSET_PATHS = "SwiftUI_Profile_Demo/Preview\\ Content"; 340 | DEVELOPMENT_TEAM = PU8ES8CS9S; 341 | ENABLE_PREVIEWS = YES; 342 | INFOPLIST_FILE = SwiftUI_Profile_Demo/Info.plist; 343 | LD_RUNPATH_SEARCH_PATHS = ( 344 | "$(inherited)", 345 | "@executable_path/Frameworks", 346 | ); 347 | MARKETING_VERSION = 2; 348 | PRODUCT_BUNDLE_IDENTIFIER = "patrickmfsd.SwiftUI-Profile-Demo"; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | SWIFT_VERSION = 5.0; 351 | TARGETED_DEVICE_FAMILY = 1; 352 | }; 353 | name = Debug; 354 | }; 355 | 77E27AAC22A624390074B3A7 /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | CODE_SIGN_STYLE = Automatic; 360 | CURRENT_PROJECT_VERSION = 04; 361 | DEVELOPMENT_ASSET_PATHS = "SwiftUI_Profile_Demo/Preview\\ Content"; 362 | DEVELOPMENT_TEAM = PU8ES8CS9S; 363 | ENABLE_PREVIEWS = YES; 364 | INFOPLIST_FILE = SwiftUI_Profile_Demo/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = ( 366 | "$(inherited)", 367 | "@executable_path/Frameworks", 368 | ); 369 | MARKETING_VERSION = 2; 370 | PRODUCT_BUNDLE_IDENTIFIER = "patrickmfsd.SwiftUI-Profile-Demo"; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | SWIFT_VERSION = 5.0; 373 | TARGETED_DEVICE_FAMILY = 1; 374 | }; 375 | name = Release; 376 | }; 377 | /* End XCBuildConfiguration section */ 378 | 379 | /* Begin XCConfigurationList section */ 380 | 77E27A7822A624370074B3A7 /* Build configuration list for PBXProject "SwiftUI_Profile_Demo" */ = { 381 | isa = XCConfigurationList; 382 | buildConfigurations = ( 383 | 77E27AA822A624390074B3A7 /* Debug */, 384 | 77E27AA922A624390074B3A7 /* Release */, 385 | ); 386 | defaultConfigurationIsVisible = 0; 387 | defaultConfigurationName = Release; 388 | }; 389 | 77E27AAA22A624390074B3A7 /* Build configuration list for PBXNativeTarget "SwiftUI_Profile_Demo" */ = { 390 | isa = XCConfigurationList; 391 | buildConfigurations = ( 392 | 77E27AAB22A624390074B3A7 /* Debug */, 393 | 77E27AAC22A624390074B3A7 /* Release */, 394 | ); 395 | defaultConfigurationIsVisible = 0; 396 | defaultConfigurationName = Release; 397 | }; 398 | /* End XCConfigurationList section */ 399 | }; 400 | rootObject = 77E27A7522A624370074B3A7 /* Project object */; 401 | } 402 | --------------------------------------------------------------------------------