├── Covid ├── SwiftUI_Covid.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── kishannakum.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── kishannakum.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── SwiftUI_Covid │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── 01.imageset │ │ ├── 01.png │ │ └── Contents.json │ ├── 02.imageset │ │ ├── 02.png │ │ └── Contents.json │ ├── 03.imageset │ │ ├── 03.png │ │ └── Contents.json │ ├── 04.imageset │ │ ├── 06.png │ │ └── Contents.json │ ├── 05.imageset │ │ ├── 05.png │ │ └── Contents.json │ ├── 07.imageset │ │ ├── Contents.json │ │ └── Group@3x.png │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ └── LaunchScreen.storyboard │ ├── Cards.swift │ ├── ContentView.swift │ ├── Helper.swift │ ├── Info.plist │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ ├── ProgressBar.swift │ └── SceneDelegate.swift ├── Pokemon ├── SwiftUI_Pokemon.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── kishannakum.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── kishannakum.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── SwiftUI_Pokemon │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Charmander.imageset │ │ ├── 004.png │ │ └── Contents.json │ ├── Contents.json │ ├── Ivysaur.imageset │ │ ├── 002.png │ │ └── Contents.json │ ├── Jigglypuff.imageset │ │ ├── 039.png │ │ └── Contents.json │ ├── Lapras.imageset │ │ ├── Contents.json │ │ └── Lapras.png │ ├── Pansear.imageset │ │ ├── Contents.json │ │ └── Pansear.png │ ├── Pikachu.imageset │ │ ├── 025.png │ │ └── Contents.json │ ├── Totodile.imageset │ │ ├── 158.png │ │ └── Contents.json │ ├── Venonat.imageset │ │ ├── Contents.json │ │ └── Venonat.png │ ├── ball.imageset │ │ ├── Contents.json │ │ ├── Poké Ball.png │ │ ├── Poké Ball@2x.png │ │ └── Poké Ball@3x.png │ └── logo.imageset │ │ ├── Contents.json │ │ └── Pokemon-Logo.png │ ├── Base.lproj │ └── LaunchScreen.storyboard │ ├── ContentView.swift │ ├── Helper │ ├── Helper.swift │ ├── Pokemon.swift │ └── pokemon_dex.json │ ├── Info.plist │ ├── PokeCard.swift │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── SceneDelegate.swift ├── README.md └── Stopwatch ├── SwiftUI_Stopwatch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── kishannakum.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── kishannakum.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── SwiftUI_Stopwatch ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Color.colorset │ └── Contents.json ├── Color1.colorset │ └── Contents.json ├── Color2.colorset │ └── Contents.json ├── Contents.json ├── start.imageset │ ├── 984752-128.png │ └── Contents.json └── stop.imageset │ ├── 1868960-128.png │ └── Contents.json ├── Base.lproj └── LaunchScreen.storyboard ├── Calculations.swift ├── CardView.swift ├── ContentView.swift ├── Helper.swift ├── Info.plist ├── ItemView.swift ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json └── SceneDelegate.swift /Covid/SwiftUI_Covid.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 21C4F85D2507ADBD008DE847 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F85C2507ADBD008DE847 /* AppDelegate.swift */; }; 11 | 21C4F85F2507ADBD008DE847 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F85E2507ADBD008DE847 /* SceneDelegate.swift */; }; 12 | 21C4F8612507ADBD008DE847 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F8602507ADBD008DE847 /* ContentView.swift */; }; 13 | 21C4F8632507ADC1008DE847 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21C4F8622507ADC1008DE847 /* Assets.xcassets */; }; 14 | 21C4F8662507ADC1008DE847 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21C4F8652507ADC1008DE847 /* Preview Assets.xcassets */; }; 15 | 21C4F8692507ADC1008DE847 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 21C4F8672507ADC1008DE847 /* LaunchScreen.storyboard */; }; 16 | 21C4F8712507ADDA008DE847 /* Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F8702507ADDA008DE847 /* Helper.swift */; }; 17 | 21C4F8732507ADE7008DE847 /* Cards.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F8722507ADE7008DE847 /* Cards.swift */; }; 18 | 21C4F8752507ADF3008DE847 /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C4F8742507ADF3008DE847 /* ProgressBar.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 21C4F8592507ADBD008DE847 /* SwiftUI_Covid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUI_Covid.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 21C4F85C2507ADBD008DE847 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | 21C4F85E2507ADBD008DE847 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 25 | 21C4F8602507ADBD008DE847 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 26 | 21C4F8622507ADC1008DE847 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 21C4F8652507ADC1008DE847 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 28 | 21C4F8682507ADC1008DE847 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 21C4F86A2507ADC1008DE847 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 21C4F8702507ADDA008DE847 /* Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = ""; }; 31 | 21C4F8722507ADE7008DE847 /* Cards.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cards.swift; sourceTree = ""; }; 32 | 21C4F8742507ADF3008DE847 /* ProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 21C4F8562507ADBD008DE847 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 21C4F8502507ADBD008DE847 = { 47 | isa = PBXGroup; 48 | children = ( 49 | 21C4F85B2507ADBD008DE847 /* SwiftUI_Covid */, 50 | 21C4F85A2507ADBD008DE847 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 21C4F85A2507ADBD008DE847 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 21C4F8592507ADBD008DE847 /* SwiftUI_Covid.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 21C4F85B2507ADBD008DE847 /* SwiftUI_Covid */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 21C4F85C2507ADBD008DE847 /* AppDelegate.swift */, 66 | 21C4F85E2507ADBD008DE847 /* SceneDelegate.swift */, 67 | 21C4F8602507ADBD008DE847 /* ContentView.swift */, 68 | 21C4F8702507ADDA008DE847 /* Helper.swift */, 69 | 21C4F8742507ADF3008DE847 /* ProgressBar.swift */, 70 | 21C4F8722507ADE7008DE847 /* Cards.swift */, 71 | 21C4F8622507ADC1008DE847 /* Assets.xcassets */, 72 | 21C4F8672507ADC1008DE847 /* LaunchScreen.storyboard */, 73 | 21C4F86A2507ADC1008DE847 /* Info.plist */, 74 | 21C4F8642507ADC1008DE847 /* Preview Content */, 75 | ); 76 | path = SwiftUI_Covid; 77 | sourceTree = ""; 78 | }; 79 | 21C4F8642507ADC1008DE847 /* Preview Content */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 21C4F8652507ADC1008DE847 /* Preview Assets.xcassets */, 83 | ); 84 | path = "Preview Content"; 85 | sourceTree = ""; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 21C4F8582507ADBD008DE847 /* SwiftUI_Covid */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 21C4F86D2507ADC1008DE847 /* Build configuration list for PBXNativeTarget "SwiftUI_Covid" */; 93 | buildPhases = ( 94 | 21C4F8552507ADBD008DE847 /* Sources */, 95 | 21C4F8562507ADBD008DE847 /* Frameworks */, 96 | 21C4F8572507ADBD008DE847 /* Resources */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = SwiftUI_Covid; 103 | productName = SwiftUI_Covid; 104 | productReference = 21C4F8592507ADBD008DE847 /* SwiftUI_Covid.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | 21C4F8512507ADBD008DE847 /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastSwiftUpdateCheck = 1150; 114 | LastUpgradeCheck = 1150; 115 | ORGANIZATIONNAME = "Kishan Nakum"; 116 | TargetAttributes = { 117 | 21C4F8582507ADBD008DE847 = { 118 | CreatedOnToolsVersion = 11.5; 119 | }; 120 | }; 121 | }; 122 | buildConfigurationList = 21C4F8542507ADBD008DE847 /* Build configuration list for PBXProject "SwiftUI_Covid" */; 123 | compatibilityVersion = "Xcode 9.3"; 124 | developmentRegion = en; 125 | hasScannedForEncodings = 0; 126 | knownRegions = ( 127 | en, 128 | Base, 129 | ); 130 | mainGroup = 21C4F8502507ADBD008DE847; 131 | productRefGroup = 21C4F85A2507ADBD008DE847 /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | 21C4F8582507ADBD008DE847 /* SwiftUI_Covid */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | 21C4F8572507ADBD008DE847 /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 21C4F8692507ADC1008DE847 /* LaunchScreen.storyboard in Resources */, 146 | 21C4F8662507ADC1008DE847 /* Preview Assets.xcassets in Resources */, 147 | 21C4F8632507ADC1008DE847 /* Assets.xcassets in Resources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXSourcesBuildPhase section */ 154 | 21C4F8552507ADBD008DE847 /* Sources */ = { 155 | isa = PBXSourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 21C4F8752507ADF3008DE847 /* ProgressBar.swift in Sources */, 159 | 21C4F8732507ADE7008DE847 /* Cards.swift in Sources */, 160 | 21C4F85D2507ADBD008DE847 /* AppDelegate.swift in Sources */, 161 | 21C4F85F2507ADBD008DE847 /* SceneDelegate.swift in Sources */, 162 | 21C4F8612507ADBD008DE847 /* ContentView.swift in Sources */, 163 | 21C4F8712507ADDA008DE847 /* Helper.swift in Sources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXSourcesBuildPhase section */ 168 | 169 | /* Begin PBXVariantGroup section */ 170 | 21C4F8672507ADC1008DE847 /* LaunchScreen.storyboard */ = { 171 | isa = PBXVariantGroup; 172 | children = ( 173 | 21C4F8682507ADC1008DE847 /* Base */, 174 | ); 175 | name = LaunchScreen.storyboard; 176 | sourceTree = ""; 177 | }; 178 | /* End PBXVariantGroup section */ 179 | 180 | /* Begin XCBuildConfiguration section */ 181 | 21C4F86B2507ADC1008DE847 /* Debug */ = { 182 | isa = XCBuildConfiguration; 183 | buildSettings = { 184 | ALWAYS_SEARCH_USER_PATHS = NO; 185 | CLANG_ANALYZER_NONNULL = YES; 186 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 187 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 188 | CLANG_CXX_LIBRARY = "libc++"; 189 | CLANG_ENABLE_MODULES = YES; 190 | CLANG_ENABLE_OBJC_ARC = YES; 191 | CLANG_ENABLE_OBJC_WEAK = YES; 192 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 193 | CLANG_WARN_BOOL_CONVERSION = YES; 194 | CLANG_WARN_COMMA = YES; 195 | CLANG_WARN_CONSTANT_CONVERSION = YES; 196 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 197 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 198 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 199 | CLANG_WARN_EMPTY_BODY = YES; 200 | CLANG_WARN_ENUM_CONVERSION = YES; 201 | CLANG_WARN_INFINITE_RECURSION = YES; 202 | CLANG_WARN_INT_CONVERSION = YES; 203 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 204 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 205 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 206 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 207 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 208 | CLANG_WARN_STRICT_PROTOTYPES = YES; 209 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 210 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 211 | CLANG_WARN_UNREACHABLE_CODE = YES; 212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 213 | COPY_PHASE_STRIP = NO; 214 | DEBUG_INFORMATION_FORMAT = dwarf; 215 | ENABLE_STRICT_OBJC_MSGSEND = YES; 216 | ENABLE_TESTABILITY = YES; 217 | GCC_C_LANGUAGE_STANDARD = gnu11; 218 | GCC_DYNAMIC_NO_PIC = NO; 219 | GCC_NO_COMMON_BLOCKS = YES; 220 | GCC_OPTIMIZATION_LEVEL = 0; 221 | GCC_PREPROCESSOR_DEFINITIONS = ( 222 | "DEBUG=1", 223 | "$(inherited)", 224 | ); 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 232 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 233 | MTL_FAST_MATH = YES; 234 | ONLY_ACTIVE_ARCH = YES; 235 | SDKROOT = iphoneos; 236 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 237 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 238 | }; 239 | name = Debug; 240 | }; 241 | 21C4F86C2507ADC1008DE847 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_ANALYZER_NONNULL = YES; 246 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_MODULES = YES; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_ENABLE_OBJC_WEAK = YES; 252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_COMMA = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INFINITE_RECURSION = YES; 262 | CLANG_WARN_INT_CONVERSION = YES; 263 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 264 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 265 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 267 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 268 | CLANG_WARN_STRICT_PROTOTYPES = YES; 269 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 270 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 271 | CLANG_WARN_UNREACHABLE_CODE = YES; 272 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 273 | COPY_PHASE_STRIP = NO; 274 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 275 | ENABLE_NS_ASSERTIONS = NO; 276 | ENABLE_STRICT_OBJC_MSGSEND = YES; 277 | GCC_C_LANGUAGE_STANDARD = gnu11; 278 | GCC_NO_COMMON_BLOCKS = YES; 279 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 280 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 281 | GCC_WARN_UNDECLARED_SELECTOR = YES; 282 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 283 | GCC_WARN_UNUSED_FUNCTION = YES; 284 | GCC_WARN_UNUSED_VARIABLE = YES; 285 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 286 | MTL_ENABLE_DEBUG_INFO = NO; 287 | MTL_FAST_MATH = YES; 288 | SDKROOT = iphoneos; 289 | SWIFT_COMPILATION_MODE = wholemodule; 290 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Release; 294 | }; 295 | 21C4F86E2507ADC1008DE847 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 299 | CODE_SIGN_STYLE = Automatic; 300 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Covid/Preview Content\""; 301 | DEVELOPMENT_TEAM = WT8M6SYS2R; 302 | ENABLE_PREVIEWS = YES; 303 | INFOPLIST_FILE = SwiftUI_Covid/Info.plist; 304 | LD_RUNPATH_SEARCH_PATHS = ( 305 | "$(inherited)", 306 | "@executable_path/Frameworks", 307 | ); 308 | PRODUCT_BUNDLE_IDENTIFIER = "com.KishanNakum.SwiftUI-Covid"; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | SWIFT_VERSION = 5.0; 311 | TARGETED_DEVICE_FAMILY = "1,2"; 312 | }; 313 | name = Debug; 314 | }; 315 | 21C4F86F2507ADC1008DE847 /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 | CODE_SIGN_STYLE = Automatic; 320 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Covid/Preview Content\""; 321 | DEVELOPMENT_TEAM = WT8M6SYS2R; 322 | ENABLE_PREVIEWS = YES; 323 | INFOPLIST_FILE = SwiftUI_Covid/Info.plist; 324 | LD_RUNPATH_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "@executable_path/Frameworks", 327 | ); 328 | PRODUCT_BUNDLE_IDENTIFIER = "com.KishanNakum.SwiftUI-Covid"; 329 | PRODUCT_NAME = "$(TARGET_NAME)"; 330 | SWIFT_VERSION = 5.0; 331 | TARGETED_DEVICE_FAMILY = "1,2"; 332 | }; 333 | name = Release; 334 | }; 335 | /* End XCBuildConfiguration section */ 336 | 337 | /* Begin XCConfigurationList section */ 338 | 21C4F8542507ADBD008DE847 /* Build configuration list for PBXProject "SwiftUI_Covid" */ = { 339 | isa = XCConfigurationList; 340 | buildConfigurations = ( 341 | 21C4F86B2507ADC1008DE847 /* Debug */, 342 | 21C4F86C2507ADC1008DE847 /* Release */, 343 | ); 344 | defaultConfigurationIsVisible = 0; 345 | defaultConfigurationName = Release; 346 | }; 347 | 21C4F86D2507ADC1008DE847 /* Build configuration list for PBXNativeTarget "SwiftUI_Covid" */ = { 348 | isa = XCConfigurationList; 349 | buildConfigurations = ( 350 | 21C4F86E2507ADC1008DE847 /* Debug */, 351 | 21C4F86F2507ADC1008DE847 /* Release */, 352 | ); 353 | defaultConfigurationIsVisible = 0; 354 | defaultConfigurationName = Release; 355 | }; 356 | /* End XCConfigurationList section */ 357 | }; 358 | rootObject = 21C4F8512507ADBD008DE847 /* Project object */; 359 | } 360 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid.xcodeproj/xcuserdata/kishannakum.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwiftUI_Covid.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. 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 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/01.imageset/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/01.imageset/01.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/01.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "01.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/02.imageset/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/02.imageset/02.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/02.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "02.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/03.imageset/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/03.imageset/03.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/03.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "03.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/04.imageset/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/04.imageset/06.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/04.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "06.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/05.imageset/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/05.imageset/05.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/05.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "05.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/07.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "Group@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/07.imageset/Group@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Covid/SwiftUI_Covid/Assets.xcassets/07.imageset/Group@3x.png -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/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 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Cards.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cards.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ItemView : View { 12 | let itemName: String 13 | let instruction : String 14 | 15 | 16 | var body: some View{ 17 | Rectangle() 18 | .fill(Color(.lightText)) 19 | .frame(width: 140, height: 120, alignment: .center) 20 | .overlay( 21 | VStack{ 22 | Image(itemName) 23 | .resizable() 24 | .aspectRatio(contentMode: .fit) 25 | .frame(width: 60, height: 60, alignment: .center) 26 | .foregroundColor(.white) 27 | .padding(.vertical,10) 28 | Text (instruction) 29 | .font(.system(size: 13, weight: .semibold, design: .monospaced)) 30 | } 31 | ) 32 | .border(Color.black , width: 1) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ContentView: View { 12 | @State var selected = false 13 | @State var cartItems: [(index: Int, anchor: Anchor)] = [] 14 | @State var progressValue: Float = 0.0 15 | @State var spin = false 16 | 17 | var body: some View { 18 | GeometryReader { proxy in 19 | 20 | VStack{ 21 | /*------------------------------------------------------------------------------------------------------------------------------------------- 22 | // MARK: - Progressbar 23 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 24 | 25 | ProgressBar(value: self.$progressValue).frame(height: 30) 26 | .padding() 27 | /*------------------------------------------------------------------------------------------------------------------------------------------- 28 | // MARK: - Corona Image section 29 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 30 | 31 | VStack{ 32 | ZStack{ 33 | Image("05") 34 | .resizable() 35 | .aspectRatio(contentMode: .fit) 36 | .frame(width: UIScreen.main.bounds.width/2, height: UIScreen.main.bounds.width/3, alignment: .center) 37 | .padding() 38 | .rotation3DEffect(.degrees(self.spin ? 360: 1), axis: (x: 0, y:0 , z: self.spin ? 1: 0)) 39 | .animation(Animation.easeOut(duration: 15).repeatForever(autoreverses: false)) 40 | .onAppear(){ 41 | self.spin.toggle() 42 | } 43 | .opacity(self.progressValue > 1 ? 0 : 1) 44 | .background ( 45 | GeometryReader { proxy in 46 | ZStack { 47 | ForEach(Array(self.cartItems.enumerated()), id: \.offset) { (_, item) in 48 | Image("07") 49 | .animation(.default) 50 | .transition(.offset(x: proxy[item.anchor].x, y: proxy[item.anchor].y)) 51 | .onAppear{ 52 | 53 | } 54 | .zIndex(5) 55 | } 56 | } 57 | }.frame(width: 50, height: 50) 58 | ) 59 | .offset(x: self.selected ? -2 : 0) 60 | .animation(Animation.default.repeatCount(5).speed(6)) 61 | } 62 | .foregroundColor(Color(.gray)) 63 | .padding(.vertical) 64 | Text(self.progressValue > 1 ? "You are safe Now." : "Remove Corona Germs!") 65 | .font(.system(size: 20, weight: .bold, design: .monospaced)) 66 | .frame(width: UIScreen.main.bounds.width - 30, height: 20, alignment: .center) 67 | .foregroundColor(Color(.black)) 68 | } 69 | /*------------------------------------------------------------------------------------------------------------------------------------------- 70 | // MARK: - Cards View 71 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 72 | 73 | VStack{ 74 | HStack{ 75 | ForEach(0..<2){ index in 76 | ItemView(itemName: icons[index], instruction: instructions[index]) 77 | .anchorPreference(key: AnchorKey.self, value: .topLeading, transform: { $0 }) 78 | //Uses the specified preference value from the view to produce another view as an overlay atop the first view. 79 | .overlayPreferenceValue(AnchorKey.self, { anchor in 80 | Button(action: { 81 | if self.progressValue <= 1{ 82 | withAnimation(Animation.default.speed(0.55)){ 83 | self.progressValue += 0.05 84 | } 85 | self.selected.toggle() 86 | self.cartItems.append((index: index, anchor: anchor!)) 87 | } 88 | }, label: { Color.clear }) 89 | }) 90 | 91 | } 92 | } 93 | .padding(.top,5) 94 | HStack{ 95 | ForEach(2..<4){ index in 96 | ItemView(itemName: icons[index], instruction: instructions[index]) 97 | .anchorPreference(key: AnchorKey.self, value: .topLeading, transform: { $0 }) 98 | //Uses the specified preference value from the view to produce another view as an overlay atop the first view. 99 | .overlayPreferenceValue(AnchorKey.self, { anchor in 100 | Button(action: { 101 | if self.progressValue <= 1{ 102 | withAnimation(Animation.default.speed(0.55)){ 103 | self.progressValue += 0.05 104 | } 105 | self.selected.toggle() 106 | self.cartItems.append((index: index, anchor: anchor!)) 107 | } 108 | }, label: { Color.clear }) 109 | }) 110 | 111 | } 112 | } 113 | .padding(.top,5) 114 | } 115 | }} 116 | .background(LinearGradient(gradient: Gradient(colors: [Color(hex: AppColors.bgGradient1),Color(hex: AppColors.bgGradient2)]), startPoint: .top, endPoint: .bottom)) 117 | .edgesIgnoringSafeArea(.top) 118 | .edgesIgnoringSafeArea(.bottom) 119 | } 120 | } 121 | 122 | struct AnchorKey: PreferenceKey { 123 | typealias Value = Anchor? 124 | static var defaultValue: Value { nil } 125 | 126 | static func reduce(value: inout Value, nextValue: () -> Value) { 127 | value = nextValue() 128 | } 129 | } 130 | 131 | struct ContentView_Previews: PreviewProvider { 132 | static var previews: some View { 133 | ContentView() 134 | } 135 | } 136 | 137 | 138 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Helper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helper.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | extension Color { 12 | init(hex: String) { 13 | let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) 14 | var int: UInt64 = 0 15 | Scanner(string: hex).scanHexInt64(&int) 16 | let a, r, g, b: UInt64 17 | switch hex.count { 18 | case 3: // RGB (12-bit) 19 | (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) 20 | case 6: // RGB (24-bit) 21 | (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) 22 | case 8: // ARGB (32-bit) 23 | (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) 24 | default: 25 | (a, r, g, b) = (1, 1, 1, 0) 26 | } 27 | 28 | self.init( 29 | .sRGB, 30 | red: Double(r) / 255, 31 | green: Double(g) / 255, 32 | blue: Double(b) / 255, 33 | opacity: Double(a) / 255 34 | ) 35 | } 36 | 37 | } 38 | 39 | let icons = ["01", "02","03","04"] 40 | let instructions = ["Sanitise hands","Wash your hands" , "Wear Mask" ,"Avoid Handsake"] 41 | 42 | struct AppColors { 43 | static let bgGradient1 = "#D7E1EC" 44 | static let bgGradient2 = "#FFFFFF" 45 | static let bgGradient3 = "#ff758c" 46 | static let bgGradient4 = "#ff7eb3" 47 | static let bgGradient5 = "#36D1DC" 48 | static let bgGradient6 = "#5B86E5" 49 | static let bgGradient7 = "#fdfbfb" 50 | static let bgGradient8 = "#ebedee" 51 | } 52 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/ProgressBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressBar.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ProgressBar: View { 12 | @Binding var value: Float 13 | 14 | var body: some View { 15 | GeometryReader { geometry in 16 | ZStack(alignment: .leading) { 17 | Rectangle().frame(width: geometry.size.width , height: geometry.size.height) 18 | .opacity(0.3) 19 | .foregroundColor(Color(hex: "#dd546e")) 20 | Rectangle().frame(width: min(CGFloat(self.value)*geometry.size.width, geometry.size.width), height: geometry.size.height) 21 | .foregroundColor(Color(hex: "#dd546e")) 22 | .animation(.linear) 23 | Text("\(Int((self.value)*100))% Germs Killed.") 24 | .frame(width: geometry.size.width, height: 20, alignment: .center) 25 | .foregroundColor(Color(.white)) 26 | }.cornerRadius(45.0) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Covid/SwiftUI_Covid/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftUI_Covid 4 | // 5 | // Created by Kishan Nakum on 08/09/20. 6 | // Copyright © 2020 Kishan Nakum. 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 | // Create the SwiftUI view that provides the window contents. 23 | let contentView = ContentView() 24 | 25 | // Use a UIHostingController as window root view controller. 26 | if let windowScene = scene as? UIWindowScene { 27 | let window = UIWindow(windowScene: windowScene) 28 | window.rootViewController = UIHostingController(rootView: contentView) 29 | self.window = window 30 | window.makeKeyAndVisible() 31 | } 32 | } 33 | 34 | func sceneDidDisconnect(_ scene: UIScene) { 35 | // Called as the scene is being released by the system. 36 | // This occurs shortly after the scene enters the background, or when its session is discarded. 37 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 39 | } 40 | 41 | func sceneDidBecomeActive(_ scene: UIScene) { 42 | // Called when the scene has moved from an inactive state to an active state. 43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 44 | } 45 | 46 | func sceneWillResignActive(_ scene: UIScene) { 47 | // Called when the scene will move from an active state to an inactive state. 48 | // This may occur due to temporary interruptions (ex. an incoming phone call). 49 | } 50 | 51 | func sceneWillEnterForeground(_ scene: UIScene) { 52 | // Called as the scene transitions from the background to the foreground. 53 | // Use this method to undo the changes made on entering the background. 54 | } 55 | 56 | func sceneDidEnterBackground(_ scene: UIScene) { 57 | // Called as the scene transitions from the foreground to the background. 58 | // Use this method to save data, release shared resources, and store enough scene-specific state information 59 | // to restore the scene back to its current state. 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2131FD4024FD843D0047A584 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD3F24FD843D0047A584 /* AppDelegate.swift */; }; 11 | 2131FD4224FD843D0047A584 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD4124FD843D0047A584 /* SceneDelegate.swift */; }; 12 | 2131FD4424FD843D0047A584 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD4324FD843D0047A584 /* ContentView.swift */; }; 13 | 2131FD4624FD843F0047A584 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2131FD4524FD843F0047A584 /* Assets.xcassets */; }; 14 | 2131FD4924FD843F0047A584 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2131FD4824FD843F0047A584 /* Preview Assets.xcassets */; }; 15 | 2131FD4C24FD843F0047A584 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2131FD4A24FD843F0047A584 /* LaunchScreen.storyboard */; }; 16 | 2131FD5424FD86890047A584 /* Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD5324FD86890047A584 /* Helper.swift */; }; 17 | 2131FD5624FD886E0047A584 /* PokeCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD5524FD886E0047A584 /* PokeCard.swift */; }; 18 | 2131FD5824FE31790047A584 /* pokemon_dex.json in Resources */ = {isa = PBXBuildFile; fileRef = 2131FD5724FE31790047A584 /* pokemon_dex.json */; }; 19 | 2131FD5A24FE318A0047A584 /* Pokemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2131FD5924FE318A0047A584 /* Pokemon.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 2131FD3C24FD843D0047A584 /* SwiftUI_Pokemon.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUI_Pokemon.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 2131FD3F24FD843D0047A584 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 2131FD4124FD843D0047A584 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 26 | 2131FD4324FD843D0047A584 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 27 | 2131FD4524FD843F0047A584 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 2131FD4824FD843F0047A584 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 29 | 2131FD4B24FD843F0047A584 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 2131FD4D24FD843F0047A584 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 2131FD5324FD86890047A584 /* Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = ""; }; 32 | 2131FD5524FD886E0047A584 /* PokeCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PokeCard.swift; sourceTree = ""; }; 33 | 2131FD5724FE31790047A584 /* pokemon_dex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = pokemon_dex.json; sourceTree = ""; }; 34 | 2131FD5924FE318A0047A584 /* Pokemon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pokemon.swift; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 2131FD3924FD843D0047A584 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 2131FD3324FD843D0047A584 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 2131FD3E24FD843D0047A584 /* SwiftUI_Pokemon */, 52 | 2131FD3D24FD843D0047A584 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 2131FD3D24FD843D0047A584 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 2131FD3C24FD843D0047A584 /* SwiftUI_Pokemon.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 2131FD3E24FD843D0047A584 /* SwiftUI_Pokemon */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 2131FD3F24FD843D0047A584 /* AppDelegate.swift */, 68 | 2131FD4124FD843D0047A584 /* SceneDelegate.swift */, 69 | 2131FD4324FD843D0047A584 /* ContentView.swift */, 70 | 2131FD5524FD886E0047A584 /* PokeCard.swift */, 71 | 2159097724FE9AAC0014BA88 /* Helper */, 72 | 2131FD4524FD843F0047A584 /* Assets.xcassets */, 73 | 2131FD4A24FD843F0047A584 /* LaunchScreen.storyboard */, 74 | 2131FD4D24FD843F0047A584 /* Info.plist */, 75 | 2131FD4724FD843F0047A584 /* Preview Content */, 76 | ); 77 | path = SwiftUI_Pokemon; 78 | sourceTree = ""; 79 | }; 80 | 2131FD4724FD843F0047A584 /* Preview Content */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 2131FD4824FD843F0047A584 /* Preview Assets.xcassets */, 84 | ); 85 | path = "Preview Content"; 86 | sourceTree = ""; 87 | }; 88 | 2159097724FE9AAC0014BA88 /* Helper */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 2131FD5724FE31790047A584 /* pokemon_dex.json */, 92 | 2131FD5924FE318A0047A584 /* Pokemon.swift */, 93 | 2131FD5324FD86890047A584 /* Helper.swift */, 94 | ); 95 | path = Helper; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXNativeTarget section */ 101 | 2131FD3B24FD843D0047A584 /* SwiftUI_Pokemon */ = { 102 | isa = PBXNativeTarget; 103 | buildConfigurationList = 2131FD5024FD843F0047A584 /* Build configuration list for PBXNativeTarget "SwiftUI_Pokemon" */; 104 | buildPhases = ( 105 | 2131FD3824FD843D0047A584 /* Sources */, 106 | 2131FD3924FD843D0047A584 /* Frameworks */, 107 | 2131FD3A24FD843D0047A584 /* Resources */, 108 | ); 109 | buildRules = ( 110 | ); 111 | dependencies = ( 112 | ); 113 | name = SwiftUI_Pokemon; 114 | productName = SwiftUI_Pokemon; 115 | productReference = 2131FD3C24FD843D0047A584 /* SwiftUI_Pokemon.app */; 116 | productType = "com.apple.product-type.application"; 117 | }; 118 | /* End PBXNativeTarget section */ 119 | 120 | /* Begin PBXProject section */ 121 | 2131FD3424FD843D0047A584 /* Project object */ = { 122 | isa = PBXProject; 123 | attributes = { 124 | LastSwiftUpdateCheck = 1150; 125 | LastUpgradeCheck = 1150; 126 | ORGANIZATIONNAME = "Digital Trons"; 127 | TargetAttributes = { 128 | 2131FD3B24FD843D0047A584 = { 129 | CreatedOnToolsVersion = 11.5; 130 | }; 131 | }; 132 | }; 133 | buildConfigurationList = 2131FD3724FD843D0047A584 /* Build configuration list for PBXProject "SwiftUI_Pokemon" */; 134 | compatibilityVersion = "Xcode 9.3"; 135 | developmentRegion = en; 136 | hasScannedForEncodings = 0; 137 | knownRegions = ( 138 | en, 139 | Base, 140 | ); 141 | mainGroup = 2131FD3324FD843D0047A584; 142 | productRefGroup = 2131FD3D24FD843D0047A584 /* Products */; 143 | projectDirPath = ""; 144 | projectRoot = ""; 145 | targets = ( 146 | 2131FD3B24FD843D0047A584 /* SwiftUI_Pokemon */, 147 | ); 148 | }; 149 | /* End PBXProject section */ 150 | 151 | /* Begin PBXResourcesBuildPhase section */ 152 | 2131FD3A24FD843D0047A584 /* Resources */ = { 153 | isa = PBXResourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | 2131FD4C24FD843F0047A584 /* LaunchScreen.storyboard in Resources */, 157 | 2131FD5824FE31790047A584 /* pokemon_dex.json in Resources */, 158 | 2131FD4924FD843F0047A584 /* Preview Assets.xcassets in Resources */, 159 | 2131FD4624FD843F0047A584 /* Assets.xcassets in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | 2131FD3824FD843D0047A584 /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 2131FD4024FD843D0047A584 /* AppDelegate.swift in Sources */, 171 | 2131FD4224FD843D0047A584 /* SceneDelegate.swift in Sources */, 172 | 2131FD4424FD843D0047A584 /* ContentView.swift in Sources */, 173 | 2131FD5424FD86890047A584 /* Helper.swift in Sources */, 174 | 2131FD5624FD886E0047A584 /* PokeCard.swift in Sources */, 175 | 2131FD5A24FE318A0047A584 /* Pokemon.swift in Sources */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | /* End PBXSourcesBuildPhase section */ 180 | 181 | /* Begin PBXVariantGroup section */ 182 | 2131FD4A24FD843F0047A584 /* LaunchScreen.storyboard */ = { 183 | isa = PBXVariantGroup; 184 | children = ( 185 | 2131FD4B24FD843F0047A584 /* Base */, 186 | ); 187 | name = LaunchScreen.storyboard; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXVariantGroup section */ 191 | 192 | /* Begin XCBuildConfiguration section */ 193 | 2131FD4E24FD843F0047A584 /* Debug */ = { 194 | isa = XCBuildConfiguration; 195 | buildSettings = { 196 | ALWAYS_SEARCH_USER_PATHS = NO; 197 | CLANG_ANALYZER_NONNULL = YES; 198 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_ENABLE_OBJC_WEAK = YES; 204 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 205 | CLANG_WARN_BOOL_CONVERSION = YES; 206 | CLANG_WARN_COMMA = YES; 207 | CLANG_WARN_CONSTANT_CONVERSION = YES; 208 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INFINITE_RECURSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 216 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 217 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 218 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 219 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 220 | CLANG_WARN_STRICT_PROTOTYPES = YES; 221 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 222 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 223 | CLANG_WARN_UNREACHABLE_CODE = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | COPY_PHASE_STRIP = NO; 226 | DEBUG_INFORMATION_FORMAT = dwarf; 227 | ENABLE_STRICT_OBJC_MSGSEND = YES; 228 | ENABLE_TESTABILITY = YES; 229 | GCC_C_LANGUAGE_STANDARD = gnu11; 230 | GCC_DYNAMIC_NO_PIC = NO; 231 | GCC_NO_COMMON_BLOCKS = YES; 232 | GCC_OPTIMIZATION_LEVEL = 0; 233 | GCC_PREPROCESSOR_DEFINITIONS = ( 234 | "DEBUG=1", 235 | "$(inherited)", 236 | ); 237 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 238 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 239 | GCC_WARN_UNDECLARED_SELECTOR = YES; 240 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 241 | GCC_WARN_UNUSED_FUNCTION = YES; 242 | GCC_WARN_UNUSED_VARIABLE = YES; 243 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 244 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 245 | MTL_FAST_MATH = YES; 246 | ONLY_ACTIVE_ARCH = YES; 247 | SDKROOT = iphoneos; 248 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 249 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 250 | }; 251 | name = Debug; 252 | }; 253 | 2131FD4F24FD843F0047A584 /* Release */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_ANALYZER_NONNULL = YES; 258 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_ENABLE_OBJC_WEAK = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 276 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 277 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 279 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 280 | CLANG_WARN_STRICT_PROTOTYPES = YES; 281 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 282 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | COPY_PHASE_STRIP = NO; 286 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 287 | ENABLE_NS_ASSERTIONS = NO; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu11; 290 | GCC_NO_COMMON_BLOCKS = YES; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 293 | GCC_WARN_UNDECLARED_SELECTOR = YES; 294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 295 | GCC_WARN_UNUSED_FUNCTION = YES; 296 | GCC_WARN_UNUSED_VARIABLE = YES; 297 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 298 | MTL_ENABLE_DEBUG_INFO = NO; 299 | MTL_FAST_MATH = YES; 300 | SDKROOT = iphoneos; 301 | SWIFT_COMPILATION_MODE = wholemodule; 302 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 303 | VALIDATE_PRODUCT = YES; 304 | }; 305 | name = Release; 306 | }; 307 | 2131FD5124FD843F0047A584 /* Debug */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 311 | CODE_SIGN_STYLE = Automatic; 312 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Pokemon/Preview Content\""; 313 | DEVELOPMENT_TEAM = 3PN9YT2KRD; 314 | ENABLE_PREVIEWS = YES; 315 | INFOPLIST_FILE = SwiftUI_Pokemon/Info.plist; 316 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 317 | LD_RUNPATH_SEARCH_PATHS = ( 318 | "$(inherited)", 319 | "@executable_path/Frameworks", 320 | ); 321 | PRODUCT_BUNDLE_IDENTIFIER = "com.DigitalTrons.SwiftUI-Pokemon"; 322 | PRODUCT_NAME = "$(TARGET_NAME)"; 323 | SWIFT_VERSION = 5.0; 324 | TARGETED_DEVICE_FAMILY = "1,2"; 325 | }; 326 | name = Debug; 327 | }; 328 | 2131FD5224FD843F0047A584 /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 332 | CODE_SIGN_STYLE = Automatic; 333 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Pokemon/Preview Content\""; 334 | DEVELOPMENT_TEAM = 3PN9YT2KRD; 335 | ENABLE_PREVIEWS = YES; 336 | INFOPLIST_FILE = SwiftUI_Pokemon/Info.plist; 337 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 338 | LD_RUNPATH_SEARCH_PATHS = ( 339 | "$(inherited)", 340 | "@executable_path/Frameworks", 341 | ); 342 | PRODUCT_BUNDLE_IDENTIFIER = "com.DigitalTrons.SwiftUI-Pokemon"; 343 | PRODUCT_NAME = "$(TARGET_NAME)"; 344 | SWIFT_VERSION = 5.0; 345 | TARGETED_DEVICE_FAMILY = "1,2"; 346 | }; 347 | name = Release; 348 | }; 349 | /* End XCBuildConfiguration section */ 350 | 351 | /* Begin XCConfigurationList section */ 352 | 2131FD3724FD843D0047A584 /* Build configuration list for PBXProject "SwiftUI_Pokemon" */ = { 353 | isa = XCConfigurationList; 354 | buildConfigurations = ( 355 | 2131FD4E24FD843F0047A584 /* Debug */, 356 | 2131FD4F24FD843F0047A584 /* Release */, 357 | ); 358 | defaultConfigurationIsVisible = 0; 359 | defaultConfigurationName = Release; 360 | }; 361 | 2131FD5024FD843F0047A584 /* Build configuration list for PBXNativeTarget "SwiftUI_Pokemon" */ = { 362 | isa = XCConfigurationList; 363 | buildConfigurations = ( 364 | 2131FD5124FD843F0047A584 /* Debug */, 365 | 2131FD5224FD843F0047A584 /* Release */, 366 | ); 367 | defaultConfigurationIsVisible = 0; 368 | defaultConfigurationName = Release; 369 | }; 370 | /* End XCConfigurationList section */ 371 | }; 372 | rootObject = 2131FD3424FD843D0047A584 /* Project object */; 373 | } 374 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon.xcodeproj/xcuserdata/kishannakum.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwiftUI_Pokemon.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Digital Trons. 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 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Charmander.imageset/004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Charmander.imageset/004.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Charmander.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "004.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Ivysaur.imageset/002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Ivysaur.imageset/002.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Ivysaur.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "002.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Jigglypuff.imageset/039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Jigglypuff.imageset/039.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Jigglypuff.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "039.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Lapras.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Lapras.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Lapras.imageset/Lapras.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Lapras.imageset/Lapras.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pansear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Pansear.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pansear.imageset/Pansear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pansear.imageset/Pansear.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pikachu.imageset/025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pikachu.imageset/025.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Pikachu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "025.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Totodile.imageset/158.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Totodile.imageset/158.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Totodile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "158.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Venonat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Venonat.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/Venonat.imageset/Venonat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/Venonat.imageset/Venonat.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Poké Ball.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "Poké Ball@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "Poké Ball@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball@2x.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/ball.imageset/Poké Ball@3x.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Pokemon-Logo.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Assets.xcassets/logo.imageset/Pokemon-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Pokemon/SwiftUI_Pokemon/Assets.xcassets/logo.imageset/Pokemon-Logo.png -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/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 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ContentView: View { 12 | 13 | let allPokemon = Pokemon.readAllPokemon 14 | 15 | var body: some View { 16 | GeometryReader { proxy in 17 | ZStack{ 18 | VStack(alignment: .leading, spacing: 24) { 19 | /*------------------------------------------------------------------------------------------------------------------------------------------- 20 | // MARK: - HEADER IMAGE 21 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 22 | 23 | Image("logo") 24 | .resizable() 25 | .aspectRatio(contentMode: .fit) 26 | .padding(.horizontal,80) 27 | /*------------------------------------------------------------------------------------------------------------------------------------------- 28 | // MARK: - COROUSAL VIEW 29 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 30 | 31 | ScrollView(.horizontal, showsIndicators: false) { 32 | HStack(spacing: 10) { 33 | ForEach(self.allPokemon) { poke in 34 | GeometryReader { (proxy: GeometryProxy) in 35 | PokeCard(pokemon:poke) 36 | .rotation3DEffect(.degrees(Double(proxy.frame(in: .global).minX - 20) / -20), axis: (x: 0, y: 1, z: 0)) 37 | .onTapGesture { 38 | withAnimation(Animation.spring()) { 39 | } 40 | } 41 | } 42 | .frame(width: screen.bounds.width * 0.75, height: screen.bounds.height * 0.60) 43 | } 44 | } 45 | .padding(.horizontal, 30) 46 | } 47 | 48 | } 49 | } 50 | 51 | } 52 | .background(LinearGradient(gradient: Gradient(colors: [Color(hex: AppColors.bgGradient3),Color(hex: AppColors.bgGradient4)]), startPoint: .top, endPoint: .bottom)) 53 | .frame(maxWidth: .infinity, maxHeight: .infinity) 54 | .edgesIgnoringSafeArea(.top) 55 | .edgesIgnoringSafeArea(.bottom) 56 | } 57 | } 58 | 59 | /*------------------------------------------------------------------------------------------------------------------------------------------- 60 | // MARK: - PREVIEW 61 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 62 | 63 | struct ContentView_Previews: PreviewProvider { 64 | static var previews: some View { 65 | ContentView() 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Helper/Helper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helper.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Digital Trons. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | let screen = UIScreen.main 12 | 13 | extension Color { 14 | init(hex: String) { 15 | let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) 16 | var int: UInt64 = 0 17 | Scanner(string: hex).scanHexInt64(&int) 18 | let a, r, g, b: UInt64 19 | switch hex.count { 20 | case 3: // RGB (12-bit) 21 | (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) 22 | case 6: // RGB (24-bit) 23 | (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) 24 | case 8: // ARGB (32-bit) 25 | (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) 26 | default: 27 | (a, r, g, b) = (1, 1, 1, 0) 28 | } 29 | 30 | self.init( 31 | .sRGB, 32 | red: Double(r) / 255, 33 | green: Double(g) / 255, 34 | blue: Double(b) / 255, 35 | opacity: Double(a) / 255 36 | ) 37 | } 38 | 39 | } 40 | struct AppColors { 41 | static let bgGradient1 = "#485563" 42 | static let bgGradient2 = "#29323c" 43 | static let bgGradient3 = "#232526" 44 | static let bgGradient4 = "#414345" 45 | static let bgGradient5 = "#36D1DC" 46 | static let bgGradient6 = "#5B86E5" 47 | 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Helper/Pokemon.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pokemon.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Digital Trons. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | struct Pokemon : Identifiable, Decodable{ 13 | 14 | var id: String {pokemonName} 15 | 16 | let pokemonImage : String 17 | let pokemonName : String 18 | let pokemonType : String 19 | let typeColor : String 20 | let colorCode : String 21 | 22 | } 23 | 24 | extension Pokemon{ 25 | static var readAllPokemon:[Pokemon] { 26 | let url = Bundle.main.url(forResource: "pokemon_dex", withExtension: "json")! 27 | let data = try! Data(contentsOf: url) 28 | let poke = try! JSONDecoder().decode([Pokemon].self, from: data) 29 | return poke 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Helper/pokemon_dex.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pokemonImage":"Totodile", 4 | "pokemonName":"Totodile", 5 | "pokemonType":"Water", 6 | "typeColor" : "#37a7d7", 7 | "colorCode": "#37a7d7" 8 | },{ 9 | "pokemonImage":"Pikachu", 10 | "pokemonName":"Pikachu", 11 | "pokemonType":"Electric", 12 | "typeColor" : "#eed535", 13 | "colorCode": "#eed535" 14 | },{ 15 | "pokemonImage":"Jigglypuff", 16 | "pokemonName":"Jigglypuff", 17 | "pokemonType":"Fairy", 18 | "typeColor" : "#fabae9", 19 | "colorCode": "#fabae9" 20 | },{ 21 | "pokemonImage":"Charmander", 22 | "pokemonName":"Charmander", 23 | "pokemonType":"Fire", 24 | "typeColor" : "#f77c24", 25 | "colorCode": "#f77c24" 26 | },{ 27 | "pokemonImage":"Ivysaur", 28 | "pokemonName":"Ivysaur", 29 | "pokemonType":"Grass", 30 | "typeColor" : "#9bcc50", 31 | "colorCode": "#37a7d7" 32 | },{ 33 | "pokemonImage":"Venonat", 34 | "pokemonName":"Venonat", 35 | "pokemonType":"Poison", 36 | "typeColor" : "#b87fca", 37 | "colorCode": "#b87fca" 38 | },{ 39 | "pokemonImage":"Lapras", 40 | "pokemonName":"Lapras", 41 | "pokemonType":"Ice", 42 | "typeColor" : "#51c4e7", 43 | "colorCode": "#51c4e7" 44 | },{ 45 | "pokemonImage":"Pansear", 46 | "pokemonName":"Pansear", 47 | "pokemonType":"Fire", 48 | "typeColor" : "#f77c24", 49 | "colorCode": "#f77c24" 50 | } 51 | ] 52 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/PokeCard.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardView.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Digital Trons. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | 12 | struct PokeCard: View { 13 | var pokemon : Pokemon 14 | 15 | var body: some View { 16 | GeometryReader { proxy in 17 | VStack { 18 | ZStack(alignment: .bottom) { 19 | VStack{ 20 | Image("ball") 21 | .resizable() 22 | .offset(x:screen.bounds.width/2 - 80) 23 | .frame(width: 30, height: 30, alignment: .center) 24 | .padding(.top,20) 25 | .shadow(color: .black,radius: 5) 26 | /*------------------------------------------------------------------------------------------------------------------------------------------- 27 | // MARK: - Pokemon Image 28 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 29 | 30 | Image(self.pokemon.pokemonImage) 31 | .resizable() 32 | .aspectRatio(contentMode: .fill) 33 | .padding(.horizontal,50) 34 | .padding(.vertical) 35 | .padding(.top,-30) 36 | .shadow(color: Color(hex: self.pokemon.colorCode),radius: 10) 37 | 38 | /*------------------------------------------------------------------------------------------------------------------------------------------- 39 | // MARK: - Pokemon Name 40 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 41 | 42 | Text(self.pokemon.pokemonName) 43 | .font(.system(size: 40, weight: .semibold, design: .monospaced)) 44 | .foregroundColor(.white) 45 | .shadow(color: Color(hex: self.pokemon.colorCode),radius: 10) 46 | .padding() 47 | /*------------------------------------------------------------------------------------------------------------------------------------------- 48 | // MARK: - Bottom View 49 | ------------------------------------------------------------------------------------------------------------------------------------------- */ 50 | 51 | HStack{ 52 | Text(self.pokemon.pokemonType) 53 | .font(.system(size: 15, weight: .bold, design: .monospaced)) 54 | .frame(width: 100,height: 30) 55 | .background(Color(hex: self.pokemon.typeColor).opacity(1)) 56 | 57 | } 58 | .padding() 59 | .foregroundColor(.white) 60 | .padding(.bottom,5) 61 | .frame(width: screen.bounds.width * 0.75) 62 | .background(Color.black.opacity(0.5)) 63 | } 64 | } 65 | .background(LinearGradient(gradient: Gradient(colors: [Color(hex: AppColors.bgGradient1),Color(hex: AppColors.bgGradient2)]), startPoint: .top, endPoint: .bottom)) 66 | .border(LinearGradient(gradient: Gradient(colors: [Color(hex: AppColors.bgGradient5),Color(hex: AppColors.bgGradient6)]), startPoint: .top, endPoint: .bottom), width: 5) 67 | .frame(width: screen.bounds.width * 0.75, height: screen.bounds.height * 0.60) 68 | .cornerRadius(16) 69 | .shadow(color:Color(hex: "#2aead3"),radius: 8) 70 | 71 | } 72 | } 73 | } 74 | } 75 | struct PokeCard_Previews: PreviewProvider { 76 | static var previews: some View { 77 | PokeCard(pokemon:Pokemon.readAllPokemon[2]) 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Pokemon/SwiftUI_Pokemon/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftUI_Pokemon 4 | // 5 | // Created by Kishan Nakum on 01/09/20. 6 | // Copyright © 2020 Digital Trons. 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 | // Create the SwiftUI view that provides the window contents. 23 | let contentView = ContentView() 24 | 25 | // Use a UIHostingController as window root view controller. 26 | if let windowScene = scene as? UIWindowScene { 27 | let window = UIWindow(windowScene: windowScene) 28 | window.rootViewController = UIHostingController(rootView: contentView) 29 | self.window = window 30 | window.makeKeyAndVisible() 31 | } 32 | } 33 | 34 | func sceneDidDisconnect(_ scene: UIScene) { 35 | // Called as the scene is being released by the system. 36 | // This occurs shortly after the scene enters the background, or when its session is discarded. 37 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 39 | } 40 | 41 | func sceneDidBecomeActive(_ scene: UIScene) { 42 | // Called when the scene has moved from an inactive state to an active state. 43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 44 | } 45 | 46 | func sceneWillResignActive(_ scene: UIScene) { 47 | // Called when the scene will move from an active state to an inactive state. 48 | // This may occur due to temporary interruptions (ex. an incoming phone call). 49 | } 50 | 51 | func sceneWillEnterForeground(_ scene: UIScene) { 52 | // Called as the scene transitions from the background to the foreground. 53 | // Use this method to undo the changes made on entering the background. 54 | } 55 | 56 | func sceneDidEnterBackground(_ scene: UIScene) { 57 | // Called as the scene transitions from the foreground to the background. 58 | // Use this method to save data, release shared resources, and store enough scene-specific state information 59 | // to restore the scene back to its current state. 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI_Animations 2 | 3 | ![Black Technology LinkedIn](https://user-images.githubusercontent.com/8666236/91961047-4af0ef00-ed28-11ea-80c5-88bd8aa0d078.png) 4 | 5 | 6 | Hi! This is a repository where i publish code for the animations you see on my Instagram [**@kish0007**](https://www.instagram.com/kish0007/). 7 | I'm a iOS developer learning Swift and SwiftUI. I create and post code for fun and to show people how easy it is to create animations in SwiftUI! 8 | 9 | 10 | ## Reach me via 👇🏻 11 | Instagram : [**@kish0007**](https://www.instagram.com/kish0007/) 12 | 13 | Linkedin : [**@kishanNakum**](https://www.linkedin.com/in/kishan-nakum-9a9a3a84) 14 | 15 | Youtube : [**@kishanNakum**](https://www.youtube.com/channel/UChVt9Eu1dWAlsbUdv9PdGeg/) 16 | 17 | 18 | ## Demo - GIF's (More Projects on the way)👇🏻 19 | 20 | ### Stopwatch 21 | ![stopwatch](https://user-images.githubusercontent.com/8666236/95056159-ef909300-0711-11eb-8149-db6314f288db.gif) 22 | 23 | ### Pokemon 24 | ![in (1)](https://user-images.githubusercontent.com/8666236/91962531-462d3a80-ed2a-11ea-9b67-c25a5c3ddab6.gif) 25 | 26 | ### Covid 27 | ![covid](https://user-images.githubusercontent.com/8666236/92477630-8e52ce00-f1fe-11ea-903f-dd8ac244e832.gif) 28 | 29 | 30 | ## Spread the word! 31 | Liked the project? Just give it a star ⭐️ and follow on Instagram for Daily Updates. 32 | 33 | ## Developer 34 | © KISHAN NAKUM 35 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2191C710252B0B5900D3642C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C70F252B0B5900D3642C /* AppDelegate.swift */; }; 11 | 2191C712252B0B5900D3642C /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C711252B0B5900D3642C /* SceneDelegate.swift */; }; 12 | 2191C719252B0B5C00D3642C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2191C718252B0B5C00D3642C /* Preview Assets.xcassets */; }; 13 | 2191C71C252B0B5C00D3642C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2191C71A252B0B5C00D3642C /* LaunchScreen.storyboard */; }; 14 | 2191C726252B0B6F00D3642C /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C725252B0B6F00D3642C /* CardView.swift */; }; 15 | 2191C728252B0B7300D3642C /* ItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C727252B0B7300D3642C /* ItemView.swift */; }; 16 | 2191C72A252B0B7700D3642C /* Calculations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C729252B0B7700D3642C /* Calculations.swift */; }; 17 | 2191C72C252B0B7A00D3642C /* Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C72B252B0B7A00D3642C /* Helper.swift */; }; 18 | 2191C72E252B0B8200D3642C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2191C72D252B0B8200D3642C /* Assets.xcassets */; }; 19 | 2191C734252B520F00D3642C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2191C733252B520F00D3642C /* ContentView.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 2191C70C252B0B5900D3642C /* SwiftUI_Stopwatch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUI_Stopwatch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 2191C70F252B0B5900D3642C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 2191C711252B0B5900D3642C /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 26 | 2191C718252B0B5C00D3642C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 27 | 2191C71B252B0B5C00D3642C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 2191C71D252B0B5C00D3642C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 2191C725252B0B6F00D3642C /* CardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = ""; }; 30 | 2191C727252B0B7300D3642C /* ItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemView.swift; sourceTree = ""; }; 31 | 2191C729252B0B7700D3642C /* Calculations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Calculations.swift; sourceTree = ""; }; 32 | 2191C72B252B0B7A00D3642C /* Helper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = ""; }; 33 | 2191C72D252B0B8200D3642C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | 2191C733252B520F00D3642C /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 2191C709252B0B5900D3642C /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 2191C703252B0B5900D3642C = { 49 | isa = PBXGroup; 50 | children = ( 51 | 2191C70E252B0B5900D3642C /* SwiftUI_Stopwatch */, 52 | 2191C70D252B0B5900D3642C /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 2191C70D252B0B5900D3642C /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 2191C70C252B0B5900D3642C /* SwiftUI_Stopwatch.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 2191C70E252B0B5900D3642C /* SwiftUI_Stopwatch */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 2191C70F252B0B5900D3642C /* AppDelegate.swift */, 68 | 2191C711252B0B5900D3642C /* SceneDelegate.swift */, 69 | 2191C725252B0B6F00D3642C /* CardView.swift */, 70 | 2191C733252B520F00D3642C /* ContentView.swift */, 71 | 2191C727252B0B7300D3642C /* ItemView.swift */, 72 | 2191C729252B0B7700D3642C /* Calculations.swift */, 73 | 2191C72B252B0B7A00D3642C /* Helper.swift */, 74 | 2191C72D252B0B8200D3642C /* Assets.xcassets */, 75 | 2191C71A252B0B5C00D3642C /* LaunchScreen.storyboard */, 76 | 2191C71D252B0B5C00D3642C /* Info.plist */, 77 | 2191C717252B0B5C00D3642C /* Preview Content */, 78 | ); 79 | path = SwiftUI_Stopwatch; 80 | sourceTree = ""; 81 | }; 82 | 2191C717252B0B5C00D3642C /* Preview Content */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 2191C718252B0B5C00D3642C /* Preview Assets.xcassets */, 86 | ); 87 | path = "Preview Content"; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 2191C70B252B0B5900D3642C /* SwiftUI_Stopwatch */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 2191C720252B0B5C00D3642C /* Build configuration list for PBXNativeTarget "SwiftUI_Stopwatch" */; 96 | buildPhases = ( 97 | 2191C708252B0B5900D3642C /* Sources */, 98 | 2191C709252B0B5900D3642C /* Frameworks */, 99 | 2191C70A252B0B5900D3642C /* Resources */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = SwiftUI_Stopwatch; 106 | productName = SwiftUI_Stopwatch; 107 | productReference = 2191C70C252B0B5900D3642C /* SwiftUI_Stopwatch.app */; 108 | productType = "com.apple.product-type.application"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | 2191C704252B0B5900D3642C /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastSwiftUpdateCheck = 1170; 117 | LastUpgradeCheck = 1170; 118 | ORGANIZATIONNAME = "Kishan Nakum"; 119 | TargetAttributes = { 120 | 2191C70B252B0B5900D3642C = { 121 | CreatedOnToolsVersion = 11.7; 122 | }; 123 | }; 124 | }; 125 | buildConfigurationList = 2191C707252B0B5900D3642C /* Build configuration list for PBXProject "SwiftUI_Stopwatch" */; 126 | compatibilityVersion = "Xcode 9.3"; 127 | developmentRegion = en; 128 | hasScannedForEncodings = 0; 129 | knownRegions = ( 130 | en, 131 | Base, 132 | ); 133 | mainGroup = 2191C703252B0B5900D3642C; 134 | productRefGroup = 2191C70D252B0B5900D3642C /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | 2191C70B252B0B5900D3642C /* SwiftUI_Stopwatch */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXResourcesBuildPhase section */ 144 | 2191C70A252B0B5900D3642C /* Resources */ = { 145 | isa = PBXResourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 2191C71C252B0B5C00D3642C /* LaunchScreen.storyboard in Resources */, 149 | 2191C72E252B0B8200D3642C /* Assets.xcassets in Resources */, 150 | 2191C719252B0B5C00D3642C /* Preview Assets.xcassets in Resources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | 2191C708252B0B5900D3642C /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 2191C710252B0B5900D3642C /* AppDelegate.swift in Sources */, 162 | 2191C72C252B0B7A00D3642C /* Helper.swift in Sources */, 163 | 2191C734252B520F00D3642C /* ContentView.swift in Sources */, 164 | 2191C72A252B0B7700D3642C /* Calculations.swift in Sources */, 165 | 2191C712252B0B5900D3642C /* SceneDelegate.swift in Sources */, 166 | 2191C726252B0B6F00D3642C /* CardView.swift in Sources */, 167 | 2191C728252B0B7300D3642C /* ItemView.swift in Sources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXSourcesBuildPhase section */ 172 | 173 | /* Begin PBXVariantGroup section */ 174 | 2191C71A252B0B5C00D3642C /* LaunchScreen.storyboard */ = { 175 | isa = PBXVariantGroup; 176 | children = ( 177 | 2191C71B252B0B5C00D3642C /* Base */, 178 | ); 179 | name = LaunchScreen.storyboard; 180 | sourceTree = ""; 181 | }; 182 | /* End PBXVariantGroup section */ 183 | 184 | /* Begin XCBuildConfiguration section */ 185 | 2191C71E252B0B5C00D3642C /* Debug */ = { 186 | isa = XCBuildConfiguration; 187 | buildSettings = { 188 | ALWAYS_SEARCH_USER_PATHS = NO; 189 | CLANG_ANALYZER_NONNULL = YES; 190 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 191 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 192 | CLANG_CXX_LIBRARY = "libc++"; 193 | CLANG_ENABLE_MODULES = YES; 194 | CLANG_ENABLE_OBJC_ARC = YES; 195 | CLANG_ENABLE_OBJC_WEAK = YES; 196 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_COMMA = YES; 199 | CLANG_WARN_CONSTANT_CONVERSION = YES; 200 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 202 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 203 | CLANG_WARN_EMPTY_BODY = YES; 204 | CLANG_WARN_ENUM_CONVERSION = YES; 205 | CLANG_WARN_INFINITE_RECURSION = YES; 206 | CLANG_WARN_INT_CONVERSION = YES; 207 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 208 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 209 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 210 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 211 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 212 | CLANG_WARN_STRICT_PROTOTYPES = YES; 213 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 214 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 215 | CLANG_WARN_UNREACHABLE_CODE = YES; 216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 217 | COPY_PHASE_STRIP = NO; 218 | DEBUG_INFORMATION_FORMAT = dwarf; 219 | ENABLE_STRICT_OBJC_MSGSEND = YES; 220 | ENABLE_TESTABILITY = YES; 221 | GCC_C_LANGUAGE_STANDARD = gnu11; 222 | GCC_DYNAMIC_NO_PIC = NO; 223 | GCC_NO_COMMON_BLOCKS = YES; 224 | GCC_OPTIMIZATION_LEVEL = 0; 225 | GCC_PREPROCESSOR_DEFINITIONS = ( 226 | "DEBUG=1", 227 | "$(inherited)", 228 | ); 229 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 231 | GCC_WARN_UNDECLARED_SELECTOR = YES; 232 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 233 | GCC_WARN_UNUSED_FUNCTION = YES; 234 | GCC_WARN_UNUSED_VARIABLE = YES; 235 | IPHONEOS_DEPLOYMENT_TARGET = 13.7; 236 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 237 | MTL_FAST_MATH = YES; 238 | ONLY_ACTIVE_ARCH = YES; 239 | SDKROOT = iphoneos; 240 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 241 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 242 | }; 243 | name = Debug; 244 | }; 245 | 2191C71F252B0B5C00D3642C /* Release */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_ANALYZER_NONNULL = YES; 250 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_ENABLE_OBJC_WEAK = YES; 256 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 257 | CLANG_WARN_BOOL_CONVERSION = YES; 258 | CLANG_WARN_COMMA = YES; 259 | CLANG_WARN_CONSTANT_CONVERSION = YES; 260 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 262 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 263 | CLANG_WARN_EMPTY_BODY = YES; 264 | CLANG_WARN_ENUM_CONVERSION = YES; 265 | CLANG_WARN_INFINITE_RECURSION = YES; 266 | CLANG_WARN_INT_CONVERSION = YES; 267 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 268 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 269 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 270 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 271 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 272 | CLANG_WARN_STRICT_PROTOTYPES = YES; 273 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 274 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_NS_ASSERTIONS = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu11; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 285 | GCC_WARN_UNDECLARED_SELECTOR = YES; 286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 287 | GCC_WARN_UNUSED_FUNCTION = YES; 288 | GCC_WARN_UNUSED_VARIABLE = YES; 289 | IPHONEOS_DEPLOYMENT_TARGET = 13.7; 290 | MTL_ENABLE_DEBUG_INFO = NO; 291 | MTL_FAST_MATH = YES; 292 | SDKROOT = iphoneos; 293 | SWIFT_COMPILATION_MODE = wholemodule; 294 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 295 | VALIDATE_PRODUCT = YES; 296 | }; 297 | name = Release; 298 | }; 299 | 2191C721252B0B5C00D3642C /* Debug */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | CODE_SIGN_STYLE = Automatic; 304 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Stopwatch/Preview Content\""; 305 | DEVELOPMENT_TEAM = WT8M6SYS2R; 306 | ENABLE_PREVIEWS = YES; 307 | INFOPLIST_FILE = SwiftUI_Stopwatch/Info.plist; 308 | LD_RUNPATH_SEARCH_PATHS = ( 309 | "$(inherited)", 310 | "@executable_path/Frameworks", 311 | ); 312 | PRODUCT_BUNDLE_IDENTIFIER = "com.KishanNakum.SwiftUI-Stopwatch"; 313 | PRODUCT_NAME = "$(TARGET_NAME)"; 314 | SWIFT_VERSION = 5.0; 315 | TARGETED_DEVICE_FAMILY = "1,2"; 316 | }; 317 | name = Debug; 318 | }; 319 | 2191C722252B0B5C00D3642C /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 323 | CODE_SIGN_STYLE = Automatic; 324 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI_Stopwatch/Preview Content\""; 325 | DEVELOPMENT_TEAM = WT8M6SYS2R; 326 | ENABLE_PREVIEWS = YES; 327 | INFOPLIST_FILE = SwiftUI_Stopwatch/Info.plist; 328 | LD_RUNPATH_SEARCH_PATHS = ( 329 | "$(inherited)", 330 | "@executable_path/Frameworks", 331 | ); 332 | PRODUCT_BUNDLE_IDENTIFIER = "com.KishanNakum.SwiftUI-Stopwatch"; 333 | PRODUCT_NAME = "$(TARGET_NAME)"; 334 | SWIFT_VERSION = 5.0; 335 | TARGETED_DEVICE_FAMILY = "1,2"; 336 | }; 337 | name = Release; 338 | }; 339 | /* End XCBuildConfiguration section */ 340 | 341 | /* Begin XCConfigurationList section */ 342 | 2191C707252B0B5900D3642C /* Build configuration list for PBXProject "SwiftUI_Stopwatch" */ = { 343 | isa = XCConfigurationList; 344 | buildConfigurations = ( 345 | 2191C71E252B0B5C00D3642C /* Debug */, 346 | 2191C71F252B0B5C00D3642C /* Release */, 347 | ); 348 | defaultConfigurationIsVisible = 0; 349 | defaultConfigurationName = Release; 350 | }; 351 | 2191C720252B0B5C00D3642C /* Build configuration list for PBXNativeTarget "SwiftUI_Stopwatch" */ = { 352 | isa = XCConfigurationList; 353 | buildConfigurations = ( 354 | 2191C721252B0B5C00D3642C /* Debug */, 355 | 2191C722252B0B5C00D3642C /* Release */, 356 | ); 357 | defaultConfigurationIsVisible = 0; 358 | defaultConfigurationName = Release; 359 | }; 360 | /* End XCConfigurationList section */ 361 | }; 362 | rootObject = 2191C704252B0B5900D3642C /* Project object */; 363 | } 364 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Stopwatch/SwiftUI_Stopwatch.xcodeproj/project.xcworkspace/xcuserdata/kishannakum.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch.xcodeproj/xcuserdata/kishannakum.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwiftUI_Stopwatch.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftUI_Stopwatch 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. 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 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/Color.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.949", 9 | "green" : "0.290", 10 | "red" : "0.306" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/Color1.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.902", 9 | "green" : "0.859", 10 | "red" : "0.188" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/Color2.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.133", 9 | "green" : "0.090", 10 | "red" : "0.059" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/start.imageset/984752-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/start.imageset/984752-128.png -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/start.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "984752-128.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/stop.imageset/1868960-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakumKishan/SwiftUI_Code/7b8ba9d777d28a57b08edf73375bfd7df966ddea/Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/stop.imageset/1868960-128.png -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Assets.xcassets/stop.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "1868960-128.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/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 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Calculations.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Calculations.swift 3 | // SwiftUI_Calculator 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | 12 | func getTimeString(cS: Int, sS : Int, mS: Int) -> String{ 13 | var centiString = String(cS) 14 | var secString = String(sS) 15 | var minString = String(mS) 16 | if(cS<10){ 17 | centiString = "0\(cS)" 18 | } 19 | if(sS<10){ 20 | secString = "0\(sS)" 21 | } 22 | if(mS<10){ 23 | minString = "0\(mS)" 24 | } 25 | return "\(minString):\(secString).\(centiString)" 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/CardView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardView.swift 3 | // SwiftUI_Calculator 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct CardView : View, Identifiable { 12 | let id = UUID() 13 | let num : Int 14 | let time : String 15 | 16 | init(n : Int, t : String){ 17 | num = n 18 | time = t 19 | } 20 | 21 | var body: some View{ 22 | 23 | ZStack() { 24 | 25 | HStack(alignment: .center,spacing: 15){ 26 | 27 | Text("Lap \(self.num)") 28 | .fontWeight(.bold) 29 | .foregroundColor(Color.white.opacity(0.7)) 30 | .padding() 31 | 32 | Spacer(minLength: 0) 33 | Text(self.time) 34 | .fontWeight(.bold) 35 | .foregroundColor(Color.white.opacity(0.7)) 36 | .padding() 37 | 38 | } 39 | } .frame(width: screen.bounds.width - 40 , height: 60) 40 | .background(Color("Color2")) 41 | .cornerRadius(10) 42 | .shadow(color: Color.white.opacity(0.05), radius: 5, x: -5, y: -5) 43 | .shadow(color: Color.black.opacity(0.9), radius: 5, x: 5, y: 5) 44 | 45 | 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI_Calculator 4 | // 5 | // Created by Kishan Nakum on 11/09/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ContentView: View { 12 | let timer = Timer.publish(every: 0.01, on: .main, in: .common).autoconnect() 13 | @State var minutes = 0 14 | @State var seconds = 0 15 | @State var centiseconds = 0 16 | @State var running = false 17 | @State var lapTimes : [CardView] = [] 18 | @State var lapCount = 1 19 | @State var lapMinutes = 0 20 | @State var lapSeconds = 0 21 | @State var lapCentiseconds = 0 22 | 23 | 24 | var body: some View { 25 | VStack(){ 26 | VStack{ 27 | Text(getTimeString(cS: self.centiseconds, sS: self.seconds, mS: self.minutes)) 28 | .font(.system(size: 60, weight: Font.Weight.bold, design:Font.Design.monospaced)) 29 | .frame(width: 300.0, height: 100.0) 30 | 31 | .onReceive(self.timer){_ in 32 | if(self.running){ 33 | self.timerCalculation() 34 | } 35 | } 36 | HStack{ 37 | Button(action: { 38 | if(!self.running){ 39 | self.minutes = 0 40 | self.seconds = 0 41 | self.centiseconds = 0 42 | self.lapTimes = [] 43 | self.lapMinutes = 0 44 | self.lapSeconds = 0 45 | self.lapCentiseconds = 0 46 | self.lapCount = 1 47 | } 48 | else{ 49 | 50 | self.lapTimes.append(CardView(n: self.lapCount, t: getTimeString(cS: self.lapCentiseconds, sS: self.lapSeconds, mS: self.lapMinutes))) 51 | self.lapCount += 1 52 | self.lapMinutes = 0 53 | self.lapSeconds = 0 54 | self.lapCentiseconds = 0 55 | } 56 | }) { 57 | ZStack{ 58 | Circle().fill(Color("Color2")).frame(width: 100, height: 100) .background(Color("Color2")) 59 | .cornerRadius(10) 60 | .shadow(color: Color.white.opacity(0.05), radius: 5, x: -5, y: -5) 61 | .shadow(color: Color.black.opacity(0.9), radius: 5, x: 5, y: 5) 62 | 63 | self.running ? Text("Lap").foregroundColor(Color.white).foregroundColor(Color.red) .fontWeight(.bold) 64 | .font(.system(size: 25)) 65 | .foregroundColor(Color.white.opacity(0.7)) : Text("Reset").foregroundColor(Color.white).foregroundColor(Color.red) .fontWeight(.bold) 66 | .font(.system(size: 25)) 67 | .foregroundColor(Color.white.opacity(0.7)) 68 | } 69 | } 70 | 71 | Spacer() 72 | Button(action: { 73 | self.running = !self.running 74 | }) { 75 | ZStack{ 76 | Circle().fill(Color("Color2")).frame(width: 100, height: 100).font(.system(size: 20, design: .monospaced)) 77 | .background(Color("Color2")) 78 | .cornerRadius(10) 79 | .shadow(color: Color.white.opacity(0.05), radius: 5, x: -5, y: -5) 80 | .shadow(color: Color.black.opacity(0.9), radius: 5, x: 5, y: 5) 81 | 82 | Image(self.running ? "stop" : "start") 83 | .resizable() 84 | .frame(width: 60, height: 60, alignment: .center) 85 | .aspectRatio(contentMode: .fit) 86 | .shadow(color: Color.white.opacity(0.05), radius: 5, x: -5, y: -5) 87 | .shadow(color: Color.black.opacity(0.9), radius: 5, x: 5, y: 5) 88 | 89 | } 90 | } 91 | } 92 | } 93 | .padding(.horizontal) 94 | .padding(.top, (UIApplication.shared.windows.first?.safeAreaInsets.top)! + 10) 95 | .padding(.bottom, 20) 96 | .background( 97 | 98 | ZStack(alignment: .topTrailing, content: { 99 | 100 | LinearGradient(gradient: .init(colors: [Color("Color1"),Color("Color")]), startPoint: .topLeading, endPoint: .bottomTrailing) 101 | 102 | } 103 | ) .edgesIgnoringSafeArea(.top) 104 | 105 | ) 106 | 107 | ScrollView(.vertical, showsIndicators: false) { 108 | 109 | VStack(spacing: 10) { 110 | 111 | ForEach(self.lapTimes.reversed()){item in 112 | GeometryReader { (proxy: GeometryProxy) in 113 | 114 | item 115 | .shadow(color: Color.black.opacity(0.16), radius: 5, x: 0, y: 5) 116 | }.frame(width: screen.bounds.width - 40 , height: 60) 117 | } 118 | } 119 | .frame(maxWidth: .infinity, maxHeight: .infinity) 120 | 121 | } 122 | .frame(maxWidth: .infinity, maxHeight: .infinity) 123 | 124 | } .background(Color("Color2").edgesIgnoringSafeArea(.all)) 125 | .edgesIgnoringSafeArea(.top) 126 | .shadow(color: Color.white.opacity(0.05), radius: 5, x: -5, y: -5) 127 | .shadow(color: Color.black.opacity(0.9), radius: 5, x: 5, y: 5) 128 | 129 | 130 | } 131 | 132 | 133 | func timerCalculation(){ 134 | if(self.centiseconds < 99){ 135 | self.centiseconds += 1 136 | } 137 | else{ 138 | self.centiseconds = 0 139 | if(self.seconds < 59){ 140 | self.seconds += 1 141 | } 142 | else{ 143 | self.seconds = 0 144 | self.minutes += 1 145 | } 146 | } 147 | 148 | if(self.lapCentiseconds < 99){ 149 | self.lapCentiseconds += 1 150 | } 151 | else{ 152 | self.lapCentiseconds = 0 153 | if(self.lapSeconds < 59){ 154 | self.lapSeconds += 1 155 | } 156 | else{ 157 | self.lapSeconds = 0 158 | self.lapMinutes += 1 159 | } 160 | } 161 | } 162 | } 163 | 164 | 165 | 166 | 167 | struct ContentView_Previews: PreviewProvider { 168 | static var previews: some View { 169 | ContentView() 170 | } 171 | } 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Helper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helper.swift 3 | // SwiftUI_Calculator 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | let screen = UIScreen.main 12 | 13 | extension Color { 14 | init(hex: String) { 15 | let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) 16 | var int: UInt64 = 0 17 | Scanner(string: hex).scanHexInt64(&int) 18 | let a, r, g, b: UInt64 19 | switch hex.count { 20 | case 3: // RGB (12-bit) 21 | (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) 22 | case 6: // RGB (24-bit) 23 | (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) 24 | case 8: // ARGB (32-bit) 25 | (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) 26 | default: 27 | (a, r, g, b) = (1, 1, 1, 0) 28 | } 29 | 30 | self.init( 31 | .sRGB, 32 | red: Double(r) / 255, 33 | green: Double(g) / 255, 34 | blue: Double(b) / 255, 35 | opacity: Double(a) / 255 36 | ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/ItemView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ItemView.swift 3 | // SwiftUI_Calculator 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct LapTime : View, Identifiable{ 12 | let id = UUID() 13 | let num : Int 14 | let time : String 15 | 16 | var body : some View{ 17 | HStack{ 18 | Text("Lap \(num)").font(.system(size: 20, design: .monospaced)) 19 | Spacer() 20 | Text(time).font(.system(size: 20, design: .monospaced)) 21 | } 22 | } 23 | 24 | init(n : Int, t : String){ 25 | num = n 26 | time = t 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Stopwatch/SwiftUI_Stopwatch/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftUI_Stopwatch 4 | // 5 | // Created by Kishan Nakum on 05/10/20. 6 | // Copyright © 2020 Kishan Nakum. 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 | // Create the SwiftUI view that provides the window contents. 23 | let contentView = ContentView() 24 | 25 | // Use a UIHostingController as window root view controller. 26 | if let windowScene = scene as? UIWindowScene { 27 | let window = UIWindow(windowScene: windowScene) 28 | window.rootViewController = UIHostingController(rootView: contentView) 29 | self.window = window 30 | window.makeKeyAndVisible() 31 | } 32 | } 33 | 34 | func sceneDidDisconnect(_ scene: UIScene) { 35 | // Called as the scene is being released by the system. 36 | // This occurs shortly after the scene enters the background, or when its session is discarded. 37 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 39 | } 40 | 41 | func sceneDidBecomeActive(_ scene: UIScene) { 42 | // Called when the scene has moved from an inactive state to an active state. 43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 44 | } 45 | 46 | func sceneWillResignActive(_ scene: UIScene) { 47 | // Called when the scene will move from an active state to an inactive state. 48 | // This may occur due to temporary interruptions (ex. an incoming phone call). 49 | } 50 | 51 | func sceneWillEnterForeground(_ scene: UIScene) { 52 | // Called as the scene transitions from the background to the foreground. 53 | // Use this method to undo the changes made on entering the background. 54 | } 55 | 56 | func sceneDidEnterBackground(_ scene: UIScene) { 57 | // Called as the scene transitions from the foreground to the background. 58 | // Use this method to save data, release shared resources, and store enough scene-specific state information 59 | // to restore the scene back to its current state. 60 | } 61 | 62 | 63 | } 64 | 65 | --------------------------------------------------------------------------------