Skip to content

Commit 4309853

Browse files
committed
Removed duplicate Item Core Data files
1 parent c02e413 commit 4309853

File tree

4 files changed

+13
-81
lines changed

4 files changed

+13
-81
lines changed

Item+CoreDataClass.swift

Lines changed: 0 additions & 15 deletions
This file was deleted.

Item+CoreDataProperties.swift

Lines changed: 0 additions & 44 deletions
This file was deleted.

iExpire.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
92513759298C8DB600916591 /* Item+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92513757298C8DB600916591 /* Item+CoreDataClass.swift */; };
11+
9251375A298C8DB600916591 /* Item+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92513758298C8DB600916591 /* Item+CoreDataProperties.swift */; };
1012
92CCF02A2985FF120066A4A4 /* ItemEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92CCF0292985FF120066A4A4 /* ItemEditView.swift */; };
1113
92E1884D297BB47C009BD0E4 /* PhotoSelectorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92E1884C297BB47C009BD0E4 /* PhotoSelectorView.swift */; };
1214
92E18851297C6F12009BD0E4 /* ItemDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92E18850297C6F12009BD0E4 /* ItemDetailView.swift */; };
@@ -27,13 +29,13 @@
2729
92FA0B59297A399D00F12C85 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 92FA0B56297A399D00F12C85 /* README.md */; };
2830
92FA0B5A297A399D00F12C85 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 92FA0B57297A399D00F12C85 /* LICENSE */; };
2931
92FA0B5D297A3F5A00F12C85 /* iExpireProject.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 92FA0B5B297A3F5A00F12C85 /* iExpireProject.xcdatamodeld */; };
30-
92FA0B6D297A4C7900F12C85 /* Item+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FA0B6B297A4C7900F12C85 /* Item+CoreDataClass.swift */; };
31-
92FA0B6E297A4C7900F12C85 /* Item+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FA0B6C297A4C7900F12C85 /* Item+CoreDataProperties.swift */; };
3232
92FA0B70297A531600F12C85 /* DataController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FA0B6F297A531600F12C85 /* DataController.swift */; };
3333
92FA0B72297A5D3C00F12C85 /* TrackedItemsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FA0B71297A5D3C00F12C85 /* TrackedItemsView.swift */; };
3434
/* End PBXBuildFile section */
3535

3636
/* Begin PBXFileReference section */
37+
92513757298C8DB600916591 /* Item+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Item+CoreDataClass.swift"; sourceTree = "<group>"; };
38+
92513758298C8DB600916591 /* Item+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Item+CoreDataProperties.swift"; sourceTree = "<group>"; };
3739
92CCF0292985FF120066A4A4 /* ItemEditView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemEditView.swift; sourceTree = "<group>"; };
3840
92E1884B297BB04E009BD0E4 /* iExpire.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iExpire.entitlements; sourceTree = "<group>"; };
3941
92E1884C297BB47C009BD0E4 /* PhotoSelectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoSelectorView.swift; sourceTree = "<group>"; };
@@ -56,8 +58,6 @@
5658
92FA0B56297A399D00F12C85 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
5759
92FA0B57297A399D00F12C85 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
5860
92FA0B5C297A3F5A00F12C85 /* iExpireProject.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = iExpireProject.xcdatamodel; sourceTree = "<group>"; };
59-
92FA0B6B297A4C7900F12C85 /* Item+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Item+CoreDataClass.swift"; sourceTree = SOURCE_ROOT; };
60-
92FA0B6C297A4C7900F12C85 /* Item+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Item+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; };
6161
92FA0B6F297A531600F12C85 /* DataController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataController.swift; sourceTree = "<group>"; };
6262
92FA0B71297A5D3C00F12C85 /* TrackedItemsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackedItemsView.swift; sourceTree = "<group>"; };
6363
/* End PBXFileReference section */
@@ -155,8 +155,8 @@
155155
92FA0B5E297A408500F12C85 /* Models */ = {
156156
isa = PBXGroup;
157157
children = (
158-
92FA0B6B297A4C7900F12C85 /* Item+CoreDataClass.swift */,
159-
92FA0B6C297A4C7900F12C85 /* Item+CoreDataProperties.swift */,
158+
92513757298C8DB600916591 /* Item+CoreDataClass.swift */,
159+
92513758298C8DB600916591 /* Item+CoreDataProperties.swift */,
160160
);
161161
path = Models;
162162
sourceTree = "<group>";
@@ -238,6 +238,7 @@
238238
92E188732984CB14009BD0E4 /* CSVDocument.swift in Sources */,
239239
92E188662980D995009BD0E4 /* Notifications.swift in Sources */,
240240
92E188622980900D009BD0E4 /* NotificationPermission.swift in Sources */,
241+
9251375A298C8DB600916591 /* Item+CoreDataProperties.swift in Sources */,
241242
92FA0B5D297A3F5A00F12C85 /* iExpireProject.xcdatamodeld in Sources */,
242243
92FA0B70297A531600F12C85 /* DataController.swift in Sources */,
243244
92FA0B49297A326F00F12C85 /* AddExpirationView.swift in Sources */,
@@ -246,11 +247,10 @@
246247
92E1884D297BB47C009BD0E4 /* PhotoSelectorView.swift in Sources */,
247248
92E1886429809063009BD0E4 /* SettingsView.swift in Sources */,
248249
92E1885E297E52AE009BD0E4 /* ExpirationTextView.swift in Sources */,
250+
92513759298C8DB600916591 /* Item+CoreDataClass.swift in Sources */,
249251
92E1885C297E4D70009BD0E4 /* DateStringUtil.swift in Sources */,
250252
92CCF02A2985FF120066A4A4 /* ItemEditView.swift in Sources */,
251-
92FA0B6D297A4C7900F12C85 /* Item+CoreDataClass.swift in Sources */,
252253
92FA0B47297A326F00F12C85 /* iExpireApp.swift in Sources */,
253-
92FA0B6E297A4C7900F12C85 /* Item+CoreDataProperties.swift in Sources */,
254254
92E18868298378A3009BD0E4 /* CoreDataUtil.swift in Sources */,
255255
92FA0B72297A5D3C00F12C85 /* TrackedItemsView.swift in Sources */,
256256
);

iExpire/Models/Item+CoreDataProperties.swift

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ extension Item {
1616
return NSFetchRequest<Item>(entityName: "Item")
1717
}
1818

19-
@NSManaged public var expirationDate: String?
20-
@NSManaged public var image: Data?
2119
@NSManaged public var name: String?
20+
@NSManaged public var expirationDate: String?
21+
@NSManaged public var expirationDateTime: Date?
2222
@NSManaged public var notes: String?
23-
@NSManaged public var expirationMonth: Int32
24-
@NSManaged public var expirationDay: Int32
25-
@NSManaged public var expirationYear: Int32
23+
@NSManaged public var image: Data?
2624

2725
public var wrappedName: String {
2826
name ?? "Unknown name"
@@ -36,15 +34,8 @@ extension Item {
3634
notes ?? ""
3735
}
3836

39-
public var expirationToDate: Date {
40-
let dateNoCommas = expirationDate!.filter { $0 != "," }
41-
42-
var components = DateComponents()
43-
components.month = Int(expirationMonth)
44-
components.day = Int(expirationDay)
45-
components.year = Int(expirationYear)
46-
47-
return Calendar.current.date(from: components)!
37+
public var wrappedDateTime: Date {
38+
expirationDateTime ?? Date.now
4839
}
4940
}
5041

0 commit comments

Comments
 (0)