mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-22 01:19:42 +01:00
updated demo app
This commit is contained in:
@@ -1 +1 @@
|
|||||||
3.1
|
4.0
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ class FetchingAndQueryingDemoViewController: UIViewController, UITableViewDataSo
|
|||||||
fetch: { () -> [TimeZone] in
|
fetch: { () -> [TimeZone] in
|
||||||
|
|
||||||
return Static.timeZonesStack.fetchAll(
|
return Static.timeZonesStack.fetchAll(
|
||||||
From<TimeZone>(),
|
From<TimeZone>()
|
||||||
OrderBy(.ascending(#keyPath(TimeZone.name)))
|
.orderBy(.ascending(\.name))
|
||||||
)!
|
)!
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@@ -175,9 +175,13 @@ class FetchingAndQueryingDemoViewController: UIViewController, UITableViewDataSo
|
|||||||
fetch: { () -> [TimeZone] in
|
fetch: { () -> [TimeZone] in
|
||||||
|
|
||||||
return Static.timeZonesStack.fetchAll(
|
return Static.timeZonesStack.fetchAll(
|
||||||
From<TimeZone>(),
|
From<TimeZone>()
|
||||||
Where("%K BEGINSWITH[c] %@", #keyPath(TimeZone.name), "Asia"),
|
.where(
|
||||||
OrderBy(.ascending(#keyPath(TimeZone.secondsFromGMT)))
|
format: "%K BEGINSWITH[c] %@",
|
||||||
|
#keyPath(TimeZone.name),
|
||||||
|
"Asia"
|
||||||
|
)
|
||||||
|
.orderBy(.ascending(\.secondsFromGMT))
|
||||||
)!
|
)!
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@@ -186,10 +190,15 @@ class FetchingAndQueryingDemoViewController: UIViewController, UITableViewDataSo
|
|||||||
fetch: { () -> [TimeZone] in
|
fetch: { () -> [TimeZone] in
|
||||||
|
|
||||||
return Static.timeZonesStack.fetchAll(
|
return Static.timeZonesStack.fetchAll(
|
||||||
From<TimeZone>(),
|
From<TimeZone>()
|
||||||
Where("%K BEGINSWITH[c] %@", #keyPath(TimeZone.name), "America")
|
.where(
|
||||||
|| Where("%K BEGINSWITH[c] %@", #keyPath(TimeZone.name), "Europe"),
|
format: "%K BEGINSWITH[c] %@ OR %K BEGINSWITH[c] %@",
|
||||||
OrderBy(.ascending(#keyPath(TimeZone.secondsFromGMT)))
|
#keyPath(TimeZone.name),
|
||||||
|
"America",
|
||||||
|
#keyPath(TimeZone.name),
|
||||||
|
"Europe"
|
||||||
|
)
|
||||||
|
.orderBy(.ascending(\.secondsFromGMT))
|
||||||
)!
|
)!
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@@ -198,9 +207,13 @@ class FetchingAndQueryingDemoViewController: UIViewController, UITableViewDataSo
|
|||||||
fetch: { () -> [TimeZone] in
|
fetch: { () -> [TimeZone] in
|
||||||
|
|
||||||
return Static.timeZonesStack.fetchAll(
|
return Static.timeZonesStack.fetchAll(
|
||||||
From<TimeZone>(),
|
From<TimeZone>()
|
||||||
!Where("%K BEGINSWITH[c] %@", #keyPath(TimeZone.name), "America"),
|
.where(
|
||||||
OrderBy(.ascending(#keyPath(TimeZone.secondsFromGMT)))
|
format: "%K BEGINSWITH[c] %@",
|
||||||
|
#keyPath(TimeZone.name),
|
||||||
|
"America"
|
||||||
|
)
|
||||||
|
.orderBy(.ascending(\.secondsFromGMT))
|
||||||
)!
|
)!
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@@ -209,9 +222,9 @@ class FetchingAndQueryingDemoViewController: UIViewController, UITableViewDataSo
|
|||||||
fetch: { () -> [TimeZone] in
|
fetch: { () -> [TimeZone] in
|
||||||
|
|
||||||
return Static.timeZonesStack.fetchAll(
|
return Static.timeZonesStack.fetchAll(
|
||||||
From<TimeZone>(),
|
From<TimeZone>()
|
||||||
Where("hasDaylightSavingTime", isEqualTo: true),
|
.where(\.hasDaylightSavingTime == true)
|
||||||
OrderBy(.ascending(#keyPath(TimeZone.name)))
|
.orderBy(.ascending(\.name))
|
||||||
)!
|
)!
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ struct ColorsDemo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func whereClause() -> Where {
|
func whereClause() -> Where<Palette> {
|
||||||
|
|
||||||
switch self {
|
switch self {
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ class CustomLoggerViewController: UIViewController, CoreStoreLogger {
|
|||||||
|
|
||||||
case 0?:
|
case 0?:
|
||||||
let request = NSFetchRequest<NSFetchRequestResult>()
|
let request = NSFetchRequest<NSFetchRequestResult>()
|
||||||
Where(true).applyToFetchRequest(request)
|
Where<NSManagedObject>(true).applyToFetchRequest(request)
|
||||||
Where(false).applyToFetchRequest(request)
|
Where<NSManagedObject>(false).applyToFetchRequest(request)
|
||||||
|
|
||||||
case 1?:
|
case 1?:
|
||||||
_ = try? dataStack.addStorageAndWait(
|
_ = try? dataStack.addStorageAndWait(
|
||||||
|
|||||||
@@ -369,7 +369,10 @@ class MigrationsDemoViewController: UIViewController, ListObserver, UITableViewD
|
|||||||
)!
|
)!
|
||||||
|
|
||||||
self._dataStack = dataStack
|
self._dataStack = dataStack
|
||||||
let listMonitor = dataStack.monitorList(From(model.entityType), OrderBy(.descending("dna")))
|
let listMonitor = dataStack.monitorList(
|
||||||
|
From(model.entityType)
|
||||||
|
.orderBy(.descending(#keyPath(OrganismV1.dna)))
|
||||||
|
)
|
||||||
listMonitor.addObserver(self)
|
listMonitor.addObserver(self)
|
||||||
self._listMonitor = listMonitor
|
self._listMonitor = listMonitor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user