├── .gitignore ├── MooTime Creamery.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── MooTime Creamery.xcscheme └── xcuserdata │ └── rodrigosoares.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── MooTime Creamery ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon.png │ │ ├── icon_20pt.png │ │ ├── icon_20pt@2x.png │ │ ├── icon_20pt@3x.png │ │ ├── icon_29pt.png │ │ ├── icon_29pt@2x.png │ │ ├── icon_29pt@3x.png │ │ ├── icon_40pt.png │ │ ├── icon_40pt@2x.png │ │ ├── icon_40pt@3x.png │ │ ├── icon_60pt@2x.png │ │ ├── icon_60pt@3x.png │ │ ├── icon_76pt.png │ │ ├── icon_76pt@2x.png │ │ └── icon_83.5@2x.png │ ├── Contents.json │ ├── blueberry.imageset │ │ ├── Contents.json │ │ └── blueberry.png │ ├── mango.imageset │ │ ├── Contents.json │ │ └── mango.png │ ├── mocha.imageset │ │ ├── Contents.json │ │ └── mocha.png │ ├── strawberry.imageset │ │ ├── Contents.json │ │ └── strawberry.png │ └── vanilla.imageset │ │ ├── Contents.json │ │ └── vanilla.png ├── Base.lproj │ └── LaunchScreen.storyboard ├── BlurView.swift ├── CardView.swift ├── CartView.swift ├── DetailView.swift ├── Info.plist ├── Model │ ├── Data.swift │ └── Product.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── ProductList.swift ├── Resources │ ├── blueberry.png │ ├── data.json │ ├── ios │ │ ├── ice-cream-22@1x.png │ │ ├── ice-cream-22@2x.png │ │ └── ice-cream-22@3x.png │ ├── mango.png │ ├── mocha.png │ ├── strawberry.png │ └── vanilla.png ├── SceneDelegate.swift └── StarsView.swift ├── README.md └── gifs ├── swiftui_1.gif └── swiftui_2.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | # 51 | # Add this line if you want to avoid checking in source code from the Xcode workspace 52 | # *.xcworkspace 53 | 54 | # Carthage 55 | # 56 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 57 | # Carthage/Checkouts 58 | 59 | Carthage/Build 60 | 61 | # Accio dependency management 62 | Dependencies/ 63 | .accio/ 64 | 65 | # fastlane 66 | # 67 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 68 | # screenshots whenever they are needed. 69 | # For more information about the recommended setup visit: 70 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 71 | 72 | fastlane/report.xml 73 | fastlane/Preview.html 74 | fastlane/screenshots/**/*.png 75 | fastlane/test_output 76 | 77 | # Code Injection 78 | # 79 | # After new code Injection tools there's a generated folder /iOSInjectionProject 80 | # https://github.com/johnno1962/injectionforxcode 81 | 82 | iOSInjectionProject/ -------------------------------------------------------------------------------- /MooTime Creamery.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A2128C1922C7FB7C00B04FC7 /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2128C1822C7FB7C00B04FC7 /* CardView.swift */; }; 11 | A231606D22CC5E4A00045BB6 /* BlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A231606C22CC5E4A00045BB6 /* BlurView.swift */; }; 12 | A24B72BA22C56A710006BE0A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72B922C56A710006BE0A /* AppDelegate.swift */; }; 13 | A24B72BC22C56A710006BE0A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72BB22C56A710006BE0A /* SceneDelegate.swift */; }; 14 | A24B72BE22C56A710006BE0A /* DetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72BD22C56A710006BE0A /* DetailView.swift */; }; 15 | A24B72C022C56A730006BE0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A24B72BF22C56A730006BE0A /* Assets.xcassets */; }; 16 | A24B72C322C56A730006BE0A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A24B72C222C56A730006BE0A /* Preview Assets.xcassets */; }; 17 | A24B72C622C56A730006BE0A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A24B72C422C56A730006BE0A /* LaunchScreen.storyboard */; }; 18 | A24B72CF22C571AB0006BE0A /* data.json in Resources */ = {isa = PBXBuildFile; fileRef = A24B72CE22C571AB0006BE0A /* data.json */; }; 19 | A24B72D222C577950006BE0A /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72D122C577950006BE0A /* Data.swift */; }; 20 | A24B72D422C577E80006BE0A /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72D322C577E80006BE0A /* Product.swift */; }; 21 | A24B72D822C59BD70006BE0A /* StarsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24B72D722C59BD70006BE0A /* StarsView.swift */; }; 22 | A262B39822C7F0DB009B7E93 /* ProductList.swift in Sources */ = {isa = PBXBuildFile; fileRef = A262B39722C7F0DB009B7E93 /* ProductList.swift */; }; 23 | A2708CAC22C8848700E3544C /* CartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2708CAB22C8848700E3544C /* CartView.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | A2128C1822C7FB7C00B04FC7 /* CardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = ""; }; 28 | A231606C22CC5E4A00045BB6 /* BlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurView.swift; sourceTree = ""; }; 29 | A24B72B622C56A710006BE0A /* MooTime Creamery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MooTime Creamery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | A24B72B922C56A710006BE0A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 31 | A24B72BB22C56A710006BE0A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 32 | A24B72BD22C56A710006BE0A /* DetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailView.swift; sourceTree = ""; }; 33 | A24B72BF22C56A730006BE0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | A24B72C222C56A730006BE0A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 35 | A24B72C522C56A730006BE0A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 36 | A24B72C722C56A730006BE0A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | A24B72CE22C571AB0006BE0A /* data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = data.json; sourceTree = ""; }; 38 | A24B72D122C577950006BE0A /* Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; 39 | A24B72D322C577E80006BE0A /* Product.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Product.swift; sourceTree = ""; }; 40 | A24B72D722C59BD70006BE0A /* StarsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StarsView.swift; sourceTree = ""; }; 41 | A262B39722C7F0DB009B7E93 /* ProductList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductList.swift; sourceTree = ""; }; 42 | A2708CAB22C8848700E3544C /* CartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartView.swift; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | A24B72B322C56A710006BE0A /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | A24B72AD22C56A710006BE0A = { 57 | isa = PBXGroup; 58 | children = ( 59 | A24B72B822C56A710006BE0A /* MooTime Creamery */, 60 | A24B72B722C56A710006BE0A /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | A24B72B722C56A710006BE0A /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | A24B72B622C56A710006BE0A /* MooTime Creamery.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | A24B72B822C56A710006BE0A /* MooTime Creamery */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | A24B72D022C577790006BE0A /* Model */, 76 | A24B72B922C56A710006BE0A /* AppDelegate.swift */, 77 | A24B72BB22C56A710006BE0A /* SceneDelegate.swift */, 78 | A24B72BD22C56A710006BE0A /* DetailView.swift */, 79 | A231606C22CC5E4A00045BB6 /* BlurView.swift */, 80 | A262B39722C7F0DB009B7E93 /* ProductList.swift */, 81 | A2128C1822C7FB7C00B04FC7 /* CardView.swift */, 82 | A2708CAB22C8848700E3544C /* CartView.swift */, 83 | A24B72D722C59BD70006BE0A /* StarsView.swift */, 84 | A24B72BF22C56A730006BE0A /* Assets.xcassets */, 85 | A24B72C422C56A730006BE0A /* LaunchScreen.storyboard */, 86 | A24B72C722C56A730006BE0A /* Info.plist */, 87 | A24B72CD22C56B200006BE0A /* Resources */, 88 | A24B72C122C56A730006BE0A /* Preview Content */, 89 | ); 90 | path = "MooTime Creamery"; 91 | sourceTree = ""; 92 | }; 93 | A24B72C122C56A730006BE0A /* Preview Content */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | A24B72C222C56A730006BE0A /* Preview Assets.xcassets */, 97 | ); 98 | path = "Preview Content"; 99 | sourceTree = ""; 100 | }; 101 | A24B72CD22C56B200006BE0A /* Resources */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | A24B72CE22C571AB0006BE0A /* data.json */, 105 | ); 106 | path = Resources; 107 | sourceTree = ""; 108 | }; 109 | A24B72D022C577790006BE0A /* Model */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | A24B72D122C577950006BE0A /* Data.swift */, 113 | A24B72D322C577E80006BE0A /* Product.swift */, 114 | ); 115 | path = Model; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | A24B72B522C56A710006BE0A /* MooTime Creamery */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = A24B72CA22C56A730006BE0A /* Build configuration list for PBXNativeTarget "MooTime Creamery" */; 124 | buildPhases = ( 125 | A24B72B222C56A710006BE0A /* Sources */, 126 | A24B72B322C56A710006BE0A /* Frameworks */, 127 | A24B72B422C56A710006BE0A /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = "MooTime Creamery"; 134 | productName = "MooTime Creamery"; 135 | productReference = A24B72B622C56A710006BE0A /* MooTime Creamery.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | /* End PBXNativeTarget section */ 139 | 140 | /* Begin PBXProject section */ 141 | A24B72AE22C56A710006BE0A /* Project object */ = { 142 | isa = PBXProject; 143 | attributes = { 144 | LastSwiftUpdateCheck = 1100; 145 | LastUpgradeCheck = 1100; 146 | ORGANIZATIONNAME = "Rodrigo Soares"; 147 | TargetAttributes = { 148 | A24B72B522C56A710006BE0A = { 149 | CreatedOnToolsVersion = 11.0; 150 | }; 151 | }; 152 | }; 153 | buildConfigurationList = A24B72B122C56A710006BE0A /* Build configuration list for PBXProject "MooTime Creamery" */; 154 | compatibilityVersion = "Xcode 9.3"; 155 | developmentRegion = en; 156 | hasScannedForEncodings = 0; 157 | knownRegions = ( 158 | en, 159 | Base, 160 | ); 161 | mainGroup = A24B72AD22C56A710006BE0A; 162 | productRefGroup = A24B72B722C56A710006BE0A /* Products */; 163 | projectDirPath = ""; 164 | projectRoot = ""; 165 | targets = ( 166 | A24B72B522C56A710006BE0A /* MooTime Creamery */, 167 | ); 168 | }; 169 | /* End PBXProject section */ 170 | 171 | /* Begin PBXResourcesBuildPhase section */ 172 | A24B72B422C56A710006BE0A /* Resources */ = { 173 | isa = PBXResourcesBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | A24B72C622C56A730006BE0A /* LaunchScreen.storyboard in Resources */, 177 | A24B72C322C56A730006BE0A /* Preview Assets.xcassets in Resources */, 178 | A24B72C022C56A730006BE0A /* Assets.xcassets in Resources */, 179 | A24B72CF22C571AB0006BE0A /* data.json in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | A24B72B222C56A710006BE0A /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | A2708CAC22C8848700E3544C /* CartView.swift in Sources */, 191 | A24B72BA22C56A710006BE0A /* AppDelegate.swift in Sources */, 192 | A24B72BC22C56A710006BE0A /* SceneDelegate.swift in Sources */, 193 | A24B72D422C577E80006BE0A /* Product.swift in Sources */, 194 | A262B39822C7F0DB009B7E93 /* ProductList.swift in Sources */, 195 | A24B72BE22C56A710006BE0A /* DetailView.swift in Sources */, 196 | A24B72D822C59BD70006BE0A /* StarsView.swift in Sources */, 197 | A231606D22CC5E4A00045BB6 /* BlurView.swift in Sources */, 198 | A2128C1922C7FB7C00B04FC7 /* CardView.swift in Sources */, 199 | A24B72D222C577950006BE0A /* Data.swift in Sources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXSourcesBuildPhase section */ 204 | 205 | /* Begin PBXVariantGroup section */ 206 | A24B72C422C56A730006BE0A /* LaunchScreen.storyboard */ = { 207 | isa = PBXVariantGroup; 208 | children = ( 209 | A24B72C522C56A730006BE0A /* Base */, 210 | ); 211 | name = LaunchScreen.storyboard; 212 | sourceTree = ""; 213 | }; 214 | /* End PBXVariantGroup section */ 215 | 216 | /* Begin XCBuildConfiguration section */ 217 | A24B72C822C56A730006BE0A /* Debug */ = { 218 | isa = XCBuildConfiguration; 219 | buildSettings = { 220 | ALWAYS_SEARCH_USER_PATHS = NO; 221 | CLANG_ANALYZER_NONNULL = YES; 222 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 223 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 224 | CLANG_CXX_LIBRARY = "libc++"; 225 | CLANG_ENABLE_MODULES = YES; 226 | CLANG_ENABLE_OBJC_ARC = YES; 227 | CLANG_ENABLE_OBJC_WEAK = YES; 228 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 229 | CLANG_WARN_BOOL_CONVERSION = YES; 230 | CLANG_WARN_COMMA = YES; 231 | CLANG_WARN_CONSTANT_CONVERSION = YES; 232 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 233 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 234 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INFINITE_RECURSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 241 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 244 | CLANG_WARN_STRICT_PROTOTYPES = YES; 245 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 246 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 247 | CLANG_WARN_UNREACHABLE_CODE = YES; 248 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 249 | COPY_PHASE_STRIP = NO; 250 | DEBUG_INFORMATION_FORMAT = dwarf; 251 | ENABLE_STRICT_OBJC_MSGSEND = YES; 252 | ENABLE_TESTABILITY = YES; 253 | GCC_C_LANGUAGE_STANDARD = gnu11; 254 | GCC_DYNAMIC_NO_PIC = NO; 255 | GCC_NO_COMMON_BLOCKS = YES; 256 | GCC_OPTIMIZATION_LEVEL = 0; 257 | GCC_PREPROCESSOR_DEFINITIONS = ( 258 | "DEBUG=1", 259 | "$(inherited)", 260 | ); 261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 263 | GCC_WARN_UNDECLARED_SELECTOR = YES; 264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 265 | GCC_WARN_UNUSED_FUNCTION = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 268 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 269 | MTL_FAST_MATH = YES; 270 | ONLY_ACTIVE_ARCH = YES; 271 | SDKROOT = iphoneos; 272 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 273 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 274 | }; 275 | name = Debug; 276 | }; 277 | A24B72C922C56A730006BE0A /* Release */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_NONNULL = YES; 282 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_ENABLE_OBJC_WEAK = YES; 288 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 289 | CLANG_WARN_BOOL_CONVERSION = YES; 290 | CLANG_WARN_COMMA = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 295 | CLANG_WARN_EMPTY_BODY = YES; 296 | CLANG_WARN_ENUM_CONVERSION = YES; 297 | CLANG_WARN_INFINITE_RECURSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 300 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 301 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 304 | CLANG_WARN_STRICT_PROTOTYPES = YES; 305 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 306 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 307 | CLANG_WARN_UNREACHABLE_CODE = YES; 308 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 309 | COPY_PHASE_STRIP = NO; 310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 311 | ENABLE_NS_ASSERTIONS = NO; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu11; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 317 | GCC_WARN_UNDECLARED_SELECTOR = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 319 | GCC_WARN_UNUSED_FUNCTION = YES; 320 | GCC_WARN_UNUSED_VARIABLE = YES; 321 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 322 | MTL_ENABLE_DEBUG_INFO = NO; 323 | MTL_FAST_MATH = YES; 324 | SDKROOT = iphoneos; 325 | SWIFT_COMPILATION_MODE = wholemodule; 326 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 327 | VALIDATE_PRODUCT = YES; 328 | }; 329 | name = Release; 330 | }; 331 | A24B72CB22C56A730006BE0A /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | CODE_SIGN_STYLE = Automatic; 336 | DEVELOPMENT_ASSET_PATHS = "\"MooTime Creamery\"/Preview\\ Content"; 337 | ENABLE_PREVIEWS = YES; 338 | INFOPLIST_FILE = "MooTime Creamery/Info.plist"; 339 | LD_RUNPATH_SEARCH_PATHS = ( 340 | "$(inherited)", 341 | "@executable_path/Frameworks", 342 | ); 343 | PRODUCT_BUNDLE_IDENTIFIER = "com.taptap.ninja.MooTime-Creamery"; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | SWIFT_VERSION = 5.0; 346 | TARGETED_DEVICE_FAMILY = "1,2"; 347 | }; 348 | name = Debug; 349 | }; 350 | A24B72CC22C56A730006BE0A /* Release */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 354 | CODE_SIGN_STYLE = Automatic; 355 | DEVELOPMENT_ASSET_PATHS = "\"MooTime Creamery\"/Preview\\ Content"; 356 | ENABLE_PREVIEWS = YES; 357 | INFOPLIST_FILE = "MooTime Creamery/Info.plist"; 358 | LD_RUNPATH_SEARCH_PATHS = ( 359 | "$(inherited)", 360 | "@executable_path/Frameworks", 361 | ); 362 | PRODUCT_BUNDLE_IDENTIFIER = "com.taptap.ninja.MooTime-Creamery"; 363 | PRODUCT_NAME = "$(TARGET_NAME)"; 364 | SWIFT_VERSION = 5.0; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | }; 367 | name = Release; 368 | }; 369 | /* End XCBuildConfiguration section */ 370 | 371 | /* Begin XCConfigurationList section */ 372 | A24B72B122C56A710006BE0A /* Build configuration list for PBXProject "MooTime Creamery" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | A24B72C822C56A730006BE0A /* Debug */, 376 | A24B72C922C56A730006BE0A /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | A24B72CA22C56A730006BE0A /* Build configuration list for PBXNativeTarget "MooTime Creamery" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | A24B72CB22C56A730006BE0A /* Debug */, 385 | A24B72CC22C56A730006BE0A /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | /* End XCConfigurationList section */ 391 | }; 392 | rootObject = A24B72AE22C56A710006BE0A /* Project object */; 393 | } 394 | -------------------------------------------------------------------------------- /MooTime Creamery.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MooTime Creamery.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MooTime Creamery.xcodeproj/xcshareddata/xcschemes/MooTime Creamery.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 61 | 71 | 73 | 79 | 80 | 81 | 82 | 88 | 90 | 96 | 97 | 98 | 99 | 101 | 102 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /MooTime Creamery.xcodeproj/xcuserdata/rodrigosoares.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MooTime Creamery.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A24B72B522C56A710006BE0A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MooTime Creamery/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | 18 | let color = #colorLiteral(red: 0.2, green: 0, blue: 0.368627451, alpha: 1) 19 | let attributes = [NSAttributedString.Key.foregroundColor:color] 20 | 21 | UINavigationBar.appearance().titleTextAttributes = attributes 22 | UINavigationBar.appearance().largeTitleTextAttributes = attributes 23 | return true 24 | } 25 | 26 | func applicationWillTerminate(_ application: UIApplication) { 27 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 28 | } 29 | 30 | // MARK: UISceneSession Lifecycle 31 | 32 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 33 | // Called when a new scene session is being created. 34 | // Use this method to select a configuration to create the new scene with. 35 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 36 | } 37 | 38 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 39 | // Called when the user discards a scene session. 40 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 41 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon_20pt@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon_20pt@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon_29pt.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon_29pt@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon_29pt@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon_40pt@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon_40pt@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon_60pt@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon_60pt@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "icon_20pt.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "icon_40pt.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "idiom" : "ipad", 71 | "size" : "29x29", 72 | "scale" : "1x" 73 | }, 74 | { 75 | "idiom" : "ipad", 76 | "size" : "29x29", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "idiom" : "ipad", 81 | "size" : "40x40", 82 | "scale" : "1x" 83 | }, 84 | { 85 | "idiom" : "ipad", 86 | "size" : "40x40", 87 | "scale" : "2x" 88 | }, 89 | { 90 | "size" : "76x76", 91 | "idiom" : "ipad", 92 | "filename" : "icon_76pt.png", 93 | "scale" : "1x" 94 | }, 95 | { 96 | "size" : "76x76", 97 | "idiom" : "ipad", 98 | "filename" : "icon_76pt@2x.png", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "size" : "83.5x83.5", 103 | "idiom" : "ipad", 104 | "filename" : "icon_83.5@2x.png", 105 | "scale" : "2x" 106 | }, 107 | { 108 | "size" : "1024x1024", 109 | "idiom" : "ios-marketing", 110 | "filename" : "Icon.png", 111 | "scale" : "1x" 112 | } 113 | ], 114 | "info" : { 115 | "version" : 1, 116 | "author" : "xcode" 117 | } 118 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/Icon.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_76pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_76pt.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/blueberry.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "blueberry.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/blueberry.imageset/blueberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/blueberry.imageset/blueberry.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/mango.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mango.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/mango.imageset/mango.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/mango.imageset/mango.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/mocha.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "mocha.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/mocha.imageset/mocha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/mocha.imageset/mocha.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/strawberry.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "strawberry.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/strawberry.imageset/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/strawberry.imageset/strawberry.png -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/vanilla.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "vanilla.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MooTime Creamery/Assets.xcassets/vanilla.imageset/vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Assets.xcassets/vanilla.imageset/vanilla.png -------------------------------------------------------------------------------- /MooTime Creamery/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /MooTime Creamery/BlurView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BlurView.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 7/2/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | struct BlurView: UIViewRepresentable { 13 | 14 | let style: UIBlurEffect.Style 15 | 16 | func makeUIView(context: UIViewRepresentableContext) -> UIView { 17 | let view = UIView(frame: .zero) 18 | view.backgroundColor = UIColor.init(white: 1, alpha: 0.5) 19 | let blurEffect = UIBlurEffect(style: style) 20 | let blurView = UIVisualEffectView(effect: blurEffect) 21 | blurView.translatesAutoresizingMaskIntoConstraints = false 22 | view.insertSubview(blurView, at: 0) 23 | NSLayoutConstraint.activate([ 24 | blurView.heightAnchor.constraint(equalTo: view.heightAnchor), 25 | blurView.widthAnchor.constraint(equalTo: view.widthAnchor), 26 | ]) 27 | return view 28 | } 29 | 30 | func updateUIView(_ uiView: UIView, 31 | context: UIViewRepresentableContext) { 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /MooTime Creamery/CardView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardView.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/29/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | extension AnyTransition { 12 | static func fadeAndScale() -> AnyTransition { 13 | AnyTransition.scale().combined(with: .opacity) 14 | } 15 | } 16 | 17 | struct CardView : View { 18 | @State var animateIn = false 19 | var product: Product 20 | var delay: Double 21 | 22 | var body: some View { 23 | VStack { 24 | VStack(alignment: .leading, spacing: -4) { 25 | Text(product.subname) 26 | .font(.system(.footnote, design: .serif)) 27 | .fontWeight(.semibold) 28 | Text(product.name) 29 | .font(Font.system(size: 32, design: .serif)) 30 | .fontWeight(.semibold) 31 | } 32 | .foregroundColor(product.fontColor()) 33 | ZStack{ 34 | Image(product.imageName) 35 | .resizable() 36 | .scaledToFill() 37 | .frame(width: 170, height: 150) 38 | .shadow(color: product.shadowColor(opacity: 0.5), radius: 20, x: 0, y: 1.0) 39 | .offset(x: 0, y: 140) 40 | } 41 | } 42 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) 43 | .background(product.backgroundGradient(), cornerRadius: 0) 44 | .cornerRadius(40) 45 | .clipped() 46 | .opacity(self.animateIn ? 1 : 0) 47 | .scaleEffect(self.animateIn ? 1 : 0.9) 48 | .animation(Animation.spring().delay(self.delay)) 49 | .onAppear() { 50 | withAnimation { 51 | self.animateIn = true 52 | } 53 | } 54 | } 55 | 56 | } 57 | 58 | #if DEBUG 59 | struct CardView_Previews : PreviewProvider { 60 | static var previews: some View { 61 | Group { 62 | CardView(product: productData[0], delay: 0.5) 63 | CardView(product: productData[1], delay: 0.8) 64 | } 65 | .previewLayout(.fixed(width: 300, height: 300)) 66 | } 67 | 68 | 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /MooTime Creamery/CartView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CartView.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/29/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct CartView : View { 12 | var product: Product 13 | @Binding var showCart: Bool 14 | 15 | var body: some View { 16 | GeometryReader { geometry in 17 | VStack{ 18 | Spacer() 19 | Text("Great Success!") 20 | .bold() 21 | .font(.largeTitle) 22 | .color(self.product.fontColor()) 23 | .padding(.bottom, 8.0) 24 | .frame(width: geometry.size.width) 25 | 26 | Text("Your order will be ready at") 27 | Text(self.orderTimestamp) 28 | .font(.system(size: 24)) 29 | .bold() 30 | .padding(.top, -8) 31 | 32 | 33 | Text("ORDER NUMBER") 34 | .padding(.top, 24) 35 | 36 | Text("\(Int.random(in: 30 ..< 50))") 37 | .font(.system(size: 80)) 38 | .fontWeight(.heavy) 39 | .padding(.top, -16) 40 | .padding(.bottom, 32) 41 | 42 | 43 | Button(action: { 44 | withAnimation{ 45 | self.showCart.toggle() 46 | } 47 | }){ 48 | Text("Done") 49 | .color(self.product.fontColor()) 50 | .fontWeight(.bold) 51 | .padding() 52 | .frame(width: geometry.size.width - 48) 53 | .border(self.product.fontColor(), width: 1, cornerRadius: 30) 54 | } 55 | .padding(.bottom, 56) 56 | } 57 | .background( 58 | BlurView(style: .light) 59 | .cornerRadius(30) 60 | .shadow(radius: 30) 61 | .frame(width: geometry.size.width, height: geometry.size.height-80) 62 | .position(x: geometry.frame(in: .local).midX, y: geometry.frame(in: .local).midY+40) 63 | 64 | ) 65 | .foregroundColor(.black) 66 | .frame(width: geometry.size.width, height: geometry.size.height) 67 | } 68 | } 69 | 70 | private var orderTimestamp: String { 71 | let today = Date() 72 | let modifiedDate = Calendar.current.date(byAdding: .minute, value: 15, to: today)! 73 | 74 | let dateFormatter = DateFormatter() 75 | dateFormatter.dateStyle = .none 76 | dateFormatter.timeStyle = .short 77 | 78 | return dateFormatter.string(from: modifiedDate) 79 | } 80 | 81 | } 82 | 83 | #if DEBUG 84 | struct CartView_Previews : PreviewProvider { 85 | static var previews: some View { 86 | CartView(product: productData[1], showCart: .constant(true)) 87 | .previewLayout(.fixed(width: 412, height: 490)) 88 | } 89 | } 90 | #endif 91 | -------------------------------------------------------------------------------- /MooTime Creamery/DetailView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DetailView : View { 12 | var product: Product 13 | @Binding var dismissFlag: Bool 14 | @Binding var off: Length 15 | @State var showCart = false 16 | 17 | var transition: AnyTransition { 18 | let insertion = AnyTransition.move(edge: .trailing) 19 | .combined(with: .opacity) 20 | let removal = AnyTransition.scale() 21 | .combined(with: .opacity) 22 | return .asymmetric(insertion: insertion, removal: removal) 23 | } 24 | 25 | var body: some View { 26 | ZStack(alignment: .bottom) { 27 | VStack(spacing: 24) { 28 | 29 | ZStack(alignment: .topLeading) { 30 | Button(action: { 31 | withAnimation { 32 | self.dismissFlag.toggle() 33 | self.off = 130 34 | } 35 | }) { 36 | Image(systemName: "x.circle") 37 | .resizable() 38 | .frame(width: 24, height: 24) 39 | } 40 | .opacity(self.showCart ? 0 : 1) 41 | .padding() 42 | } 43 | .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading ) 44 | 45 | Spacer(minLength: 350) 46 | 47 | VStack(alignment: .leading, spacing: -4) { 48 | Text(product.subname) 49 | .font(.system(.footnote, design: .serif)) 50 | .fontWeight(.semibold) 51 | Text(product.name) 52 | .font(Font.system(size: 56, design: .serif)) 53 | .fontWeight(.semibold) 54 | } 55 | .opacity(self.off == 0 ? 1 : 0) 56 | .animation(Animation.basic().delay(1.2)) 57 | 58 | 59 | 60 | StarsView(rating: product.ratings, reviewCount: product.reviewsCount, color: product.fontColor()) 61 | .padding(.top, -8) 62 | .opacity(self.off == 0 ? 1 : 0) 63 | .animation(Animation.basic().delay(1.4)) 64 | 65 | Text(product.description) 66 | .font(.system(.subheadline, design: .serif)) 67 | .baselineOffset(1) 68 | .multilineTextAlignment(.leading) 69 | .lineLimit(nil) 70 | .lineSpacing(5) 71 | .opacity(self.off == 0 ? 1 : 0) 72 | .animation(Animation.basic().delay(1.6)) 73 | .padding(.horizontal, 24.0) 74 | .padding(.bottom, 48) 75 | 76 | Spacer() 77 | } 78 | .frame(minHeight: 0, maxHeight: .infinity) 79 | 80 | Button(action: { 81 | withAnimation { 82 | self.showCart.toggle() 83 | } 84 | }) { 85 | Text("Order Now") 86 | .color(.white) 87 | .fontWeight(.bold) 88 | .frame(minWidth: 300, maxWidth: .infinity) 89 | .frame(height: 56) 90 | .background(product.fontColor()) 91 | .cornerRadius(28) 92 | } 93 | .padding(.horizontal, 32.0) 94 | .shadow(color: product.fontColor(), radius: 5, x: 0, y: 1) 95 | .padding(.bottom, 48) 96 | .offset(x: 0.0, y: off) 97 | 98 | 99 | CartView(product: product, showCart: $showCart) 100 | .frame(width: UIScreen.main.bounds.width, height: 700) 101 | .offset(x: 0, y: self.showCart ? 20 : 810) 102 | .zIndex(5) 103 | .animation(.basic(duration: 0.5, curve: .custom(0.4, 0.52, 0.4, 1.15))) 104 | 105 | Image(product.imageName) 106 | .resizable() 107 | .scaledToFit() 108 | .frame(minWidth: 0, maxWidth: .infinity) 109 | .frame(height: self.showCart ? 300 : 350) 110 | .shadow(color: product.shadowColor(opacity: 0.5), radius: 20, x: 0, y: 1.0) 111 | .opacity(self.off == 0 ? 1 : 0) 112 | .position(x: UIScreen.main.bounds.midX, y: self.showCart ? 280 : 250) 113 | .zIndex(10) 114 | .animation(.basic(duration: 0.3, curve: .custom(0.4, 0.52, 0.4, 1.20))) 115 | 116 | } 117 | .background(product.backgroundGradient(), cornerRadius: 0) 118 | .foregroundColor(product.fontColor()) 119 | .edgesIgnoringSafeArea(.all) 120 | } 121 | } 122 | 123 | #if DEBUG 124 | struct ContentView_Previews : PreviewProvider { 125 | static var previews: some View { 126 | DetailView(product: productData[0], dismissFlag: .constant(true), off: .constant(0)) 127 | } 128 | } 129 | #endif 130 | -------------------------------------------------------------------------------- /MooTime Creamery/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | MooTime Creamery 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIApplicationSceneManifest 26 | 27 | UIApplicationSupportsMultipleScenes 28 | 29 | UISceneConfigurations 30 | 31 | UIWindowSceneSessionRoleApplication 32 | 33 | 34 | UILaunchStoryboardName 35 | LaunchScreen 36 | UISceneConfigurationName 37 | Default Configuration 38 | UISceneDelegateClassName 39 | $(PRODUCT_MODULE_NAME).SceneDelegate 40 | 41 | 42 | 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /MooTime Creamery/Model/Data.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Data.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | import UIKit 12 | import SwiftUI 13 | 14 | let productData: [Product] = load("data.json") 15 | 16 | func load(_ filename: String, as type: T.Type = T.self) -> T { 17 | let data: Data 18 | 19 | guard let file = Bundle.main.url(forResource: filename, withExtension: nil) 20 | else { 21 | fatalError("Couldn't find \(filename) in main bundle.") 22 | } 23 | 24 | do { 25 | data = try Data(contentsOf: file) 26 | } catch { 27 | fatalError("Couldn't load \(filename) from main bundle:\n\(error)") 28 | } 29 | 30 | do { 31 | let decoder = JSONDecoder() 32 | return try decoder.decode(T.self, from: data) 33 | } catch { 34 | fatalError("Couldn't parse \(filename) as \(T.self):\n\(error)") 35 | } 36 | } 37 | 38 | final class ImageStore { 39 | fileprivate typealias _ImageDictionary = [String: [Int: CGImage]] 40 | fileprivate var images: _ImageDictionary = [:] 41 | 42 | fileprivate static var originalSize = 250 43 | fileprivate static var scale = 2 44 | 45 | static var shared = ImageStore() 46 | 47 | func image(name: String, size: Int) -> Image { 48 | let index = _guaranteeInitialImage(name: name) 49 | 50 | let sizedImage = images.values[index][size] 51 | ?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale) 52 | images.values[index][size] = sizedImage 53 | 54 | return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name)) 55 | } 56 | 57 | fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index { 58 | if let index = images.index(forKey: name) { return index } 59 | 60 | guard 61 | let url = Bundle.main.url(forResource: name, withExtension: "png"), 62 | let imageSource = CGImageSourceCreateWithURL(url as NSURL, nil), 63 | let image = CGImageSourceCreateImageAtIndex(imageSource, 0, nil) 64 | else { 65 | fatalError("Couldn't load image \(name).png from main bundle.") 66 | } 67 | 68 | images[name] = [ImageStore.originalSize: image] 69 | return images.index(forKey: name)! 70 | } 71 | 72 | fileprivate func _sizeImage(_ image: CGImage, to size: Int) -> CGImage { 73 | guard 74 | let colorSpace = image.colorSpace, 75 | let context = CGContext( 76 | data: nil, 77 | width: size, height: size, 78 | bitsPerComponent: image.bitsPerComponent, 79 | bytesPerRow: image.bytesPerRow, 80 | space: colorSpace, 81 | bitmapInfo: image.bitmapInfo.rawValue) 82 | else { 83 | fatalError("Couldn't create graphics context.") 84 | } 85 | context.interpolationQuality = .high 86 | context.draw(image, in: CGRect(x: 0, y: 0, width: size, height: size)) 87 | 88 | if let sizedImage = context.makeImage() { 89 | return sizedImage 90 | } else { 91 | fatalError("Couldn't resize image.") 92 | } 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /MooTime Creamery/Model/Product.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Product.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct Product: Hashable, Codable, Identifiable { 12 | var id: Int 13 | var name: String 14 | var subname: String 15 | var description: String 16 | var imageName: String 17 | var reviewsCount: Int 18 | var ratings: Int 19 | var price: Double 20 | var backgroundColor: [[Double]] 21 | var textColor: [Double] 22 | 23 | func image(forSize size: Int) -> Image { 24 | ImageStore.shared.image(name: imageName, size: size) 25 | } 26 | 27 | func backgroundGradient() -> RadialGradient { 28 | let endGradient = Color(red: backgroundColor[0][0] / 255, green: backgroundColor[0][1] / 255, blue: backgroundColor[0][2] / 255) 29 | let startGradient = Color(red: backgroundColor[1][0] / 255, green: backgroundColor[1][1] / 255, blue: backgroundColor[1][2] / 255) 30 | 31 | return RadialGradient(gradient: Gradient(colors: [endGradient, startGradient]), center: .top, startRadius: 1, endRadius: 600) 32 | } 33 | 34 | func fontColor() -> Color { 35 | return Color(red: textColor[0] / 255, green: textColor[1] / 255, blue: textColor[2] / 255) 36 | } 37 | 38 | func shadowColor(opacity: Double) -> Color { 39 | return Color(.sRGB, red: textColor[0] / 255, green: textColor[1] / 255, blue: textColor[2] / 255, opacity: opacity) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /MooTime Creamery/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MooTime Creamery/ProductList.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Ice.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/29/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ProductList : View { 12 | @State var dismissFlag = false 13 | @State var product: Product = productData[0] 14 | @State var off: Length = 130 15 | var products: [Product] 16 | 17 | var body: some View { 18 | NavigationView { 19 | ScrollView { 20 | VStack { 21 | ForEach(self.products.identified(by: \.name)) { item in 22 | 23 | CardView(product: item, delay: self.cardDelay(ic: item)) 24 | .frame(height: 300) 25 | .shadow(color: .init(.sRGB, white: 0, opacity: 0.2), radius: 20, x: 0, y: 1) 26 | .padding([.leading, .bottom, .trailing], 32.0) 27 | .tapAction({ 28 | self.product = item 29 | withAnimation { 30 | self.dismissFlag.toggle() 31 | self.off = 0 32 | } 33 | 34 | }) 35 | } 36 | .frame(width: UIScreen.main.bounds.size.width) 37 | 38 | } 39 | .padding(.top, 32.0) 40 | } 41 | .navigationBarTitle(Text("Flavors")) 42 | .presentation(self.dismissFlag ? self.modal(product: self.product) : nil) 43 | 44 | } 45 | } 46 | 47 | private func cardDelay(ic: Product) -> Double { 48 | guard let index = self.products.firstIndex(of: ic) else { return 0 } 49 | return Double(index) * 0.3 50 | } 51 | 52 | private func modal(product: Product) -> Modal { 53 | let m = Modal(DetailView(product: product, dismissFlag: $dismissFlag, off: $off)) { 54 | self.dismissFlag = false 55 | } 56 | return m 57 | 58 | } 59 | 60 | 61 | 62 | } 63 | 64 | #if DEBUG 65 | struct Ice_Previews : PreviewProvider { 66 | static var previews: some View { 67 | ProductList(products: productData) 68 | } 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /MooTime Creamery/Resources/blueberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/blueberry.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1001, 4 | "name": "Strawberry", 5 | "subname": "fairy", 6 | "description": "We introduce sweet summer strawberries to pure cream and other natural ingredients. Because it's brimming with real fruit, the true flavor of our strawberries comes shining through.", 7 | "imageName": "strawberry", 8 | "reviewsCount": 170, 9 | "ratings": 4, 10 | "price": 4.99, 11 | "backgroundColor": [ [255, 219, 243], [255, 191, 214] ], 12 | "textColor": [170, 114, 123] 13 | }, 14 | { 15 | "id": 1002, 16 | "name": "Mango", 17 | "subname": "loco", 18 | "description": "Our ode to the tropical flavors of South America combines sweet mango ice cream and slices of juicy mango for a simply perfect treat.", 19 | "imageName": "mango", 20 | "reviewsCount": 142, 21 | "ratings": 5, 22 | "price": 4.99, 23 | "backgroundColor": [ [248, 236, 191], [254, 216, 82] ], 24 | "textColor": [185, 149, 17] 25 | }, 26 | { 27 | "id": 1003, 28 | "name": "Mocha", 29 | "subname": "choco", 30 | "description": "Somewhere between the creamy coffee coffee ice cream & the buzzbuzzbuzz of espresso fudge, it hits you: you’re wide awake & in lovelovelove.", 31 | "imageName": "mocha", 32 | "reviewsCount": 38, 33 | "ratings": 4, 34 | "price": 4.99, 35 | "backgroundColor": [ [230, 188, 176], [230, 168, 176] ], 36 | "textColor": [150, 117, 108] 37 | }, 38 | { 39 | "id": 1004, 40 | "name": "Blueberry", 41 | "subname": "wild", 42 | "description": "Wild Maine Blueberry from the land of the puffin, now when we crave you we turn to the muffin.", 43 | "imageName": "blueberry", 44 | "reviewsCount": 63, 45 | "ratings": 5, 46 | "price": 4.99, 47 | "backgroundColor": [ [149, 231, 235], [46, 222, 232] ], 48 | "textColor": [0, 157, 166] 49 | }, 50 | { 51 | "id": 1005, 52 | "name": "Vanilla", 53 | "subname": "fairy", 54 | "description": "When you dig into this pint, you’ll find a rich, creamy Vanilla that’s more vanilla-tasting than any Vanilla you’ve ever tasted.", 55 | "imageName": "vanilla", 56 | "reviewsCount": 170, 57 | "ratings": 4, 58 | "price": 4.99, 59 | "backgroundColor": [ [252, 248, 240], [245, 239, 226] ], 60 | "textColor": [203, 184, 169] 61 | } 62 | ] 63 | -------------------------------------------------------------------------------- /MooTime Creamery/Resources/ios/ice-cream-22@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/ios/ice-cream-22@1x.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/ios/ice-cream-22@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/ios/ice-cream-22@2x.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/ios/ice-cream-22@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/ios/ice-cream-22@3x.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/mango.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/mango.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/mocha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/mocha.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/strawberry.png -------------------------------------------------------------------------------- /MooTime Creamery/Resources/vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/MooTime Creamery/Resources/vanilla.png -------------------------------------------------------------------------------- /MooTime Creamery/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Use a UIHostingController as window root view controller 23 | if let windowScene = scene as? UIWindowScene { 24 | let window = UIWindow(windowScene: windowScene) 25 | window.rootViewController = UIHostingController(rootView: ProductList(products: productData)) 26 | self.window = window 27 | window.makeKeyAndVisible() 28 | } 29 | } 30 | 31 | func sceneDidDisconnect(_ scene: UIScene) { 32 | // Called as the scene is being released by the system. 33 | // This occurs shortly after the scene enters the background, or when its session is discarded. 34 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 35 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 36 | } 37 | 38 | func sceneDidBecomeActive(_ scene: UIScene) { 39 | // Called when the scene has moved from an inactive state to an active state. 40 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 41 | } 42 | 43 | func sceneWillResignActive(_ scene: UIScene) { 44 | // Called when the scene will move from an active state to an inactive state. 45 | // This may occur due to temporary interruptions (ex. an incoming phone call). 46 | } 47 | 48 | func sceneWillEnterForeground(_ scene: UIScene) { 49 | // Called as the scene transitions from the background to the foreground. 50 | // Use this method to undo the changes made on entering the background. 51 | } 52 | 53 | func sceneDidEnterBackground(_ scene: UIScene) { 54 | // Called as the scene transitions from the foreground to the background. 55 | // Use this method to save data, release shared resources, and store enough scene-specific state information 56 | // to restore the scene back to its current state. 57 | } 58 | 59 | 60 | } 61 | 62 | -------------------------------------------------------------------------------- /MooTime Creamery/StarsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StarsView.swift 3 | // MooTime Creamery 4 | // 5 | // Created by Rodrigo Soares on 6/27/19. 6 | // Copyright © 2019 Rodrigo Soares. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct StarsView : View { 12 | var rating: Int 13 | var reviewCount: Int 14 | var color: Color 15 | 16 | var body: some View { 17 | VStack(spacing: 16) { 18 | HStack(alignment: .center, spacing: 16.0) { 19 | ForEach(1...5) { index in 20 | Image(systemName: index <= self.rating ? "star.fill" : "star") 21 | .resizable() 22 | .frame(width: 24.0, height: 24.0) 23 | 24 | } 25 | } 26 | } 27 | .foregroundColor(self.color) 28 | } 29 | } 30 | 31 | #if DEBUG 32 | struct StarsView_Previews : PreviewProvider { 33 | static var previews: some View { 34 | StarsView(rating: productData[0].ratings, reviewCount: productData[0].reviewsCount, color: productData[0].fontColor()) 35 | .previewLayout(.fixed(width: 300, height: 100)) 36 | } 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI Ice Cream Demo App 2 | 3 | Just a simple app to get familiar with SwiftUI. You will need Xcode beta 3 to run it. 4 | 5 | ![screen 1](https://github.com/rodi01/icecream_swiftui/raw/master/gifs/swiftui_1.gif) 6 | 7 | ![screen 2](https://github.com/rodi01/icecream_swiftui/raw/master/gifs/swiftui_2.gif) 8 | 9 | -------------------------------------------------------------------------------- /gifs/swiftui_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/gifs/swiftui_1.gif -------------------------------------------------------------------------------- /gifs/swiftui_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodi01/icecream_swiftui/bfe1f0494bbad34a17559f8995eae0cc11187172/gifs/swiftui_2.gif --------------------------------------------------------------------------------