Skip to content

Commit 5fc9b0d

Browse files
committed
100 Days of SwiftUI - Day 29
Project 5 - Part one - Word Scramble Introduction - Introducing List, your best friend - Loading resources from your app bundle
1 parent 1a24d5f commit 5fc9b0d

File tree

13 files changed

+12943
-5
lines changed

13 files changed

+12943
-5
lines changed

Classic/Milestones/Milestone-Projects16_18/Milestone-Projects16_18/Target.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ class Target: SKNode {
2929
target = SKSpriteNode(imageNamed: "target\(targetType)")
3030

3131
target.name = "target"
32-
target.position.y += 116
33-
target.xScale *= scale
34-
target.yScale *= scale
32+
let targetHeight = target.size.height
33+
target.setScale(scale)
34+
let heightDiff = targetHeight - target.size.height
35+
target.position.y += stick.size.height - heightDiff
3536

3637
addChild(stick)
3738
addChild(target)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ Challenges are available inside [`SwiftUI`](SwiftUI) directory. (🚧 Still in p
3838
[swift_current_day]: https://www.hackingwithswift.com/100/66
3939
[swift_progress]: https://img.shields.io/badge/100%20Days%20of%20Swift-66-D64D42
4040

41-
[swiftui_current_day]: https://www.hackingwithswift.com/100/swiftui/28
42-
[swiftui_progress]: https://img.shields.io/badge/100%20Days%20of%20SwiftUI-28-3463DA
41+
[swiftui_current_day]: https://www.hackingwithswift.com/100/swiftui/29
42+
[swiftui_progress]: https://img.shields.io/badge/100%20Days%20of%20SwiftUI-29-3463DA
Lines changed: 346 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 55;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
01A0CA5D284E536100FC6746 /* WordScrambleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A0CA5C284E536100FC6746 /* WordScrambleApp.swift */; };
11+
01A0CA5F284E536100FC6746 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A0CA5E284E536100FC6746 /* ContentView.swift */; };
12+
01A0CA61284E536300FC6746 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01A0CA60284E536300FC6746 /* Assets.xcassets */; };
13+
01A0CA64284E536300FC6746 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01A0CA63284E536300FC6746 /* Preview Assets.xcassets */; };
14+
01A0CA6B284E55BB00FC6746 /* start.txt in Resources */ = {isa = PBXBuildFile; fileRef = 01A0CA6A284E55BB00FC6746 /* start.txt */; };
15+
/* End PBXBuildFile section */
16+
17+
/* Begin PBXFileReference section */
18+
01A0CA59284E536100FC6746 /* WordScramble.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WordScramble.app; sourceTree = BUILT_PRODUCTS_DIR; };
19+
01A0CA5C284E536100FC6746 /* WordScrambleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordScrambleApp.swift; sourceTree = "<group>"; };
20+
01A0CA5E284E536100FC6746 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
21+
01A0CA60284E536300FC6746 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
22+
01A0CA63284E536300FC6746 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
23+
01A0CA6A284E55BB00FC6746 /* start.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = start.txt; sourceTree = "<group>"; };
24+
/* End PBXFileReference section */
25+
26+
/* Begin PBXFrameworksBuildPhase section */
27+
01A0CA56284E536100FC6746 /* Frameworks */ = {
28+
isa = PBXFrameworksBuildPhase;
29+
buildActionMask = 2147483647;
30+
files = (
31+
);
32+
runOnlyForDeploymentPostprocessing = 0;
33+
};
34+
/* End PBXFrameworksBuildPhase section */
35+
36+
/* Begin PBXGroup section */
37+
01A0CA50284E536100FC6746 = {
38+
isa = PBXGroup;
39+
children = (
40+
01A0CA5B284E536100FC6746 /* WordScramble */,
41+
01A0CA5A284E536100FC6746 /* Products */,
42+
);
43+
sourceTree = "<group>";
44+
};
45+
01A0CA5A284E536100FC6746 /* Products */ = {
46+
isa = PBXGroup;
47+
children = (
48+
01A0CA59284E536100FC6746 /* WordScramble.app */,
49+
);
50+
name = Products;
51+
sourceTree = "<group>";
52+
};
53+
01A0CA5B284E536100FC6746 /* WordScramble */ = {
54+
isa = PBXGroup;
55+
children = (
56+
01A0CA5C284E536100FC6746 /* WordScrambleApp.swift */,
57+
01A0CA5E284E536100FC6746 /* ContentView.swift */,
58+
01A0CA6A284E55BB00FC6746 /* start.txt */,
59+
01A0CA60284E536300FC6746 /* Assets.xcassets */,
60+
01A0CA62284E536300FC6746 /* Preview Content */,
61+
);
62+
path = WordScramble;
63+
sourceTree = "<group>";
64+
};
65+
01A0CA62284E536300FC6746 /* Preview Content */ = {
66+
isa = PBXGroup;
67+
children = (
68+
01A0CA63284E536300FC6746 /* Preview Assets.xcassets */,
69+
);
70+
path = "Preview Content";
71+
sourceTree = "<group>";
72+
};
73+
/* End PBXGroup section */
74+
75+
/* Begin PBXNativeTarget section */
76+
01A0CA58284E536100FC6746 /* WordScramble */ = {
77+
isa = PBXNativeTarget;
78+
buildConfigurationList = 01A0CA67284E536300FC6746 /* Build configuration list for PBXNativeTarget "WordScramble" */;
79+
buildPhases = (
80+
01A0CA55284E536100FC6746 /* Sources */,
81+
01A0CA56284E536100FC6746 /* Frameworks */,
82+
01A0CA57284E536100FC6746 /* Resources */,
83+
);
84+
buildRules = (
85+
);
86+
dependencies = (
87+
);
88+
name = WordScramble;
89+
productName = WordScramble;
90+
productReference = 01A0CA59284E536100FC6746 /* WordScramble.app */;
91+
productType = "com.apple.product-type.application";
92+
};
93+
/* End PBXNativeTarget section */
94+
95+
/* Begin PBXProject section */
96+
01A0CA51284E536100FC6746 /* Project object */ = {
97+
isa = PBXProject;
98+
attributes = {
99+
BuildIndependentTargetsInParallel = 1;
100+
LastSwiftUpdateCheck = 1340;
101+
LastUpgradeCheck = 1340;
102+
TargetAttributes = {
103+
01A0CA58284E536100FC6746 = {
104+
CreatedOnToolsVersion = 13.4.1;
105+
};
106+
};
107+
};
108+
buildConfigurationList = 01A0CA54284E536100FC6746 /* Build configuration list for PBXProject "WordScramble" */;
109+
compatibilityVersion = "Xcode 13.0";
110+
developmentRegion = en;
111+
hasScannedForEncodings = 0;
112+
knownRegions = (
113+
en,
114+
Base,
115+
);
116+
mainGroup = 01A0CA50284E536100FC6746;
117+
productRefGroup = 01A0CA5A284E536100FC6746 /* Products */;
118+
projectDirPath = "";
119+
projectRoot = "";
120+
targets = (
121+
01A0CA58284E536100FC6746 /* WordScramble */,
122+
);
123+
};
124+
/* End PBXProject section */
125+
126+
/* Begin PBXResourcesBuildPhase section */
127+
01A0CA57284E536100FC6746 /* Resources */ = {
128+
isa = PBXResourcesBuildPhase;
129+
buildActionMask = 2147483647;
130+
files = (
131+
01A0CA64284E536300FC6746 /* Preview Assets.xcassets in Resources */,
132+
01A0CA6B284E55BB00FC6746 /* start.txt in Resources */,
133+
01A0CA61284E536300FC6746 /* Assets.xcassets in Resources */,
134+
);
135+
runOnlyForDeploymentPostprocessing = 0;
136+
};
137+
/* End PBXResourcesBuildPhase section */
138+
139+
/* Begin PBXSourcesBuildPhase section */
140+
01A0CA55284E536100FC6746 /* Sources */ = {
141+
isa = PBXSourcesBuildPhase;
142+
buildActionMask = 2147483647;
143+
files = (
144+
01A0CA5F284E536100FC6746 /* ContentView.swift in Sources */,
145+
01A0CA5D284E536100FC6746 /* WordScrambleApp.swift in Sources */,
146+
);
147+
runOnlyForDeploymentPostprocessing = 0;
148+
};
149+
/* End PBXSourcesBuildPhase section */
150+
151+
/* Begin XCBuildConfiguration section */
152+
01A0CA65284E536300FC6746 /* Debug */ = {
153+
isa = XCBuildConfiguration;
154+
buildSettings = {
155+
ALWAYS_SEARCH_USER_PATHS = NO;
156+
CLANG_ANALYZER_NONNULL = YES;
157+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
158+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
159+
CLANG_ENABLE_MODULES = YES;
160+
CLANG_ENABLE_OBJC_ARC = YES;
161+
CLANG_ENABLE_OBJC_WEAK = YES;
162+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
163+
CLANG_WARN_BOOL_CONVERSION = YES;
164+
CLANG_WARN_COMMA = YES;
165+
CLANG_WARN_CONSTANT_CONVERSION = YES;
166+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
167+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
168+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
169+
CLANG_WARN_EMPTY_BODY = YES;
170+
CLANG_WARN_ENUM_CONVERSION = YES;
171+
CLANG_WARN_INFINITE_RECURSION = YES;
172+
CLANG_WARN_INT_CONVERSION = YES;
173+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
174+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
175+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
176+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
177+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
178+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
179+
CLANG_WARN_STRICT_PROTOTYPES = YES;
180+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
181+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
182+
CLANG_WARN_UNREACHABLE_CODE = YES;
183+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
184+
COPY_PHASE_STRIP = NO;
185+
DEBUG_INFORMATION_FORMAT = dwarf;
186+
ENABLE_STRICT_OBJC_MSGSEND = YES;
187+
ENABLE_TESTABILITY = YES;
188+
GCC_C_LANGUAGE_STANDARD = gnu11;
189+
GCC_DYNAMIC_NO_PIC = NO;
190+
GCC_NO_COMMON_BLOCKS = YES;
191+
GCC_OPTIMIZATION_LEVEL = 0;
192+
GCC_PREPROCESSOR_DEFINITIONS = (
193+
"DEBUG=1",
194+
"$(inherited)",
195+
);
196+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
197+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
198+
GCC_WARN_UNDECLARED_SELECTOR = YES;
199+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
200+
GCC_WARN_UNUSED_FUNCTION = YES;
201+
GCC_WARN_UNUSED_VARIABLE = YES;
202+
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
203+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
204+
MTL_FAST_MATH = YES;
205+
ONLY_ACTIVE_ARCH = YES;
206+
SDKROOT = iphoneos;
207+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
208+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
209+
};
210+
name = Debug;
211+
};
212+
01A0CA66284E536300FC6746 /* Release */ = {
213+
isa = XCBuildConfiguration;
214+
buildSettings = {
215+
ALWAYS_SEARCH_USER_PATHS = NO;
216+
CLANG_ANALYZER_NONNULL = YES;
217+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
218+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
219+
CLANG_ENABLE_MODULES = YES;
220+
CLANG_ENABLE_OBJC_ARC = YES;
221+
CLANG_ENABLE_OBJC_WEAK = YES;
222+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
223+
CLANG_WARN_BOOL_CONVERSION = YES;
224+
CLANG_WARN_COMMA = YES;
225+
CLANG_WARN_CONSTANT_CONVERSION = YES;
226+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
227+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
228+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
229+
CLANG_WARN_EMPTY_BODY = YES;
230+
CLANG_WARN_ENUM_CONVERSION = YES;
231+
CLANG_WARN_INFINITE_RECURSION = YES;
232+
CLANG_WARN_INT_CONVERSION = YES;
233+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
234+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
235+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
236+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
237+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
238+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
239+
CLANG_WARN_STRICT_PROTOTYPES = YES;
240+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
241+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
242+
CLANG_WARN_UNREACHABLE_CODE = YES;
243+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
244+
COPY_PHASE_STRIP = NO;
245+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
246+
ENABLE_NS_ASSERTIONS = NO;
247+
ENABLE_STRICT_OBJC_MSGSEND = YES;
248+
GCC_C_LANGUAGE_STANDARD = gnu11;
249+
GCC_NO_COMMON_BLOCKS = YES;
250+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
251+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
252+
GCC_WARN_UNDECLARED_SELECTOR = YES;
253+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
254+
GCC_WARN_UNUSED_FUNCTION = YES;
255+
GCC_WARN_UNUSED_VARIABLE = YES;
256+
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
257+
MTL_ENABLE_DEBUG_INFO = NO;
258+
MTL_FAST_MATH = YES;
259+
SDKROOT = iphoneos;
260+
SWIFT_COMPILATION_MODE = wholemodule;
261+
SWIFT_OPTIMIZATION_LEVEL = "-O";
262+
VALIDATE_PRODUCT = YES;
263+
};
264+
name = Release;
265+
};
266+
01A0CA68284E536300FC6746 /* Debug */ = {
267+
isa = XCBuildConfiguration;
268+
buildSettings = {
269+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
270+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
271+
CODE_SIGN_STYLE = Automatic;
272+
CURRENT_PROJECT_VERSION = 1;
273+
DEVELOPMENT_ASSET_PATHS = "\"WordScramble/Preview Content\"";
274+
ENABLE_PREVIEWS = YES;
275+
GENERATE_INFOPLIST_FILE = YES;
276+
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
277+
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
278+
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
279+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
280+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
281+
LD_RUNPATH_SEARCH_PATHS = (
282+
"$(inherited)",
283+
"@executable_path/Frameworks",
284+
);
285+
MARKETING_VERSION = 1.0;
286+
PRODUCT_BUNDLE_IDENTIFIER = com.cdalvaro.WordScramble;
287+
PRODUCT_NAME = "$(TARGET_NAME)";
288+
SWIFT_EMIT_LOC_STRINGS = YES;
289+
SWIFT_VERSION = 5.0;
290+
TARGETED_DEVICE_FAMILY = "1,2";
291+
};
292+
name = Debug;
293+
};
294+
01A0CA69284E536300FC6746 /* Release */ = {
295+
isa = XCBuildConfiguration;
296+
buildSettings = {
297+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
299+
CODE_SIGN_STYLE = Automatic;
300+
CURRENT_PROJECT_VERSION = 1;
301+
DEVELOPMENT_ASSET_PATHS = "\"WordScramble/Preview Content\"";
302+
ENABLE_PREVIEWS = YES;
303+
GENERATE_INFOPLIST_FILE = YES;
304+
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
305+
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
306+
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
307+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
308+
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
309+
LD_RUNPATH_SEARCH_PATHS = (
310+
"$(inherited)",
311+
"@executable_path/Frameworks",
312+
);
313+
MARKETING_VERSION = 1.0;
314+
PRODUCT_BUNDLE_IDENTIFIER = com.cdalvaro.WordScramble;
315+
PRODUCT_NAME = "$(TARGET_NAME)";
316+
SWIFT_EMIT_LOC_STRINGS = YES;
317+
SWIFT_VERSION = 5.0;
318+
TARGETED_DEVICE_FAMILY = "1,2";
319+
};
320+
name = Release;
321+
};
322+
/* End XCBuildConfiguration section */
323+
324+
/* Begin XCConfigurationList section */
325+
01A0CA54284E536100FC6746 /* Build configuration list for PBXProject "WordScramble" */ = {
326+
isa = XCConfigurationList;
327+
buildConfigurations = (
328+
01A0CA65284E536300FC6746 /* Debug */,
329+
01A0CA66284E536300FC6746 /* Release */,
330+
);
331+
defaultConfigurationIsVisible = 0;
332+
defaultConfigurationName = Release;
333+
};
334+
01A0CA67284E536300FC6746 /* Build configuration list for PBXNativeTarget "WordScramble" */ = {
335+
isa = XCConfigurationList;
336+
buildConfigurations = (
337+
01A0CA68284E536300FC6746 /* Debug */,
338+
01A0CA69284E536300FC6746 /* Release */,
339+
);
340+
defaultConfigurationIsVisible = 0;
341+
defaultConfigurationName = Release;
342+
};
343+
/* End XCConfigurationList section */
344+
};
345+
rootObject = 01A0CA51284E536100FC6746 /* Project object */;
346+
}

SwiftUI/Projects/WordScramble/WordScramble.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}

0 commit comments

Comments
 (0)