fixed demo app

This commit is contained in:
John Rommel Estropia
2015-06-04 00:40:19 +09:00
parent 6ed6159eec
commit e462ae5a19
7 changed files with 255 additions and 250 deletions

View File

@@ -22,7 +22,7 @@
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>../../..</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>../../../Libraries/GCDKit/</string>
<string>../../../Libraries/GCDKit</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:JohnEstropia/CoreStore.git</string>

View File

@@ -123,7 +123,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let hue = self.hueSlider?.value ?? 0
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
if let palette = transaction.edit(self?.objectController?.object) {
palette.hue = Int32(hue)
transaction.commit()
@@ -136,7 +136,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let saturation = self.saturationSlider?.value ?? 0
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
if let palette = transaction.edit(self?.objectController?.object) {
palette.saturation = saturation
transaction.commit()
@@ -149,7 +149,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let brightness = self.brightnessSlider?.value ?? 0
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
if let palette = transaction.edit(self?.objectController?.object) {
palette.brightness = brightness
transaction.commit()

View File

@@ -161,7 +161,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
CoreStore.beginAsynchronous { (transaction) -> Void in
let place = transaction.fetch(Static.placeController.object)
let place = transaction.edit(Static.placeController.object)
place?.coordinate = mapView.convertPoint(
gesture.locationInView(mapView),
toCoordinateFromView: mapView
@@ -175,7 +175,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
CoreStore.beginSynchronous { (transaction) -> Void in
let place = transaction.fetch(Static.placeController.object)
let place = transaction.edit(Static.placeController.object)
place?.setInitialValues()
transaction.commit()
}
@@ -195,7 +195,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
if let strongSelf = self, let placemark = (placemarks as? [CLPlacemark])?.first {
let place = transaction.fetch(Static.placeController.object)
let place = transaction.edit(Static.placeController.object)
place?.title = placemark.name
place?.subtitle = ABCreateStringWithAddressDictionary(placemark.addressDictionary, true)
transaction.commit { (_) -> Void in }