-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from tunds/storing-images-swiftdata
Added the source code for the tutorials
- Loading branch information
Showing
167 changed files
with
5,954 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+4 KB
...ships Into SwiftData ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/._.DS_Store
Binary file not shown.
Binary file added
BIN
+4 KB
...tionships Into SwiftData ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/._ToDos
Binary file not shown.
Binary file added
BIN
+4 KB
...Into SwiftData ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/._.DS_Store
Binary file not shown.
Binary file added
BIN
+4 KB
...wiftData ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/._ToDos.xcodeproj
Binary file not shown.
Binary file added
BIN
+4 KB
...ner ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos.xcodeproj/._project.xcworkspace
Binary file not shown.
410 changes: 410 additions & 0 deletions
410
...Container ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...rial/Source Code/Final/ToDos/ToDos.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...ode/Final/ToDos/ToDos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
14 changes: 14 additions & 0 deletions
14
...ode/Final/ToDos/ToDos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "swiftui-image-viewer", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/fuzzzlove/swiftui-image-viewer.git", | ||
"state" : { | ||
"revision" : "ca77123064ae046eac2be01654ee756085c2b182", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
Binary file added
BIN
+178 KB
...project.xcworkspace/xcuserdata/tunde.adegoroye.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
40 changes: 40 additions & 0 deletions
40
...Dos.xcodeproj/xcuserdata/tunde.adegoroye.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "DBED851F-AAE1-4A42-A495-63D454BFCA89" | ||
type = "1" | ||
version = "2.0"> | ||
<Breakpoints> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
uuid = "76BB2919-97CD-471A-8C01-33B1C52F4192" | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../../../private/var/folders/4l/6n10zl2s2k55g87ys44r0fx8kctm43/T/swift-generated-sources/@__swiftmacro_5ToDos4Item5ModelfMc_.swift" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "1" | ||
endingLineNumber = "1" | ||
landmarkName = "Item" | ||
landmarkType = "37"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
uuid = "4DB25283-4A31-4DA0-839E-03EA3A7E0C55" | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "ToDos/CategoriesJSONDecoder.swift" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "25" | ||
endingLineNumber = "25" | ||
landmarkName = "decode(from:type:)" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
</Breakpoints> | ||
</Bucket> |
14 changes: 14 additions & 0 deletions
14
...ToDos.xcodeproj/xcuserdata/tunde.adegoroye.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>ToDos.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+4 KB
...ainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._CategoriesJSONDecoder.swift
Binary file not shown.
Binary file added
BIN
+4 KB
... ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._ContentView.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...ontainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._CreateCategoryView.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...lContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._DefaultCategories.json
Binary file not shown.
Binary file added
BIN
+4 KB
... ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._DefaultToDos.json
Binary file not shown.
Binary file added
BIN
+4 KB
...iftData ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._Item.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...delContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._ItemsContainer.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...delContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._ModifyTodoView.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...ata ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._ToDosApp.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...ata ModelContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._TodoView.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...delContainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/._UpdateToDoView.swift
Binary file not shown.
Binary file added
BIN
+4 KB
...torial/Source Code/Final/ToDos/ToDos/Assets.xcassets/AccentColor.colorset/._Contents.json
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
...Tutorial/Source Code/Final/ToDos/ToDos/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...a Tutorial/Source Code/Final/ToDos/ToDos/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ata Tutorial/Source Code/Final/ToDos/ToDos/Assets.xcassets/holiday.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "holiday.jpeg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.57 MB
...ial/Source Code/Final/ToDos/ToDos/Assets.xcassets/holiday.imageset/holiday.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
...ntainer ⚡️ | SwiftData Tutorial/Source Code/Final/ToDos/ToDos/CategoriesJSONDecoder.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// CategoriesJSONDecoder.swift | ||
// ToDos | ||
// | ||
// Created by Tunde Adegoroye on 03/07/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
struct DefaultsJSON { | ||
|
||
static func decode<T: Codable>(from fileName: String, type: T.Type) -> T? { | ||
|
||
do { | ||
guard let url = Bundle.main.url(forResource: fileName, withExtension: "json"), | ||
let data = try? Data(contentsOf: url) else { | ||
return nil | ||
} | ||
|
||
let result = try JSONDecoder().decode(T.self, from: data) | ||
|
||
return result | ||
} catch { | ||
print(error) | ||
return nil | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.