Skip to content

Commit bf90961

Browse files
committed
Update
1 parent 93b0d33 commit bf90961

File tree

8 files changed

+339
-472
lines changed

8 files changed

+339
-472
lines changed

PG5602_H24-4.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@
404404
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
405405
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
406406
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
407+
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
407408
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
408409
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
409410
LD_RUNPATH_SEARCH_PATHS = (
@@ -435,6 +436,7 @@
435436
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
436437
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
437438
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
439+
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
438440
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
439441
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
440442
LD_RUNPATH_SEARCH_PATHS = (

PG5602_H24-4/Entities/Article.swift

+3-32
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,6 @@
88
import Foundation
99
import SwiftData
1010

11-
//@Model
12-
//class Article: Identifiable {
13-
// @Attribute(.unique) var id: UUID
14-
// var author: String?
15-
// var title: String
16-
// var url: String
17-
// var urlToImage: String?
18-
// var content: String?
19-
// var publishedAt: String?
20-
// var articleDescription: String?
21-
// var savedDate: Date
22-
// var editedDate: Date?
23-
// var category: Category?
24-
// var note: String?
25-
//
26-
// init(article: NewsArticle, category: Category? = nil, note: String? = nil ) {
27-
// self.id = UUID()
28-
// self.author = article.author
29-
// self.title = article.title
30-
// self.url = article.url
31-
// self.urlToImage = article.urlToImage
32-
// self.content = article.description
33-
// self.publishedAt = article.publishedAt
34-
// self.articleDescription = article.description
35-
// self.savedDate = Date()
36-
// self.editedDate = nil
37-
// self.category = category
38-
// self.note = note
39-
// }
40-
//}
41-
4211
@Model
4312
class Article: Identifiable {
4413
@Attribute(.unique) var id: UUID
@@ -49,10 +18,11 @@ class Article: Identifiable {
4918
var articleDescription: String?
5019
var publishedAt: String?
5120
var savedDate: Date
21+
var isArchived: Bool = false
5222
@Relationship(deleteRule: .nullify) var category: Category?
5323
var note: String?
5424

55-
init(article: NewsArticle, category: Category? = nil, note: String? = nil ) {
25+
init(article: NewsArticle, category: Category? = nil, isArchived: Bool = false, note: String? = nil ) {
5626
self.id = UUID()
5727
self.author = article.author
5828
self.title = article.title
@@ -62,6 +32,7 @@ class Article: Identifiable {
6232
self.publishedAt = article.publishedAt
6333
self.savedDate = Date()
6434
self.category = category
35+
self.isArchived = isArchived
6536
self.note = note
6637
}
6738
}

0 commit comments

Comments
 (0)