diff --git a/.gitignore b/.gitignore index 32af84d..7f63513 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/SS* **/-ss* -**/ss* \ No newline at end of file +**/ss* +**/.DS_Store diff --git a/README.md b/README.md index 9812cd6..5fee564 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # apprentice-projects-spring22 -Central repository for App Team Carolina's Academy Apprenticeship projects for Spring 2022. +Central repository for App Team Carolina's Academy Apprenticeship projects in Spring 2022. ## Setting up your projects repository 1. Open the [repository](https://github.com/appteamcarolina/apprentice-projects-s22) on the GitHub website. diff --git a/assets/appteam-sp22-transparent-logo.png b/assets/appteam-sp22-transparent-logo.png new file mode 100644 index 0000000..a17bb2c Binary files /dev/null and b/assets/appteam-sp22-transparent-logo.png differ diff --git a/ex00-todo/ex00-todo.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate b/ex00-todo/ex00-todo.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate index 5f38c78..7761702 100644 Binary files a/ex00-todo/ex00-todo.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate and b/ex00-todo/ex00-todo.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.pbxproj b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a96ead6 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.pbxproj @@ -0,0 +1,358 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 8772908127BC5EE300F8892F /* ex01_bonesnobonesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8772908027BC5EE300F8892F /* ex01_bonesnobonesApp.swift */; }; + 8772908327BC5EE300F8892F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8772908227BC5EE300F8892F /* ContentView.swift */; }; + 8772908527BC5EE400F8892F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8772908427BC5EE400F8892F /* Assets.xcassets */; }; + 8772908827BC5EE400F8892F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8772908727BC5EE400F8892F /* Preview Assets.xcassets */; }; + 8772908F27BC5EFE00F8892F /* BonesDay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8772908E27BC5EFE00F8892F /* BonesDay.swift */; }; + 8772909127BC601B00F8892F /* BonesService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8772909027BC601B00F8892F /* BonesService.swift */; }; + 8772909327BC612900F8892F /* BonesListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8772909227BC612900F8892F /* BonesListViewModel.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8772907D27BC5EE300F8892F /* ex01-bonesnobones.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ex01-bonesnobones.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8772908027BC5EE300F8892F /* ex01_bonesnobonesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ex01_bonesnobonesApp.swift; sourceTree = ""; }; + 8772908227BC5EE300F8892F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 8772908427BC5EE400F8892F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8772908727BC5EE400F8892F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 8772908E27BC5EFE00F8892F /* BonesDay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonesDay.swift; sourceTree = ""; }; + 8772909027BC601B00F8892F /* BonesService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonesService.swift; sourceTree = ""; }; + 8772909227BC612900F8892F /* BonesListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonesListViewModel.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8772907A27BC5EE300F8892F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8772907427BC5EE300F8892F = { + isa = PBXGroup; + children = ( + 8772907F27BC5EE300F8892F /* ex01-bonesnobones */, + 8772907E27BC5EE300F8892F /* Products */, + ); + sourceTree = ""; + }; + 8772907E27BC5EE300F8892F /* Products */ = { + isa = PBXGroup; + children = ( + 8772907D27BC5EE300F8892F /* ex01-bonesnobones.app */, + ); + name = Products; + sourceTree = ""; + }; + 8772907F27BC5EE300F8892F /* ex01-bonesnobones */ = { + isa = PBXGroup; + children = ( + 8772908027BC5EE300F8892F /* ex01_bonesnobonesApp.swift */, + 8772908227BC5EE300F8892F /* ContentView.swift */, + 8772909227BC612900F8892F /* BonesListViewModel.swift */, + 8772909027BC601B00F8892F /* BonesService.swift */, + 8772908E27BC5EFE00F8892F /* BonesDay.swift */, + 8772908427BC5EE400F8892F /* Assets.xcassets */, + 8772908627BC5EE400F8892F /* Preview Content */, + ); + path = "ex01-bonesnobones"; + sourceTree = ""; + }; + 8772908627BC5EE400F8892F /* Preview Content */ = { + isa = PBXGroup; + children = ( + 8772908727BC5EE400F8892F /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8772907C27BC5EE300F8892F /* ex01-bonesnobones */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8772908B27BC5EE400F8892F /* Build configuration list for PBXNativeTarget "ex01-bonesnobones" */; + buildPhases = ( + 8772907927BC5EE300F8892F /* Sources */, + 8772907A27BC5EE300F8892F /* Frameworks */, + 8772907B27BC5EE300F8892F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ex01-bonesnobones"; + productName = "ex01-bonesnobones"; + productReference = 8772907D27BC5EE300F8892F /* ex01-bonesnobones.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8772907527BC5EE300F8892F /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + 8772907C27BC5EE300F8892F = { + CreatedOnToolsVersion = 13.2.1; + }; + }; + }; + buildConfigurationList = 8772907827BC5EE300F8892F /* Build configuration list for PBXProject "ex01-bonesnobones" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8772907427BC5EE300F8892F; + productRefGroup = 8772907E27BC5EE300F8892F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8772907C27BC5EE300F8892F /* ex01-bonesnobones */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8772907B27BC5EE300F8892F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8772908827BC5EE400F8892F /* Preview Assets.xcassets in Resources */, + 8772908527BC5EE400F8892F /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8772907927BC5EE300F8892F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8772908327BC5EE300F8892F /* ContentView.swift in Sources */, + 8772909127BC601B00F8892F /* BonesService.swift in Sources */, + 8772908F27BC5EFE00F8892F /* BonesDay.swift in Sources */, + 8772908127BC5EE300F8892F /* ex01_bonesnobonesApp.swift in Sources */, + 8772909327BC612900F8892F /* BonesListViewModel.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 8772908927BC5EE400F8892F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8772908A27BC5EE400F8892F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8772908C27BC5EE400F8892F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex01-bonesnobones/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex01-bonesnobones"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8772908D27BC5EE400F8892F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex01-bonesnobones/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex01-bonesnobones"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8772907827BC5EE300F8892F /* Build configuration list for PBXProject "ex01-bonesnobones" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8772908927BC5EE400F8892F /* Debug */, + 8772908A27BC5EE400F8892F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8772908B27BC5EE400F8892F /* Build configuration list for PBXNativeTarget "ex01-bonesnobones" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8772908C27BC5EE400F8892F /* Debug */, + 8772908D27BC5EE400F8892F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8772907527BC5EE300F8892F /* Project object */; +} diff --git a/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ed493fe Binary files /dev/null and b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..2774049 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + ex01-bonesnobones.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AccentColor.colorset/Contents.json b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AppIcon.appiconset/Contents.json b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/Contents.json b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/BonesDay.swift b/ex01-bonesnobones/ex01-bonesnobones/BonesDay.swift new file mode 100644 index 0000000..45d4088 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/BonesDay.swift @@ -0,0 +1,52 @@ +// +// BonesDay.swift +// ex01-bonesnobones +// +// Created by Samuel Shi on 2/15/22. +// + +import Foundation + +enum BonesStatus { + case bones + case noBones + + var displayName: String { + switch self { + case .bones: + return "Bones" + case .noBones: + return "No Bones" + } + } + + var emoji: String { + switch self { + case .bones: + return "🦴" + case .noBones: + return "😩" + } + } +} + +struct BonesDay: Codable, Identifiable { + private let _id: String + private let value: String + + let date: String + + init(id: String, date: String, value: String) { + self._id = id + self.date = date + self.value = value + } + + var id: String { + return _id + } + + var bonesStatus: BonesStatus { + return value == "b" ? .bones : .noBones + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/BonesListViewModel.swift b/ex01-bonesnobones/ex01-bonesnobones/BonesListViewModel.swift new file mode 100644 index 0000000..8ea39ec --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/BonesListViewModel.swift @@ -0,0 +1,28 @@ +// +// BonesListViewModel.swift +// ex01-bonesnobones +// +// Created by Samuel Shi on 2/15/22. +// + +import Foundation + +@MainActor +class BonesListViewModel: ObservableObject { + @Published var days: [BonesDay] = [] + + init() { + Task { + await fetchDays() + } + } + + func fetchDays() async { + do { + let days = try await BonesService.getDays() + self.days = days + } catch { + print(error.localizedDescription) + } + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/BonesService.swift b/ex01-bonesnobones/ex01-bonesnobones/BonesService.swift new file mode 100644 index 0000000..de172ee --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/BonesService.swift @@ -0,0 +1,36 @@ +// +// BonesService.swift +// ex01-bonesnobones +// +// Created by Samuel Shi on 2/15/22. +// + +import Foundation + +struct BonesService { + static private let days: [BonesDay] = [ + BonesDay(id: "1", date: "2/15/2022", value: "b"), + BonesDay(id: "2", date: "2/16/2022", value: "n"), + BonesDay(id: "3", date: "2/17/2022", value: "b"), + BonesDay(id: "4", date: "2/18/2022", value: "b"), + BonesDay(id: "5", date: "2/19/2022", value: "n") + ] + + static private let decoder = JSONDecoder() + + static func getDays() async throws -> [BonesDay] { + let url = URL(string: "https://bones-backend.herokuapp.com/bones")! + + var request = URLRequest(url: url) + request.httpMethod = "GET" + + let (data, response) = try await URLSession.shared.data(for: request) + + if let response = response as? HTTPURLResponse { + print(response.statusCode) + } + + let decodedDays = try decoder.decode([BonesDay].self, from: data) + return decodedDays + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/ContentView.swift b/ex01-bonesnobones/ex01-bonesnobones/ContentView.swift new file mode 100644 index 0000000..bd9826d --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/ContentView.swift @@ -0,0 +1,40 @@ +// +// ContentView.swift +// ex01-bonesnobones +// +// Created by Samuel Shi on 2/15/22. +// + +import SwiftUI + +struct ContentView: View { + @StateObject var vm = BonesListViewModel() + + var body: some View { + NavigationView { + List { + ForEach(vm.days) { day in + HStack { + Text(day.bonesStatus.emoji) + .font(.largeTitle) + + VStack(alignment: .leading) { + Text(day.bonesStatus.displayName) + + Text(day.date) + .font(.callout) + .foregroundColor(.secondary) + } + } + } + } + .navigationTitle("bonesnobones") + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/Preview Content/Preview Assets.xcassets/Contents.json b/ex01-bonesnobones/ex01-bonesnobones/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex01-bonesnobones/ex01-bonesnobones/ex01_bonesnobonesApp.swift b/ex01-bonesnobones/ex01-bonesnobones/ex01_bonesnobonesApp.swift new file mode 100644 index 0000000..5c0f4a7 --- /dev/null +++ b/ex01-bonesnobones/ex01-bonesnobones/ex01_bonesnobonesApp.swift @@ -0,0 +1,17 @@ +// +// ex01_bonesnobonesApp.swift +// ex01-bonesnobones +// +// Created by Samuel Shi on 2/15/22. +// + +import SwiftUI + +@main +struct ex01_bonesnobonesApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AccentColor.colorset/Contents.json b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Assets.xcassets/Contents.json b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Assets.xcassets/WidgetBackground.colorset/Contents.json b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Entry.swift b/ex02-widgetdemo/WidgetDemo/Entry.swift new file mode 100644 index 0000000..34711d8 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Entry.swift @@ -0,0 +1,15 @@ +// +// Entry.swift +// ex02-widgetdemo +// +// Created by Samuel Shi on 2/22/22. +// + +import SwiftUI +import WidgetKit + +struct SimpleEntry: TimelineEntry { + let date: Date + + // data +} diff --git a/ex02-widgetdemo/WidgetDemo/EntryView.swift b/ex02-widgetdemo/WidgetDemo/EntryView.swift new file mode 100644 index 0000000..489de60 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/EntryView.swift @@ -0,0 +1,30 @@ +// +// EntryView.swift +// ex02-widgetdemo +// +// Created by Samuel Shi on 2/22/22. +// + +import SwiftUI +import WidgetKit + +struct WidgetDemoEntryView: View { + @Environment(\.widgetFamily) var widgetFamily + + var entry: Provider.Entry + + var body: some View { + switch widgetFamily { + case .systemLarge: + Text("large") + case .systemSmall: + Text("extra small") + case .systemMedium: + Text("medium") + case .systemExtraLarge: + Text("extra large") + @unknown default: + Text("unsupported") + } + } +} diff --git a/ex02-widgetdemo/WidgetDemo/Info.plist b/ex02-widgetdemo/WidgetDemo/Info.plist new file mode 100644 index 0000000..0f118fb --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/ex02-widgetdemo/WidgetDemo/Provider.swift b/ex02-widgetdemo/WidgetDemo/Provider.swift new file mode 100644 index 0000000..6bb37a8 --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/Provider.swift @@ -0,0 +1,35 @@ +// +// Provider.swift +// ex02-widgetdemo +// +// Created by Samuel Shi on 2/22/22. +// + +import WidgetKit +import SwiftUI + +struct Provider: TimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date()) + } + + func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let entry = SimpleEntry(date: Date()) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + var entries: [SimpleEntry] = [] + + // Generate a timeline consisting of five entries an hour apart, starting from the current date. + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = SimpleEntry(date: entryDate) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .atEnd) + completion(timeline) + } +} diff --git a/ex02-widgetdemo/WidgetDemo/WidgetDemo.swift b/ex02-widgetdemo/WidgetDemo/WidgetDemo.swift new file mode 100644 index 0000000..67ea06c --- /dev/null +++ b/ex02-widgetdemo/WidgetDemo/WidgetDemo.swift @@ -0,0 +1,30 @@ +// +// WidgetDemo.swift +// WidgetDemo +// +// Created by Samuel Shi on 2/22/22. +// + +import WidgetKit +import SwiftUI + +@main +struct WidgetDemo: Widget { + let kind: String = "WidgetDemo" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + WidgetDemoEntryView(entry: entry) + } + .configurationDisplayName("My Widget") + .description("This is an example widget.") + .supportedFamilies([.systemMedium, .systemLarge]) + } +} + +struct WidgetDemo_Previews: PreviewProvider { + static var previews: some View { + WidgetDemoEntryView(entry: SimpleEntry(date: Date())) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.pbxproj b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b93717e --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.pbxproj @@ -0,0 +1,536 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 87E180C327C57D770078875E /* ex02_widgetdemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E180C227C57D770078875E /* ex02_widgetdemoApp.swift */; }; + 87E180C527C57D770078875E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E180C427C57D770078875E /* ContentView.swift */; }; + 87E180C727C57D780078875E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87E180C627C57D780078875E /* Assets.xcassets */; }; + 87E180CA27C57D780078875E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87E180C927C57D780078875E /* Preview Assets.xcassets */; }; + 87E1812827C57E070078875E /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87E180D627C57D910078875E /* WidgetKit.framework */; }; + 87E1812927C57E070078875E /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87E180D827C57D910078875E /* SwiftUI.framework */; }; + 87E1812C27C57E070078875E /* WidgetDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E1812B27C57E070078875E /* WidgetDemo.swift */; }; + 87E1812E27C57E070078875E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87E1812D27C57E070078875E /* Assets.xcassets */; }; + 87E1813227C57E070078875E /* WidgetDemoExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 87E1812727C57E070078875E /* WidgetDemoExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 87E1813A27C57E430078875E /* Entry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E1813827C57E390078875E /* Entry.swift */; }; + 87E1813C27C57E4D0078875E /* Provider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E1813627C57E260078875E /* Provider.swift */; }; + 87E1813F27C57E6D0078875E /* EntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E1813D27C57E5D0078875E /* EntryView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 87E1813027C57E070078875E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 87E180B727C57D770078875E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 87E1812627C57E070078875E; + remoteInfo = WidgetDemoExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 87E180E927C57D920078875E /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 87E1813227C57E070078875E /* WidgetDemoExtension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 87E180BF27C57D770078875E /* ex02-widgetdemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ex02-widgetdemo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 87E180C227C57D770078875E /* ex02_widgetdemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ex02_widgetdemoApp.swift; sourceTree = ""; }; + 87E180C427C57D770078875E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 87E180C627C57D780078875E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 87E180C927C57D780078875E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 87E180D627C57D910078875E /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 87E180D827C57D910078875E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + 87E1812727C57E070078875E /* WidgetDemoExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WidgetDemoExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 87E1812B27C57E070078875E /* WidgetDemo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetDemo.swift; sourceTree = ""; }; + 87E1812D27C57E070078875E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 87E1812F27C57E070078875E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 87E1813627C57E260078875E /* Provider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Provider.swift; sourceTree = ""; }; + 87E1813827C57E390078875E /* Entry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Entry.swift; sourceTree = ""; }; + 87E1813D27C57E5D0078875E /* EntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntryView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 87E180BC27C57D770078875E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 87E1812427C57E070078875E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 87E1812927C57E070078875E /* SwiftUI.framework in Frameworks */, + 87E1812827C57E070078875E /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 87E180B627C57D770078875E = { + isa = PBXGroup; + children = ( + 87E180C127C57D770078875E /* ex02-widgetdemo */, + 87E1812A27C57E070078875E /* WidgetDemo */, + 87E180D527C57D910078875E /* Frameworks */, + 87E180C027C57D770078875E /* Products */, + ); + sourceTree = ""; + }; + 87E180C027C57D770078875E /* Products */ = { + isa = PBXGroup; + children = ( + 87E180BF27C57D770078875E /* ex02-widgetdemo.app */, + 87E1812727C57E070078875E /* WidgetDemoExtension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 87E180C127C57D770078875E /* ex02-widgetdemo */ = { + isa = PBXGroup; + children = ( + 87E180C227C57D770078875E /* ex02_widgetdemoApp.swift */, + 87E180C427C57D770078875E /* ContentView.swift */, + 87E180C627C57D780078875E /* Assets.xcassets */, + 87E180C827C57D780078875E /* Preview Content */, + ); + path = "ex02-widgetdemo"; + sourceTree = ""; + }; + 87E180C827C57D780078875E /* Preview Content */ = { + isa = PBXGroup; + children = ( + 87E180C927C57D780078875E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 87E180D527C57D910078875E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 87E180D627C57D910078875E /* WidgetKit.framework */, + 87E180D827C57D910078875E /* SwiftUI.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 87E1812A27C57E070078875E /* WidgetDemo */ = { + isa = PBXGroup; + children = ( + 87E1812B27C57E070078875E /* WidgetDemo.swift */, + 87E1813827C57E390078875E /* Entry.swift */, + 87E1813627C57E260078875E /* Provider.swift */, + 87E1813D27C57E5D0078875E /* EntryView.swift */, + 87E1812D27C57E070078875E /* Assets.xcassets */, + 87E1812F27C57E070078875E /* Info.plist */, + ); + path = WidgetDemo; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 87E180BE27C57D770078875E /* ex02-widgetdemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 87E180CD27C57D780078875E /* Build configuration list for PBXNativeTarget "ex02-widgetdemo" */; + buildPhases = ( + 87E180BB27C57D770078875E /* Sources */, + 87E180BC27C57D770078875E /* Frameworks */, + 87E180BD27C57D770078875E /* Resources */, + 87E180E927C57D920078875E /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 87E1813127C57E070078875E /* PBXTargetDependency */, + ); + name = "ex02-widgetdemo"; + productName = "ex02-widgetdemo"; + productReference = 87E180BF27C57D770078875E /* ex02-widgetdemo.app */; + productType = "com.apple.product-type.application"; + }; + 87E1812627C57E070078875E /* WidgetDemoExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 87E1813327C57E070078875E /* Build configuration list for PBXNativeTarget "WidgetDemoExtension" */; + buildPhases = ( + 87E1812327C57E070078875E /* Sources */, + 87E1812427C57E070078875E /* Frameworks */, + 87E1812527C57E070078875E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WidgetDemoExtension; + productName = WidgetDemoExtension; + productReference = 87E1812727C57E070078875E /* WidgetDemoExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 87E180B727C57D770078875E /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + 87E180BE27C57D770078875E = { + CreatedOnToolsVersion = 13.2.1; + }; + 87E1812627C57E070078875E = { + CreatedOnToolsVersion = 13.2.1; + }; + }; + }; + buildConfigurationList = 87E180BA27C57D770078875E /* Build configuration list for PBXProject "ex02-widgetdemo" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 87E180B627C57D770078875E; + productRefGroup = 87E180C027C57D770078875E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 87E180BE27C57D770078875E /* ex02-widgetdemo */, + 87E1812627C57E070078875E /* WidgetDemoExtension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 87E180BD27C57D770078875E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87E180CA27C57D780078875E /* Preview Assets.xcassets in Resources */, + 87E180C727C57D780078875E /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 87E1812527C57E070078875E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87E1812E27C57E070078875E /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 87E180BB27C57D770078875E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87E180C527C57D770078875E /* ContentView.swift in Sources */, + 87E180C327C57D770078875E /* ex02_widgetdemoApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 87E1812327C57E070078875E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87E1813A27C57E430078875E /* Entry.swift in Sources */, + 87E1813C27C57E4D0078875E /* Provider.swift in Sources */, + 87E1812C27C57E070078875E /* WidgetDemo.swift in Sources */, + 87E1813F27C57E6D0078875E /* EntryView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 87E1813127C57E070078875E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 87E1812627C57E070078875E /* WidgetDemoExtension */; + targetProxy = 87E1813027C57E070078875E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 87E180CB27C57D780078875E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 87E180CC27C57D780078875E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 87E180CE27C57D780078875E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex02-widgetdemo/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex02-widgetdemo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 87E180CF27C57D780078875E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex02-widgetdemo/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex02-widgetdemo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 87E1813427C57E070078875E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WidgetDemo/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WidgetDemo; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex02-widgetdemo.WidgetDemo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 87E1813527C57E070078875E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WidgetDemo/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WidgetDemo; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex02-widgetdemo.WidgetDemo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 87E180BA27C57D770078875E /* Build configuration list for PBXProject "ex02-widgetdemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87E180CB27C57D780078875E /* Debug */, + 87E180CC27C57D780078875E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 87E180CD27C57D780078875E /* Build configuration list for PBXNativeTarget "ex02-widgetdemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87E180CE27C57D780078875E /* Debug */, + 87E180CF27C57D780078875E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 87E1813327C57E070078875E /* Build configuration list for PBXNativeTarget "WidgetDemoExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87E1813427C57E070078875E /* Debug */, + 87E1813527C57E070078875E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 87E180B727C57D770078875E /* Project object */; +} diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ed662cd Binary files /dev/null and b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9e50a8a --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..9a4ade5 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,24 @@ + + + + + SchemeUserState + + WidgetDemo-WidgetExtension.xcscheme_^#shared#^_ + + orderHint + 1 + + WidgetDemoExtension.xcscheme_^#shared#^_ + + orderHint + 1 + + ex02-widgetdemo.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AccentColor.colorset/Contents.json b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/Contents.json b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo/ContentView.swift b/ex02-widgetdemo/ex02-widgetdemo/ContentView.swift new file mode 100644 index 0000000..38636b7 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/ContentView.swift @@ -0,0 +1,21 @@ +// +// ContentView.swift +// ex02-widgetdemo +// +// Created by Samuel Shi on 2/22/22. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, world!") + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo/Preview Content/Preview Assets.xcassets/Contents.json b/ex02-widgetdemo/ex02-widgetdemo/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex02-widgetdemo/ex02-widgetdemo/ex02_widgetdemoApp.swift b/ex02-widgetdemo/ex02-widgetdemo/ex02_widgetdemoApp.swift new file mode 100644 index 0000000..001eab5 --- /dev/null +++ b/ex02-widgetdemo/ex02-widgetdemo/ex02_widgetdemoApp.swift @@ -0,0 +1,17 @@ +// +// ex02_widgetdemoApp.swift +// ex02-widgetdemo +// +// Created by Samuel Shi on 2/22/22. +// + +import SwiftUI + +@main +struct ex02_widgetdemoApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.pbxproj b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.pbxproj new file mode 100644 index 0000000..be6ce32 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.pbxproj @@ -0,0 +1,354 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 876B82C827CEC1410082D1DA /* ex03_userdefaultsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876B82C727CEC1410082D1DA /* ex03_userdefaultsApp.swift */; }; + 876B82CA27CEC1410082D1DA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876B82C927CEC1410082D1DA /* ContentView.swift */; }; + 876B82CC27CEC1420082D1DA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 876B82CB27CEC1420082D1DA /* Assets.xcassets */; }; + 876B82CF27CEC1420082D1DA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 876B82CE27CEC1420082D1DA /* Preview Assets.xcassets */; }; + 876B82D627CEC1620082D1DA /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876B82D527CEC1620082D1DA /* ViewModel.swift */; }; + 876B82D827CEC27A0082D1DA /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876B82D727CEC27A0082D1DA /* User.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 876B82C427CEC1410082D1DA /* ex03-userdefaults.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ex03-userdefaults.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 876B82C727CEC1410082D1DA /* ex03_userdefaultsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ex03_userdefaultsApp.swift; sourceTree = ""; }; + 876B82C927CEC1410082D1DA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 876B82CB27CEC1420082D1DA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 876B82CE27CEC1420082D1DA /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 876B82D527CEC1620082D1DA /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; + 876B82D727CEC27A0082D1DA /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 876B82C127CEC1410082D1DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 876B82BB27CEC1410082D1DA = { + isa = PBXGroup; + children = ( + 876B82C627CEC1410082D1DA /* ex03-userdefaults */, + 876B82C527CEC1410082D1DA /* Products */, + ); + sourceTree = ""; + }; + 876B82C527CEC1410082D1DA /* Products */ = { + isa = PBXGroup; + children = ( + 876B82C427CEC1410082D1DA /* ex03-userdefaults.app */, + ); + name = Products; + sourceTree = ""; + }; + 876B82C627CEC1410082D1DA /* ex03-userdefaults */ = { + isa = PBXGroup; + children = ( + 876B82C727CEC1410082D1DA /* ex03_userdefaultsApp.swift */, + 876B82C927CEC1410082D1DA /* ContentView.swift */, + 876B82D527CEC1620082D1DA /* ViewModel.swift */, + 876B82D727CEC27A0082D1DA /* User.swift */, + 876B82CB27CEC1420082D1DA /* Assets.xcassets */, + 876B82CD27CEC1420082D1DA /* Preview Content */, + ); + path = "ex03-userdefaults"; + sourceTree = ""; + }; + 876B82CD27CEC1420082D1DA /* Preview Content */ = { + isa = PBXGroup; + children = ( + 876B82CE27CEC1420082D1DA /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 876B82C327CEC1410082D1DA /* ex03-userdefaults */ = { + isa = PBXNativeTarget; + buildConfigurationList = 876B82D227CEC1420082D1DA /* Build configuration list for PBXNativeTarget "ex03-userdefaults" */; + buildPhases = ( + 876B82C027CEC1410082D1DA /* Sources */, + 876B82C127CEC1410082D1DA /* Frameworks */, + 876B82C227CEC1410082D1DA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ex03-userdefaults"; + productName = "ex03-userdefaults"; + productReference = 876B82C427CEC1410082D1DA /* ex03-userdefaults.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 876B82BC27CEC1410082D1DA /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + 876B82C327CEC1410082D1DA = { + CreatedOnToolsVersion = 13.2.1; + }; + }; + }; + buildConfigurationList = 876B82BF27CEC1410082D1DA /* Build configuration list for PBXProject "ex03-userdefaults" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 876B82BB27CEC1410082D1DA; + productRefGroup = 876B82C527CEC1410082D1DA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 876B82C327CEC1410082D1DA /* ex03-userdefaults */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 876B82C227CEC1410082D1DA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 876B82CF27CEC1420082D1DA /* Preview Assets.xcassets in Resources */, + 876B82CC27CEC1420082D1DA /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 876B82C027CEC1410082D1DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 876B82D827CEC27A0082D1DA /* User.swift in Sources */, + 876B82CA27CEC1410082D1DA /* ContentView.swift in Sources */, + 876B82D627CEC1620082D1DA /* ViewModel.swift in Sources */, + 876B82C827CEC1410082D1DA /* ex03_userdefaultsApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 876B82D027CEC1420082D1DA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 876B82D127CEC1420082D1DA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 876B82D327CEC1420082D1DA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex03-userdefaults/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex03-userdefaults"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 876B82D427CEC1420082D1DA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex03-userdefaults/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex03-userdefaults"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 876B82BF27CEC1410082D1DA /* Build configuration list for PBXProject "ex03-userdefaults" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 876B82D027CEC1420082D1DA /* Debug */, + 876B82D127CEC1420082D1DA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 876B82D227CEC1420082D1DA /* Build configuration list for PBXNativeTarget "ex03-userdefaults" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 876B82D327CEC1420082D1DA /* Debug */, + 876B82D427CEC1420082D1DA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 876B82BC27CEC1410082D1DA /* Project object */; +} diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..54a2554 Binary files /dev/null and b/ex03-userdefaults/ex03-userdefaults.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..7d96a49 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist b/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0065933 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + ex03-userdefaults.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AccentColor.colorset/Contents.json b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AppIcon.appiconset/Contents.json b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/Contents.json b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/ContentView.swift b/ex03-userdefaults/ex03-userdefaults/ContentView.swift new file mode 100644 index 0000000..676e13c --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/ContentView.swift @@ -0,0 +1,73 @@ +// +// ContentView.swift +// ex03-userdefaults +// +// Created by Samuel Shi on 3/1/22. +// + +import SwiftUI + +struct ContentView: View { + @StateObject var vm = ViewModel() + + var body: some View { + NavigationView { + VStack { + GroupBox("Number of People") { + Stepper("\(vm.numberOfPeople) people", value: $vm.numberOfPeople, in: 0 ... 100) + } + + GroupBox("Distance from Home (mi)") { + HStack { + Text("\(vm.distanceFromHome, specifier: "%.2f") mi") + Slider(value: $vm.distanceFromHome, in: 0 ... 10) + } + } + + GroupBox("Name") { + TextField("Sam", text: $vm.name) + .textFieldStyle(.roundedBorder) + } + + GroupBox("User Details") { + VStack { + TextField("Name", text: $vm.user.name) + TextField("Username", text: $vm.user.username).textInputAutocapitalization(.never) + } + .textFieldStyle(.roundedBorder) + } + + if vm.unsavedChanges { + Text("⚠️ Unsaved Changes") + } + + Spacer() + + Button(action: { + vm.save() + }, label: { + Text("Save") + .padding() + .frame(maxWidth: .infinity) + .background(Color.blue) + .foregroundColor(.white) + .cornerRadius(10) + }) + } + .padding() + .navigationTitle("defaultey") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button("Save") { vm.save() } + } + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView().preferredColorScheme(.dark) + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/Preview Content/Preview Assets.xcassets/Contents.json b/ex03-userdefaults/ex03-userdefaults/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/SettingsView.swift b/ex03-userdefaults/ex03-userdefaults/SettingsView.swift new file mode 100644 index 0000000..564e213 --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/SettingsView.swift @@ -0,0 +1,73 @@ +// +// SettingsView.swift +// ex03-userdefaults +// +// Created by Samuel Shi on 3/1/22. +// + +import SwiftUI + +struct Computer: Codable { + let name: String + let serialNumber: String +} + +class SettingsViewModel: ObservableObject { + @Published var prefersHighContrast = false + @Published var name: String = "" + + @Published var computerName = "" + @Published var computerSerialNumber = "" + + init() { + prefersHighContrast = UserDefaults.standard.bool(forKey: "prefersHighContrast") + name = UserDefaults.standard.string(forKey: "name") ?? "" + + guard let data = UserDefaults.standard.data(forKey: "computer1"), + let computer = try? JSONDecoder().decode(Computer.self, from: data) + else { + print("🆘 failed to decode") + return + } + + self.computerName = computer.name + self.computerSerialNumber = computer.serialNumber + } + + func save() { + UserDefaults.standard.set(prefersHighContrast, forKey: "prefersHighContrast") + UserDefaults.standard.set(name, forKey: "name") + + guard let data = try? JSONEncoder().encode(Computer(name: computerName, serialNumber: computerSerialNumber)) else { + print("🙋‍♂️ Failed to encode") + return + } + + UserDefaults.standard.set(data, forKey: "computer1") + } +} + +struct SettingsView: View { + @StateObject var vm = SettingsViewModel() + + var body: some View { + VStack { + Text(vm.prefersHighContrast ? "High Contrast" : "Normal") + + Toggle(isOn: $vm.prefersHighContrast) { + Text("High Contrast") + } + + TextField("Computer Name", text: $vm.computerName) + TextField("Computer Serial Number", text: $vm.computerSerialNumber) + + Button("Save", action: vm.save) + } + } +} + +struct SettingsView_Previews: PreviewProvider { + static var previews: some View { + SettingsView() + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/User.swift b/ex03-userdefaults/ex03-userdefaults/User.swift new file mode 100644 index 0000000..2bf5cbf --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/User.swift @@ -0,0 +1,13 @@ +// +// User.swift +// ex03-userdefaults +// +// Created by Samuel Shi on 3/1/22. +// + +import Foundation + +struct User { + var name: String = "" + var username: String = "" +} diff --git a/ex03-userdefaults/ex03-userdefaults/ViewModel.swift b/ex03-userdefaults/ex03-userdefaults/ViewModel.swift new file mode 100644 index 0000000..e9d7cca --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/ViewModel.swift @@ -0,0 +1,36 @@ +// +// ViewModel.swift +// ex03-userdefaults +// +// Created by Samuel Shi on 3/1/22. +// + +import Foundation + +class ViewModel: ObservableObject { + @Published var numberOfPeople: Int = 0 { didSet { setNewChanges() } } + @Published var distanceFromHome: Double = 0.0 { didSet { setNewChanges() } } + @Published var name: String = "" { didSet { setNewChanges() } } + @Published var user: User = .init() { didSet { setNewChanges() } } + @Published var unsavedChanges = false + + let userDefaults = UserDefaults.standard + + init() { + // MARK: fetch from UserDefaults + + // this should stay at the bottom of this function + self.unsavedChanges = false + } + + func save() { + // MARK: Save to UserDefaults + + // this should stay at the bottom of this function + unsavedChanges = false + } + + func setNewChanges() { + unsavedChanges = true + } +} diff --git a/ex03-userdefaults/ex03-userdefaults/ex03_userdefaultsApp.swift b/ex03-userdefaults/ex03-userdefaults/ex03_userdefaultsApp.swift new file mode 100644 index 0000000..c2ed38a --- /dev/null +++ b/ex03-userdefaults/ex03-userdefaults/ex03_userdefaultsApp.swift @@ -0,0 +1,18 @@ +// +// ex03_userdefaultsApp.swift +// ex03-userdefaults +// +// Created by Samuel Shi on 3/1/22. +// + +import SwiftUI + +@main +struct ex03_userdefaultsApp: App { + var body: some Scene { + WindowGroup { +// ContentView() + SettingsView() + } + } +} diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/project.pbxproj b/ex04-corelocation/ex04-corelocation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..325c9e5 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/project.pbxproj @@ -0,0 +1,350 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 87A7647227EA768F001A3549 /* ex04_corelocationApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87A7647127EA768F001A3549 /* ex04_corelocationApp.swift */; }; + 87A7647427EA768F001A3549 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87A7647327EA768F001A3549 /* ContentView.swift */; }; + 87A7647627EA7690001A3549 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87A7647527EA7690001A3549 /* Assets.xcassets */; }; + 87A7647927EA7690001A3549 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87A7647827EA7690001A3549 /* Preview Assets.xcassets */; }; + 87A7648027EA76C6001A3549 /* LocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87A7647F27EA76C6001A3549 /* LocationManager.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 87A7646E27EA768F001A3549 /* ex04-corelocation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ex04-corelocation.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 87A7647127EA768F001A3549 /* ex04_corelocationApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ex04_corelocationApp.swift; sourceTree = ""; }; + 87A7647327EA768F001A3549 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 87A7647527EA7690001A3549 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 87A7647827EA7690001A3549 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 87A7647F27EA76C6001A3549 /* LocationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationManager.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 87A7646B27EA768F001A3549 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 87A7646527EA768F001A3549 = { + isa = PBXGroup; + children = ( + 87A7647027EA768F001A3549 /* ex04-corelocation */, + 87A7646F27EA768F001A3549 /* Products */, + ); + sourceTree = ""; + }; + 87A7646F27EA768F001A3549 /* Products */ = { + isa = PBXGroup; + children = ( + 87A7646E27EA768F001A3549 /* ex04-corelocation.app */, + ); + name = Products; + sourceTree = ""; + }; + 87A7647027EA768F001A3549 /* ex04-corelocation */ = { + isa = PBXGroup; + children = ( + 87A7647127EA768F001A3549 /* ex04_corelocationApp.swift */, + 87A7647327EA768F001A3549 /* ContentView.swift */, + 87A7647F27EA76C6001A3549 /* LocationManager.swift */, + 87A7647527EA7690001A3549 /* Assets.xcassets */, + 87A7647727EA7690001A3549 /* Preview Content */, + ); + path = "ex04-corelocation"; + sourceTree = ""; + }; + 87A7647727EA7690001A3549 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 87A7647827EA7690001A3549 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 87A7646D27EA768F001A3549 /* ex04-corelocation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 87A7647C27EA7690001A3549 /* Build configuration list for PBXNativeTarget "ex04-corelocation" */; + buildPhases = ( + 87A7646A27EA768F001A3549 /* Sources */, + 87A7646B27EA768F001A3549 /* Frameworks */, + 87A7646C27EA768F001A3549 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ex04-corelocation"; + productName = "ex04-corelocation"; + productReference = 87A7646E27EA768F001A3549 /* ex04-corelocation.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 87A7646627EA768F001A3549 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1330; + LastUpgradeCheck = 1330; + TargetAttributes = { + 87A7646D27EA768F001A3549 = { + CreatedOnToolsVersion = 13.3; + }; + }; + }; + buildConfigurationList = 87A7646927EA768F001A3549 /* Build configuration list for PBXProject "ex04-corelocation" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 87A7646527EA768F001A3549; + productRefGroup = 87A7646F27EA768F001A3549 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 87A7646D27EA768F001A3549 /* ex04-corelocation */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 87A7646C27EA768F001A3549 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87A7647927EA7690001A3549 /* Preview Assets.xcassets in Resources */, + 87A7647627EA7690001A3549 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 87A7646A27EA768F001A3549 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 87A7647427EA768F001A3549 /* ContentView.swift in Sources */, + 87A7647227EA768F001A3549 /* ex04_corelocationApp.swift in Sources */, + 87A7648027EA76C6001A3549 /* LocationManager.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 87A7647A27EA7690001A3549 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 87A7647B27EA7690001A3549 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 87A7647D27EA7690001A3549 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex04-corelocation/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need location to show your location"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex04-corelocation"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 87A7647E27EA7690001A3549 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ex04-corelocation/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need location to show your location"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.ex04-corelocation"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 87A7646927EA768F001A3549 /* Build configuration list for PBXProject "ex04-corelocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87A7647A27EA7690001A3549 /* Debug */, + 87A7647B27EA7690001A3549 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 87A7647C27EA7690001A3549 /* Build configuration list for PBXNativeTarget "ex04-corelocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87A7647D27EA7690001A3549 /* Debug */, + 87A7647E27EA7690001A3549 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 87A7646627EA768F001A3549 /* Project object */; +} diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7ff0103 Binary files /dev/null and b/ex04-corelocation/ex04-corelocation.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/xcshareddata/xcschemes/ex04-corelocation.xcscheme b/ex04-corelocation/ex04-corelocation.xcodeproj/xcshareddata/xcschemes/ex04-corelocation.xcscheme new file mode 100644 index 0000000..2b7739b --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/xcshareddata/xcschemes/ex04-corelocation.xcscheme @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..3e75eb3 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist b/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e3a09f4 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + ex04-corelocation.xcscheme_^#shared#^_ + + orderHint + 0 + + + SuppressBuildableAutocreation + + 87A7646D27EA768F001A3549 + + primary + + + + + diff --git a/ex04-corelocation/ex04-corelocation/Assets.xcassets/AccentColor.colorset/Contents.json b/ex04-corelocation/ex04-corelocation/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex04-corelocation/ex04-corelocation/Assets.xcassets/AppIcon.appiconset/Contents.json b/ex04-corelocation/ex04-corelocation/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..5a3257a --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex04-corelocation/ex04-corelocation/Assets.xcassets/Contents.json b/ex04-corelocation/ex04-corelocation/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex04-corelocation/ex04-corelocation/ContentView.swift b/ex04-corelocation/ex04-corelocation/ContentView.swift new file mode 100644 index 0000000..1bd47cf --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/ContentView.swift @@ -0,0 +1,25 @@ +// +// ContentView.swift +// ex04-corelocation +// +// Created by Samuel Shi on 3/22/22. +// + +import SwiftUI + +struct ContentView: View { + @StateObject private var locationManger = LocationManager() + + var body: some View { + VStack(alignment: .leading) { + Text("Latitude: \(locationManger.latitude)") + Text("Longitude: \(locationManger.longitude)") + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/ex04-corelocation/ex04-corelocation/LocationManager.swift b/ex04-corelocation/ex04-corelocation/LocationManager.swift new file mode 100644 index 0000000..124d590 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/LocationManager.swift @@ -0,0 +1,40 @@ +// +// LocationManager.swift +// ex04-corelocation +// +// Created by Samuel Shi on 3/22/22. +// + +import Foundation +import CoreLocation + +class LocationManager: NSObject, ObservableObject { + private var locationManager = CLLocationManager() + + @Published var latitude: Double = 0 + @Published var longitude: Double = 0 + + override init() { + super.init() + + locationManager.desiredAccuracy = kCLLocationAccuracyBest + locationManager.delegate = self + locationManager.requestWhenInUseAuthorization() + + locationManager.startUpdatingLocation() + } +} + +extension LocationManager: CLLocationManagerDelegate { + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + guard let location = locations.last else { return } + + latitude = location.coordinate.latitude + longitude = location.coordinate.longitude + } + + func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { + print(error) + } +} + diff --git a/ex04-corelocation/ex04-corelocation/Preview Content/Preview Assets.xcassets/Contents.json b/ex04-corelocation/ex04-corelocation/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ex04-corelocation/ex04-corelocation/ex04_corelocationApp.swift b/ex04-corelocation/ex04-corelocation/ex04_corelocationApp.swift new file mode 100644 index 0000000..cdd9194 --- /dev/null +++ b/ex04-corelocation/ex04-corelocation/ex04_corelocationApp.swift @@ -0,0 +1,17 @@ +// +// ex04_corelocationApp.swift +// ex04-corelocation +// +// Created by Samuel Shi on 3/22/22. +// + +import SwiftUI + +@main +struct ex04_corelocationApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/p01-occupancy-tracker/README.md b/p01-occupancy-tracker/README.md index fc328ac..d95655e 100644 --- a/p01-occupancy-tracker/README.md +++ b/p01-occupancy-tracker/README.md @@ -1,26 +1,16 @@ -## Description +# Occupancy Tracker -Build a simple occupancy tracker. Here are very minimal and more fleshed out versions of this app. +App Team Carolina Logo -simple counter implementation -feature-rich counter implementation +This project is a portion of App Team Carolina's Apprenticeship curriculum. +## My Implementation +``` +add screenshots/gifs here +``` +``` +add description of project here +``` -## What Does Success Look Like? - -- Create at least one `@State` variable -- Use `Button` to create plus and minus buttons that change counter variable -- Use `Text` to display the current count (updates when changed, obviously) -- Prevent user from having a negative count -- (Optional Easy) Change button appearance to indicate that it cannot be pressed - - Minus button should change when count is zero -- (Optional Harder) Add concept of a limit and make UI change when limit is surpassed - -## Goal - -- Review basic SwiftUI state management -- Review very fundamental SwiftUI layout - -## Installation and Setup Instructions - -No real installation instructions for this one, just make your own Xcode project and get to coding!! +## Project Instructions +View project instructions [here](./instructions.md). diff --git a/p01-occupancy-tracker/instructions.md b/p01-occupancy-tracker/instructions.md new file mode 100644 index 0000000..e4c0a68 --- /dev/null +++ b/p01-occupancy-tracker/instructions.md @@ -0,0 +1,26 @@ +## Description + +Build a simple occupancy tracker. Here are very minimal and more fleshed out versions of this app. + +simple counter implementation +feature-rich counter implementation + + +## What Does Success Look Like? + +- Create at least one `@State` variable +- Use `Button` to create plus and minus buttons that change counter variable +- Use `Text` to display the current count (updates when changed, obviously) +- Prevent user from having a negative count +- (Optional Easy) Change button appearance to indicate that it cannot be pressed + - Minus button should change when count is zero +- (Optional Harder) Add concept of a limit and make UI change when limit is surpassed + +## Goal + +- Review basic SwiftUI state management +- Review very fundamental SwiftUI layout + +## Installation and Setup Instructions + +No real installation instructions for this one, just make your own Xcode project and get to coding!! diff --git a/p02-apollo/README.md b/p02-apollo/README.md index 549654a..a264945 100644 --- a/p02-apollo/README.md +++ b/p02-apollo/README.md @@ -1,39 +1,16 @@ -## Description -Build a simple application to display information about the Apollo missions. +# Apollo -NASA Apollo Missions -🚀 This project is a modified version of Paul Hudson’s *Moonshot* from 100 Days of SwiftUI +App Team Carolina Logo -## My Version and User Story -1. User opens app to see list of Apollo Missions -2. Each mission has an image, title, and launch date -3. Tap on a mission to see more information -4. A new view slides onto the screen -5. New screen has title, image, launch date, long description, and list of crew members +This project is a portion of App Team Carolina's Apprenticeship curriculum. -## What Does Success Look Like? -- Entry point is list of Apollo missions. Use `List` and `ForEach` to achieve this -- For each mission, display the following: - - `Image` with the supplied image in the `assets.xcassets` file - - a `Text` with the title - - a `Text` with the launch date -- Use a `NavigationLink` for each mission to navigation to a `MissionDetailView` -- Create a your own `MissionDetailView` struct that takes in a mission and shows detailed information -- `MissionView` should contain the following - - Navigation Bar Title with mission display name - - Large `Image` with the correct image from `assets.xcassets` - - `Text` with launch date - - `Text` with long description - - `ForEach` over the crew members array inside of the `Mission` struct. Each subview shows - - Crew Member’s `Image` - - Crew Member’s name in a `Text` +## My Implementation +``` +add screenshots/gifs here +``` +``` +add description of project here +``` -## Goal -- (Re)learn how to create lists of data using `List` and `ForEach` -- (Re)learn how to navigate between screens using `NavigationView` and `NavigationLink` - -## Installation and Setup Instructions -1. Clone the starter code repository: [https://github.com/appteamcarolina/p02-apollo](https://github.com/appteamcarolina/p02-apollo.git). -2. Open the `p02-apollo.xccodeproj` file. -3. Browse the files in the `Model` folder and get familiar with `Mission.swift` and `CrewMember.swift` -4. You’re ready to get to work! +## Project Instructions +View project instructions [here](./instructions.md). diff --git a/p02-apollo/instructions.md b/p02-apollo/instructions.md new file mode 100644 index 0000000..549654a --- /dev/null +++ b/p02-apollo/instructions.md @@ -0,0 +1,39 @@ +## Description +Build a simple application to display information about the Apollo missions. + +NASA Apollo Missions +🚀 This project is a modified version of Paul Hudson’s *Moonshot* from 100 Days of SwiftUI + +## My Version and User Story +1. User opens app to see list of Apollo Missions +2. Each mission has an image, title, and launch date +3. Tap on a mission to see more information +4. A new view slides onto the screen +5. New screen has title, image, launch date, long description, and list of crew members + +## What Does Success Look Like? +- Entry point is list of Apollo missions. Use `List` and `ForEach` to achieve this +- For each mission, display the following: + - `Image` with the supplied image in the `assets.xcassets` file + - a `Text` with the title + - a `Text` with the launch date +- Use a `NavigationLink` for each mission to navigation to a `MissionDetailView` +- Create a your own `MissionDetailView` struct that takes in a mission and shows detailed information +- `MissionView` should contain the following + - Navigation Bar Title with mission display name + - Large `Image` with the correct image from `assets.xcassets` + - `Text` with launch date + - `Text` with long description + - `ForEach` over the crew members array inside of the `Mission` struct. Each subview shows + - Crew Member’s `Image` + - Crew Member’s name in a `Text` + +## Goal +- (Re)learn how to create lists of data using `List` and `ForEach` +- (Re)learn how to navigate between screens using `NavigationView` and `NavigationLink` + +## Installation and Setup Instructions +1. Clone the starter code repository: [https://github.com/appteamcarolina/p02-apollo](https://github.com/appteamcarolina/p02-apollo.git). +2. Open the `p02-apollo.xccodeproj` file. +3. Browse the files in the `Model` folder and get familiar with `Mission.swift` and `CrewMember.swift` +4. You’re ready to get to work! diff --git a/p03-flag-refactoring/README.md b/p03-flag-refactoring/README.md index b6ae0ba..29c1fdc 100644 --- a/p03-flag-refactoring/README.md +++ b/p03-flag-refactoring/README.md @@ -1,27 +1,16 @@ -## Description +# Guess the Flag - MVVM -In this at-home project, we’ll be refactoring Guess the Flag, one of our old projects from 100 Days, to use an ObservableObject and use a more MVVM-like project structure. +App Team Carolina Logo -I’ve provided a cleaned-up version of my implementation (originally from June 2020 🤯) that you can use as starter code. You can also replace my project with your old implementation if you’d like. +This project is a portion of App Team Carolina's Apprenticeship curriculum. -## What Does Success Look Like? +## My Implementation +``` +add screenshots/gifs here +``` +``` +add description of project here +``` -- Because we’re just cleaning up code, a user shouldn’t notice that the code changed -- You should refactor all of your View code to be pretty simple - - Present the data provided by the View Model - - Handle button pressed and call methods in the View Model accordingly - -## Goal - -- Start to get comfortable with MVVM and ObservableObject -- Get aquatinted with the concept of refactoring code - -## Installation Instructions - -1. Make sure you’ve forked and cloned the https://github.com/appteamcarolina/apprentice-projects-s22.git repository -2. Visit your forked version of the repo on the GitHub website. - - `https://github.com/<# your GitHub username #>/apprentice-projects-s22` - -3. Fetch and Merge the latest changes. -4. Pull those changes into your local version of the repository. +## Project Instructions +View project instructions [here](./instructions.md). diff --git a/p03-flag-refactoring/instructions.md b/p03-flag-refactoring/instructions.md new file mode 100644 index 0000000..b6ae0ba --- /dev/null +++ b/p03-flag-refactoring/instructions.md @@ -0,0 +1,27 @@ +## Description + +In this at-home project, we’ll be refactoring Guess the Flag, one of our old projects from 100 Days, to use an ObservableObject and use a more MVVM-like project structure. + +I’ve provided a cleaned-up version of my implementation (originally from June 2020 🤯) that you can use as starter code. You can also replace my project with your old implementation if you’d like. + +## What Does Success Look Like? + +- Because we’re just cleaning up code, a user shouldn’t notice that the code changed +- You should refactor all of your View code to be pretty simple + - Present the data provided by the View Model + - Handle button pressed and call methods in the View Model accordingly + +## Goal + +- Start to get comfortable with MVVM and ObservableObject +- Get aquatinted with the concept of refactoring code + +## Installation Instructions + +1. Make sure you’ve forked and cloned the https://github.com/appteamcarolina/apprentice-projects-s22.git repository +2. Visit your forked version of the repo on the GitHub website. + + `https://github.com/<# your GitHub username #>/apprentice-projects-s22` + +3. Fetch and Merge the latest changes. +4. Pull those changes into your local version of the repository. diff --git a/p04-mood-tracker/README.md b/p04-mood-tracker/README.md index 51b0245..d681e87 100644 --- a/p04-mood-tracker/README.md +++ b/p04-mood-tracker/README.md @@ -1,44 +1,16 @@ -## Description -🎭 We’re going to make a simple mood tracker to help us learn MVVM. +# Mood Tracker -basic mood tracker +App Team Carolina Logo -## My Version and User Story +This project is a portion of App Team Carolina's Apprenticeship curriculum. -1. User opens app to see place to add check-in and list of previous check-ins (if there are any) -2. User types their mood into the textfield and presses save -3. That check-in is added to beginning of the list of previous check-ins +## My Implementation +``` +add screenshots/gifs here +``` +``` +add description of project here +``` -## What Does Success Look Like? - -- Your view code does very minimal work and is very simple -- Model: You have created a mood check-in `struct` that: - - Conforms to the `Identifiable` protocol - - Contains a `mood` property of type `String` - - Contains a `timestamp` property of type `Date` - - Contains a `formattedTimestamp` property of type String -- View Model: You have created a `MoodTrackerViewModel` that: - - Conforms to the `ObservableObject` protocol - - Contains an `@Published` array of mood check-ins - - Contains an `@Published` string that holds the new title of a check-in (bound to textfield) - - Contains a method to create and save a new check-in where the timestamp is the current time (`Date()`) -- View: Your `ContentView` has: - - An `@StateObject private` property that holds your View Model - - A `TextField` to type in the mood for a new check-in - - A `Button` that calls the creation method in your View Model - - A ForEach over your View Model’s check-ins array - - Bonus points if you can make it in reverse chronological order - - Hint: its order is *reversed* from the default order if you just append new items - -## Goal -- This project will help us learn the basic idea of MVVM where we separate our business logic from our View code - -## Installation Instructions - -1. Make sure you’ve forked and cloned the https://github.com/appteamcarolina/apprentice-projects-s22.git repository -2. Visit your forked version of the repo on the GitHub website. - - `https://github.com/<# your GitHub username #>/apprentice-projects-s22` - -3. Fetch and Merge the latest changes. -4. Pull those changes into your local version of the repository. +## Project Instructions +View project instructions [here](./instructions.md). diff --git a/p04-mood-tracker/instructions.md b/p04-mood-tracker/instructions.md new file mode 100644 index 0000000..51b0245 --- /dev/null +++ b/p04-mood-tracker/instructions.md @@ -0,0 +1,44 @@ +## Description +🎭 We’re going to make a simple mood tracker to help us learn MVVM. + +basic mood tracker + +## My Version and User Story + +1. User opens app to see place to add check-in and list of previous check-ins (if there are any) +2. User types their mood into the textfield and presses save +3. That check-in is added to beginning of the list of previous check-ins + +## What Does Success Look Like? + +- Your view code does very minimal work and is very simple +- Model: You have created a mood check-in `struct` that: + - Conforms to the `Identifiable` protocol + - Contains a `mood` property of type `String` + - Contains a `timestamp` property of type `Date` + - Contains a `formattedTimestamp` property of type String +- View Model: You have created a `MoodTrackerViewModel` that: + - Conforms to the `ObservableObject` protocol + - Contains an `@Published` array of mood check-ins + - Contains an `@Published` string that holds the new title of a check-in (bound to textfield) + - Contains a method to create and save a new check-in where the timestamp is the current time (`Date()`) +- View: Your `ContentView` has: + - An `@StateObject private` property that holds your View Model + - A `TextField` to type in the mood for a new check-in + - A `Button` that calls the creation method in your View Model + - A ForEach over your View Model’s check-ins array + - Bonus points if you can make it in reverse chronological order + - Hint: its order is *reversed* from the default order if you just append new items + +## Goal +- This project will help us learn the basic idea of MVVM where we separate our business logic from our View code + +## Installation Instructions + +1. Make sure you’ve forked and cloned the https://github.com/appteamcarolina/apprentice-projects-s22.git repository +2. Visit your forked version of the repo on the GitHub website. + + `https://github.com/<# your GitHub username #>/apprentice-projects-s22` + +3. Fetch and Merge the latest changes. +4. Pull those changes into your local version of the repository. diff --git a/p05-socialmedia/README.md b/p05-socialmedia/README.md new file mode 100644 index 0000000..d681e87 --- /dev/null +++ b/p05-socialmedia/README.md @@ -0,0 +1,16 @@ +# Mood Tracker + +App Team Carolina Logo + +This project is a portion of App Team Carolina's Apprenticeship curriculum. + +## My Implementation +``` +add screenshots/gifs here +``` +``` +add description of project here +``` + +## Project Instructions +View project instructions [here](./instructions.md). diff --git a/p05-socialmedia/instructions.md b/p05-socialmedia/instructions.md new file mode 100644 index 0000000..a414ba2 --- /dev/null +++ b/p05-socialmedia/instructions.md @@ -0,0 +1,70 @@ +## Description + +![Screen Shot 2022-02-02 at 1.35.54 PM.png](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/89170759-d6bd-4283-b2f6-9b9edc291bc6/Screen_Shot_2022-02-02_at_1.35.54_PM.png) + +This week, we’ll be building the home feed user interface for a new social media app, **bluebird**. + +**bluebird** takes social media back to it’s roots and focuses on text-based communication. Users are able to create their own content and engage with other users’ posts. + +Here, you can see Sam’s implementation of **bluebird**‘s home feed. None of these buttons actually do anything yet, but that’s okay!! We’re just implementing and prototyping a basic UI. + +## Requirements + +💬 **Individual Post Requirements** +- Display the author’s image, name, and username +- A well-formatted version of the post’s date +- The post’s current like & comment counts +- A button to like/unlike the post +- A button to make a comment (perhaps another `NavigationLink`) +- The actual post content + +🏠 **Home Feed Requirements** +- Display the entire list of posts in a scrollable container (`List` or `ScrollView`) +- Include some way to create a new post (perhaps a `NavigationLink` to a new post view? or maybe a separate tab in a `TabView`?) + +👤 **Profile View Requirements** +- Display the user’s image, name, and username +- A list of all of the user’s posts (can just display same list as homepage before) +- A `NavigationLink` that takes the user to a settings screen where they can: + - change username, name, profile picture, etc. + - delete their account + - Note: this can just be placeholder images, names, etc. + - Actual changing functionality not required + +👤 **ContentView Requirements** +- Use `TabView` to display HomeFeedView and ProfileView as separate tabs +- Feel free to add more if you’d like! + + +## Hints + +🔎 **Here are some hints that might help you out** + +| Name/Link | What it’s used for | +| --- | --- | +| Label | Horizontally aligning/scaling an image and text | +| TabView | Implementing the bottom tab design | +| .toolbar(...) | Adding content to the navigation bar or bottom bar | +| .clipShape(...) | Clipping Views (such as Images) to different shapes | + +## What Does Success Look Like? + +⭐ **You were successful in the first stage of this project if...** +- You’ve displayed all of the example posts on screen +- Each post has buttons to allow all necessary functionality +- You took creative liberty and made the design ~yours~ + +## Goal + +❓ **Why are we doing this?** +- We are doing this project to refine our UI development (and design) skills, and build up the foundation for the rest of this project. + +## Installation Instructions + +1. Make sure you’ve forked and cloned the https://github.com/appteamcarolina/apprentice-projects-s22.git repository +2. Visit your forked version of the repo on the GitHub website. + + `https://github.com/<# your GitHub username #>/apprentice-projects-s22` + +3. Fetch and Merge the latest changes. +4. Pull those changes into your local version of the repository. diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/project.pbxproj b/p05-socialmedia/p05-socialmedia.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f2b82ec --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/project.pbxproj @@ -0,0 +1,454 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 872818FE27B17EFC00E98610 /* HomeFeedViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872818FD27B17EFC00E98610 /* HomeFeedViewModel.swift */; }; + 8728190127B17F2600E98610 /* PostsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8728190027B17F2600E98610 /* PostsService.swift */; }; + 87BC521C27BF47FB00A8A26C /* NewPostViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BC521B27BF47FB00A8A26C /* NewPostViewModel.swift */; }; + 87BC522027BF480D00A8A26C /* NewPostView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BC521F27BF480D00A8A26C /* NewPostView.swift */; }; + BD7155A027A8C81800B51278 /* p05_socialmediaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD71559F27A8C81800B51278 /* p05_socialmediaApp.swift */; }; + BD7155A227A8C81800B51278 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7155A127A8C81800B51278 /* ContentView.swift */; }; + BD7155A427A8C81D00B51278 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD7155A327A8C81D00B51278 /* Assets.xcassets */; }; + BD7155A727A8C81D00B51278 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD7155A627A8C81D00B51278 /* Preview Assets.xcassets */; }; + BD7155AE27A8C8A300B51278 /* PostView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7155AD27A8C8A300B51278 /* PostView.swift */; }; + BD7155B127A8C90600B51278 /* View+bothColorSchemes.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7155B027A8C90600B51278 /* View+bothColorSchemes.swift */; }; + BDB54AB027AB469F00575FAB /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDB54AAF27AB469F00575FAB /* ProfileView.swift */; }; + BDB54AB227AB47B900575FAB /* ProfileSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDB54AB127AB47B900575FAB /* ProfileSettings.swift */; }; + BDEC6A5027AA43C900455104 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEC6A4F27AA43C900455104 /* Post.swift */; }; + BDEC6A5527AA44F100455104 /* DefaultPosts.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEC6A5427AA44F100455104 /* DefaultPosts.swift */; }; + BDEC6A5727AA46D300455104 /* HomeFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEC6A5627AA46D300455104 /* HomeFeedView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 872818FD27B17EFC00E98610 /* HomeFeedViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeFeedViewModel.swift; sourceTree = ""; }; + 8728190027B17F2600E98610 /* PostsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsService.swift; sourceTree = ""; }; + 87BC521B27BF47FB00A8A26C /* NewPostViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewPostViewModel.swift; sourceTree = ""; }; + 87BC521F27BF480D00A8A26C /* NewPostView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewPostView.swift; sourceTree = ""; }; + BD71559C27A8C81800B51278 /* p05-socialmedia.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "p05-socialmedia.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + BD71559F27A8C81800B51278 /* p05_socialmediaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = p05_socialmediaApp.swift; sourceTree = ""; }; + BD7155A127A8C81800B51278 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + BD7155A327A8C81D00B51278 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BD7155A627A8C81D00B51278 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + BD7155AD27A8C8A300B51278 /* PostView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostView.swift; sourceTree = ""; }; + BD7155B027A8C90600B51278 /* View+bothColorSchemes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+bothColorSchemes.swift"; sourceTree = ""; }; + BDB54AAF27AB469F00575FAB /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; + BDB54AB127AB47B900575FAB /* ProfileSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSettings.swift; sourceTree = ""; }; + BDEC6A4F27AA43C900455104 /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = ""; }; + BDEC6A5427AA44F100455104 /* DefaultPosts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultPosts.swift; sourceTree = ""; }; + BDEC6A5627AA46D300455104 /* HomeFeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeFeedView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BD71559927A8C81800B51278 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 872818FF27B17F1300E98610 /* Services */ = { + isa = PBXGroup; + children = ( + 8728190027B17F2600E98610 /* PostsService.swift */, + ); + path = Services; + sourceTree = ""; + }; + 87BC521827BF47E900A8A26C /* New Post */ = { + isa = PBXGroup; + children = ( + 87BC521F27BF480D00A8A26C /* NewPostView.swift */, + 87BC521B27BF47FB00A8A26C /* NewPostViewModel.swift */, + ); + path = "New Post"; + sourceTree = ""; + }; + BD71559327A8C81800B51278 = { + isa = PBXGroup; + children = ( + BD71559E27A8C81800B51278 /* p05-socialmedia */, + BD71559D27A8C81800B51278 /* Products */, + ); + sourceTree = ""; + }; + BD71559D27A8C81800B51278 /* Products */ = { + isa = PBXGroup; + children = ( + BD71559C27A8C81800B51278 /* p05-socialmedia.app */, + ); + name = Products; + sourceTree = ""; + }; + BD71559E27A8C81800B51278 /* p05-socialmedia */ = { + isa = PBXGroup; + children = ( + BD71559F27A8C81800B51278 /* p05_socialmediaApp.swift */, + BD7155A127A8C81800B51278 /* ContentView.swift */, + 872818FF27B17F1300E98610 /* Services */, + BDEC6A5927AA46DD00455104 /* Models */, + 87BC521827BF47E900A8A26C /* New Post */, + BDEC6A5827AA46D600455104 /* Home Feed */, + BDEC6A5A27AA46EF00455104 /* Post */, + BDB54AAE27AB468D00575FAB /* User Profile */, + BDEC6A5327AA44E400455104 /* Default Content */, + BD7155AF27A8C8F800B51278 /* Extensions */, + BD7155A327A8C81D00B51278 /* Assets.xcassets */, + BD7155A527A8C81D00B51278 /* Preview Content */, + ); + path = "p05-socialmedia"; + sourceTree = ""; + }; + BD7155A527A8C81D00B51278 /* Preview Content */ = { + isa = PBXGroup; + children = ( + BD7155A627A8C81D00B51278 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + BD7155AF27A8C8F800B51278 /* Extensions */ = { + isa = PBXGroup; + children = ( + BD7155B027A8C90600B51278 /* View+bothColorSchemes.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + BDB54AAE27AB468D00575FAB /* User Profile */ = { + isa = PBXGroup; + children = ( + BDB54AAF27AB469F00575FAB /* ProfileView.swift */, + BDB54AB127AB47B900575FAB /* ProfileSettings.swift */, + ); + path = "User Profile"; + sourceTree = ""; + }; + BDEC6A5327AA44E400455104 /* Default Content */ = { + isa = PBXGroup; + children = ( + BDEC6A5427AA44F100455104 /* DefaultPosts.swift */, + ); + path = "Default Content"; + sourceTree = ""; + }; + BDEC6A5827AA46D600455104 /* Home Feed */ = { + isa = PBXGroup; + children = ( + BDEC6A5627AA46D300455104 /* HomeFeedView.swift */, + 872818FD27B17EFC00E98610 /* HomeFeedViewModel.swift */, + ); + path = "Home Feed"; + sourceTree = ""; + }; + BDEC6A5927AA46DD00455104 /* Models */ = { + isa = PBXGroup; + children = ( + BDEC6A4F27AA43C900455104 /* Post.swift */, + ); + path = Models; + sourceTree = ""; + }; + BDEC6A5A27AA46EF00455104 /* Post */ = { + isa = PBXGroup; + children = ( + BD7155AD27A8C8A300B51278 /* PostView.swift */, + ); + path = Post; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BD71559B27A8C81800B51278 /* p05-socialmedia */ = { + isa = PBXNativeTarget; + buildConfigurationList = BD7155AA27A8C81D00B51278 /* Build configuration list for PBXNativeTarget "p05-socialmedia" */; + buildPhases = ( + BD71559827A8C81800B51278 /* Sources */, + BD71559927A8C81800B51278 /* Frameworks */, + BD71559A27A8C81800B51278 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "p05-socialmedia"; + productName = "p05-socialmedia"; + productReference = BD71559C27A8C81800B51278 /* p05-socialmedia.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BD71559427A8C81800B51278 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + BD71559B27A8C81800B51278 = { + CreatedOnToolsVersion = 13.2; + }; + }; + }; + buildConfigurationList = BD71559727A8C81800B51278 /* Build configuration list for PBXProject "p05-socialmedia" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BD71559327A8C81800B51278; + productRefGroup = BD71559D27A8C81800B51278 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BD71559B27A8C81800B51278 /* p05-socialmedia */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BD71559A27A8C81800B51278 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BD7155A727A8C81D00B51278 /* Preview Assets.xcassets in Resources */, + BD7155A427A8C81D00B51278 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BD71559827A8C81800B51278 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BDB54AB027AB469F00575FAB /* ProfileView.swift in Sources */, + BD7155B127A8C90600B51278 /* View+bothColorSchemes.swift in Sources */, + BD7155A227A8C81800B51278 /* ContentView.swift in Sources */, + 87BC521C27BF47FB00A8A26C /* NewPostViewModel.swift in Sources */, + BD7155AE27A8C8A300B51278 /* PostView.swift in Sources */, + 8728190127B17F2600E98610 /* PostsService.swift in Sources */, + BD7155A027A8C81800B51278 /* p05_socialmediaApp.swift in Sources */, + BDB54AB227AB47B900575FAB /* ProfileSettings.swift in Sources */, + BDEC6A5527AA44F100455104 /* DefaultPosts.swift in Sources */, + 872818FE27B17EFC00E98610 /* HomeFeedViewModel.swift in Sources */, + 87BC522027BF480D00A8A26C /* NewPostView.swift in Sources */, + BDEC6A5727AA46D300455104 /* HomeFeedView.swift in Sources */, + BDEC6A5027AA43C900455104 /* Post.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + BD7155A827A8C81D00B51278 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + BD7155A927A8C81D00B51278 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BD7155AB27A8C81D00B51278 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"p05-socialmedia/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.p05-socialmedia"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BD7155AC27A8C81D00B51278 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"p05-socialmedia/Preview Content\""; + DEVELOPMENT_TEAM = Q9PPH2T3L2; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.samuelshi.p05-socialmedia"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BD71559727A8C81800B51278 /* Build configuration list for PBXProject "p05-socialmedia" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD7155A827A8C81D00B51278 /* Debug */, + BD7155A927A8C81D00B51278 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BD7155AA27A8C81D00B51278 /* Build configuration list for PBXNativeTarget "p05-socialmedia" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD7155AB27A8C81D00B51278 /* Debug */, + BD7155AC27A8C81D00B51278 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BD71559427A8C81800B51278 /* Project object */; +} diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..fa3bd9c Binary files /dev/null and b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/hawkeyeshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..edfbe47 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia.xcodeproj/project.xcworkspace/xcuserdata/samrshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/hawkeyeshi.xcuserdatad/xcschemes/xcschememanagement.plist b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/hawkeyeshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..cfaad13 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/hawkeyeshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + p05-socialmedia.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..0040d35 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..cfaad13 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia.xcodeproj/xcuserdata/samrshi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + p05-socialmedia.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/AccentColor.colorset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/AppIcon.appiconset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/Contents.json new file mode 100644 index 0000000..c5b5385 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "appteam.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/appteam.jpg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/appteam.jpg new file mode 100644 index 0000000..95e0bea Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/appteam.imageset/appteam.jpg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/Contents.json new file mode 100644 index 0000000..81d4927 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "bluebird.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/bluebird.jpeg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/bluebird.jpeg new file mode 100644 index 0000000..3bbc279 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/bluebird.imageset/bluebird.jpeg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Image.png new file mode 100644 index 0000000..21b126c Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/buffett.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Image.png new file mode 100644 index 0000000..dae0a3e Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/cathie.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Image.png new file mode 100644 index 0000000..7bf757c Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/elon.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/Contents.json new file mode 100644 index 0000000..553e71f --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "headshot.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/headshot.jpg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/headshot.jpg new file mode 100644 index 0000000..94aef16 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/headshot.imageset/headshot.jpg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Image.png new file mode 100644 index 0000000..4b122db Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/lisasu.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/Contents.json new file mode 100644 index 0000000..22feac7 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "paul.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/paul.jpg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/paul.jpg new file mode 100644 index 0000000..1bd3b77 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/paul.imageset/paul.jpg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/Contents.json new file mode 100644 index 0000000..df354b1 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "sam.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/sam.jpg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/sam.jpg new file mode 100644 index 0000000..bae3478 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/sam.imageset/sam.jpg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Image.png new file mode 100644 index 0000000..687ac91 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/saylor.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/Contents.json new file mode 100644 index 0000000..e72d427 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "scaryzuck.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/scaryzuck.jpeg b/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/scaryzuck.jpeg new file mode 100644 index 0000000..57d9e20 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/scaryzuck.imageset/scaryzuck.jpeg differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Image.png new file mode 100644 index 0000000..89fd1c2 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/timapple.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Contents.json b/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Contents.json new file mode 100644 index 0000000..17f6fd9 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Image.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Image.png b/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Image.png new file mode 100644 index 0000000..41f6c16 Binary files /dev/null and b/p05-socialmedia/p05-socialmedia/Assets.xcassets/trump.imageset/Image.png differ diff --git a/p05-socialmedia/p05-socialmedia/ContentView.swift b/p05-socialmedia/p05-socialmedia/ContentView.swift new file mode 100644 index 0000000..e26eb55 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/ContentView.swift @@ -0,0 +1,35 @@ +// +// ContentView.swift +// p05-socialmedia +// +// Created by Samuel Shi on 1/31/22. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + TabView { + HomeFeedView() + .tabItem { + Label("Home", systemImage: "house") + } + + NewPostView() + .tabItem { + Label("New Post", systemImage: "plus.circle") + } + + Text("Profile") + .tabItem { + Label("Profile", systemImage: "person") + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView().bothColorSchemes() + } +} diff --git a/p05-socialmedia/p05-socialmedia/Default Content/DefaultPosts.swift b/p05-socialmedia/p05-socialmedia/Default Content/DefaultPosts.swift new file mode 100644 index 0000000..3dc3158 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Default Content/DefaultPosts.swift @@ -0,0 +1,131 @@ +// +// DefaultPosts.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/1/22. +// + +import Foundation + +enum PostList { + static let defaultPosts = [ + Post(id: UUID(), + authorName: "Blue Bird", + authorUsername: "bluebird", + authorImageAddress: "bluebird", + datePosted: Date(timeIntervalSince1970: 1643793600), + postContent: "After much deliberation, bluebird is excited to announce a brand new feature on our roadmap that will change social media forever.\n\nImages.\n\nImages will make possible the richest, most unique social media experience that our users have ever experienced.", + likeCount: 4206, + commentCount: 950), + + Post(id: UUID(), + authorName: "Mark Z.", + authorUsername: "markzuckerberg", + authorImageAddress: "scaryzuck", + datePosted: Date(timeIntervalSince1970: 1643777999), + postContent: "Why doesn’t this app support image posts? Thought we moved past text-based platforms in 2003 #NerfMiner", + likeCount: 69, + commentCount: 567), + + Post(id: UUID(), + authorName: "Paul Hudson", + authorUsername: "twostraws", + authorImageAddress: "paul", + datePosted: Date(timeIntervalSince1970: 1642888800), + postContent: "It was lovely to meet you all! UNC Chapel Hill has a fantastic reputation, not least because of the groundbreaking work of Dr Brooks 🙌", + likeCount: 3, + commentCount: 1), + + Post(id: UUID(), + authorName: "Sam Shi", + authorUsername: "samrshi", + authorImageAddress: "sam", + datePosted: Date(timeIntervalSince1970: 1642870800), + postContent: "I'm very excited to have put another app on the App Store! Navvy, which I've shown on Twitter a bit before, is just what you need to find your destination and develop your sense of direction.", + likeCount: 25, + commentCount: 5), + + Post(id: UUID(), + authorName: "App Team Carolina", + authorUsername: "appteamcarolina", + authorImageAddress: "appteam", + datePosted: Date(timeIntervalSince1970: 1642266000), + postContent: "Are you interested in becoming a part of one of the only college iOS teams in the nation? Apply NOW through our bio! Applications are due 1/18 by 11:59 pm!", + likeCount: 3, + commentCount: 0), + + Post(id: UUID(), + authorName: "Elon Musk", + authorUsername: "elonmusk", + authorImageAddress: "elon", + datePosted: Date(timeIntervalSince1970: 1643826194), + postContent: "Exciting progress at Starbase, Texas!", + likeCount: 86123, + commentCount: 5432), + + Post(id: UUID(), + authorName: "Michael Saylor⚡️", + authorUsername: "saylor", + authorImageAddress: "saylor", + datePosted: Date(timeIntervalSince1970: 1643818994), + postContent: "The #bitcoin remains the same.", + likeCount: 6253, + commentCount: 545), + + Post(id: UUID(), + authorName: "Tim Cook", + authorUsername: "tim_apple", + authorImageAddress: "timapple", + datePosted: Date(timeIntervalSince1970: 1643646194), + postContent: "Sending wishes of joy to all those celebrating Lunar New Year. May this Year of the Tiger bring you courage and strength. Beautiful #ShotoniPhone photo by Zerry Song.", + likeCount: 5903, + commentCount: 216), + + Post(id: UUID(), + authorName: "Money Tree", + authorUsername: "CathieDWood", + authorImageAddress: "cathie", + datePosted: Date(timeIntervalSince1970: 1643214194), + postContent: "For perspective, today global GDP is roughly $100 trillion.\n\nAutonomous mobility is a big idea!", + likeCount: 1738, + commentCount: 320), + + Post(id: UUID(), + authorName: "Donald J. Trump", + authorUsername: "realDonaldTrump", + authorImageAddress: "trump", + datePosted: Date(timeIntervalSince1970: 1642695794), + postContent: "Account suspended.", + likeCount: 0, + commentCount: 0), + + Post(id: UUID(), + authorName: "Lisa Su", + authorUsername: "lisasu", + authorImageAddress: "lisasu", + datePosted: Date(timeIntervalSince1970: 1641399794), + postContent: "Thanks to all who joined our #AMD2022 Product Premiere. Look forward to a lot more to come for.\n@AMDRyzen\n@Radeon\nthis year!", + likeCount: 2540, + commentCount: 102), + + Post(id: UUID(), + authorName: "Warren Buffett", + authorUsername: "WarrenBuffett", + authorImageAddress: "buffett", + datePosted: Date(timeIntervalSince1970: 1367511794), + postContent: "Warren is in the house.", + likeCount: 22795, + commentCount: 6837) + ] +} + +extension Post { + static let example = Post(id: UUID(), + authorName: "Blue Bird", + authorUsername: "bluebird", + authorImageAddress: "bluebird", + datePosted: Date(timeIntervalSince1970: 1643793600), + postContent: "After much deliberation, bluebird is excited to announce a brand new feature on our roadmap that will change social media forever.\n\nImages.\n\nImages will make possible the richest, most unique social media experience that our users have ever experienced.", + likeCount: 4206, + commentCount: 950) +} diff --git a/p05-socialmedia/p05-socialmedia/Extensions/View+bothColorSchemes.swift b/p05-socialmedia/p05-socialmedia/Extensions/View+bothColorSchemes.swift new file mode 100644 index 0000000..b0cb61a --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Extensions/View+bothColorSchemes.swift @@ -0,0 +1,17 @@ +// +// View+bothColorSchemes.swift +// ex00-instagram +// +// Created by Samuel Shi on 1/27/22. +// + +import SwiftUI + +extension View { + func bothColorSchemes() -> some View { + Group { + self.preferredColorScheme(.dark) + self.preferredColorScheme(.light) + } + } +} diff --git a/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedView.swift b/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedView.swift new file mode 100644 index 0000000..9a74be7 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedView.swift @@ -0,0 +1,33 @@ +// +// HomeFeedView.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/1/22. +// + +import SwiftUI + +struct HomeFeedView: View { + @StateObject var vm = HomeFeedViewModel() + + var body: some View { + NavigationView { + List { + ForEach(vm.posts) { post in + PostView(post: post) + } + } + .listStyle(.plain) + .navigationTitle("bluebird") + } + .onAppear(perform: { + vm.fetchPosts() + }) + } +} + +struct HomeFeedView_Previews: PreviewProvider { + static var previews: some View { + HomeFeedView().bothColorSchemes() + } +} diff --git a/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedViewModel.swift b/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedViewModel.swift new file mode 100644 index 0000000..cba5b26 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Home Feed/HomeFeedViewModel.swift @@ -0,0 +1,21 @@ +// +// HomeFeedViewModel.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/7/22. +// + +import Foundation + +@MainActor +class HomeFeedViewModel: ObservableObject { + @Published var posts: [Post] = [] + + init() { + fetchPosts() + } + + func fetchPosts() { + posts = PostsService.getHomeFeed() + } +} diff --git a/p05-socialmedia/p05-socialmedia/Model.xcdatamodeld/Model.xcdatamodel/contents b/p05-socialmedia/p05-socialmedia/Model.xcdatamodeld/Model.xcdatamodel/contents new file mode 100644 index 0000000..51680da --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Model.xcdatamodeld/Model.xcdatamodel/contents @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/p05-socialmedia/p05-socialmedia/Models/Post.swift b/p05-socialmedia/p05-socialmedia/Models/Post.swift new file mode 100644 index 0000000..c9d2014 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Models/Post.swift @@ -0,0 +1,36 @@ +// +// Post.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/1/22. +// + +import Foundation + +struct Post: Identifiable, Codable { + let id: UUID + + let authorName: String + let authorUsername: String + let authorImageAddress: String // currently just an asset catolog image, will be a url + + let datePosted: Date + let postContent: String + var likeCount: Int + var commentCount: Int + + // once again, this should probably live in a post view model, but we'll add that later + var formattedDate: String { + let formatter = DateFormatter() + let sameYear = Calendar.current.isDate(Date(), + equalTo: datePosted, + toGranularity: .year) + if sameYear { + formatter.dateFormat = "MMM d" + } else { + formatter.dateFormat = "MMM d, y" + } + + return formatter.string(from: datePosted) + } +} diff --git a/p05-socialmedia/p05-socialmedia/New Post/NewPostView.swift b/p05-socialmedia/p05-socialmedia/New Post/NewPostView.swift new file mode 100644 index 0000000..d4394bc --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/New Post/NewPostView.swift @@ -0,0 +1,44 @@ +// +// NewPostView.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/17/22. +// + +import SwiftUI + +struct NewPostView: View { + @StateObject var vm = NewPostViewModel() + + var body: some View { + NavigationView { + VStack { + ZStack(alignment: .topLeading) { + TextEditor(text: $vm.currentText) + + if vm.currentText.isEmpty { + Text("What's happening?") + .foregroundColor(.secondary) + .padding(8) + } + } + } + .cornerRadius(10) + .padding() + .navigationTitle("Create Post") + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button("Post") { + vm.makePost() + } + } + } + } + } +} + +struct NewPostView_Previews: PreviewProvider { + static var previews: some View { + NewPostView().bothColorSchemes() + } +} diff --git a/p05-socialmedia/p05-socialmedia/New Post/NewPostViewModel.swift b/p05-socialmedia/p05-socialmedia/New Post/NewPostViewModel.swift new file mode 100644 index 0000000..b454a35 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/New Post/NewPostViewModel.swift @@ -0,0 +1,25 @@ +// +// NewPostViewModel.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/17/22. +// + +import Foundation + +class NewPostViewModel: ObservableObject { + @Published var currentText: String = "" + + func makePost() { + let post = Post(id: UUID(), + authorName: "Sam Shi", + authorUsername: "samrshi", + authorImageAddress: "sam", + datePosted: Date(), + postContent: currentText, + likeCount: 0, + commentCount: 0) + PostsService.makePost(post: post) + currentText = "" + } +} diff --git a/p05-socialmedia/p05-socialmedia/Post/PostView.swift b/p05-socialmedia/p05-socialmedia/Post/PostView.swift new file mode 100644 index 0000000..cf63842 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Post/PostView.swift @@ -0,0 +1,48 @@ +// +// PostView.swift +// p05-socialmedia +// +// Created by Samuel Shi on 1/31/22. +// + +import SwiftUI + +struct PostView: View { + let post: Post + + var body: some View { + VStack(spacing: 15) { + HStack { + Image(post.authorImageAddress) + .resizable() + .frame(width: 50, height: 50) + .clipShape(Circle()) + + VStack(alignment: .leading) { + Text(post.authorName) + Text(post.authorUsername) + .foregroundColor(.secondary) + .font(.callout) + } + + Spacer() + } + + Text(post.postContent) + .frame(maxWidth: .infinity, alignment: .leading) + + HStack { + Label("\(post.likeCount)", systemImage: "heart") + Label("\(post.commentCount)", systemImage: "heart") + Spacer() + } + } + } +} + +struct PostView_Previews: PreviewProvider { + static var previews: some View { + PostView(post: .example) + .bothColorSchemes() + } +} diff --git a/p05-socialmedia/p05-socialmedia/Preview Content/Preview Assets.xcassets/Contents.json b/p05-socialmedia/p05-socialmedia/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/p05-socialmedia/p05-socialmedia/Services/PostsService.swift b/p05-socialmedia/p05-socialmedia/Services/PostsService.swift new file mode 100644 index 0000000..ed45a19 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/Services/PostsService.swift @@ -0,0 +1,20 @@ +// +// HomeFeedService.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/7/22. +// + +import Foundation + +struct PostsService { + static private var posts: [Post] = PostList.defaultPosts + + static func getHomeFeed() -> [Post] { + return posts + } + + static func makePost(post: Post) { + posts.insert(post, at: 0) + } +} diff --git a/p05-socialmedia/p05-socialmedia/User Profile/ProfileSettings.swift b/p05-socialmedia/p05-socialmedia/User Profile/ProfileSettings.swift new file mode 100644 index 0000000..fa38fc2 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/User Profile/ProfileSettings.swift @@ -0,0 +1,20 @@ +// +// ProfileSettings.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/2/22. +// + +import SwiftUI + +struct ProfileSettings: View { + var body: some View { + Text("Hello, World!") + } +} + +struct ProfileSettings_Previews: PreviewProvider { + static var previews: some View { + ProfileSettings() + } +} diff --git a/p05-socialmedia/p05-socialmedia/User Profile/ProfileView.swift b/p05-socialmedia/p05-socialmedia/User Profile/ProfileView.swift new file mode 100644 index 0000000..eb2858b --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/User Profile/ProfileView.swift @@ -0,0 +1,26 @@ +// +// ProfileView.swift +// p05-socialmedia +// +// Created by Samuel Shi on 2/2/22. +// + +import SwiftUI + +struct ProfileView: View { + let name: String = "App Team Carolina" + let username: String = "appteamcarolina" + let profileImageAddress: String = "appteam" // will eventually be url + + let userPosts: [Post] = PostList.defaultPosts + + var body: some View { + Text("Hello, World!") + } +} + +struct ProfileView_Previews: PreviewProvider { + static var previews: some View { + ProfileView() + } +} diff --git a/p05-socialmedia/p05-socialmedia/p05_socialmediaApp.swift b/p05-socialmedia/p05-socialmedia/p05_socialmediaApp.swift new file mode 100644 index 0000000..613e299 --- /dev/null +++ b/p05-socialmedia/p05-socialmedia/p05_socialmediaApp.swift @@ -0,0 +1,17 @@ +// +// p05_socialmediaApp.swift +// p05-socialmedia +// +// Created by Samuel Shi on 1/31/22. +// + +import SwiftUI + +@main +struct p05_socialmediaApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +}