updated demo

This commit is contained in:
John Rommel Estropia
2015-05-09 14:10:55 +09:00
parent b16c9deeb9
commit a1610534cb
14 changed files with 286 additions and 282 deletions

View File

@@ -24,9 +24,12 @@
//
import Foundation
import CoreData
import GCDKit
// MARK: - AsynchronousDataTransaction
/**
The AsynchronousDataTransaction provides an interface for NSManagedObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginAsynchronous(_:), or from HardcoreData.beginAsynchronous(_:).
*/

View File

@@ -53,7 +53,6 @@ public extension DataStack {
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to observe objects from \(typeName(self)) outside the main queue.")
// TODO: sectionNameKeyPath and cacheResults
return ManagedObjectListController(
dataStack: self,
entity: T.self,

View File

@@ -27,6 +27,8 @@ import Foundation
import GCDKit
// MARK: - DetachedDataTransaction
/**
The DetachedDataTransaction provides an interface for non-contiguous NSManagedObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. A detached transaction object should typically be only used from the main queue.
*/

View File

@@ -2,11 +2,29 @@
// HardcoreData+Observing.swift
// HardcoreData
//
// Created by John Rommel Estropia on 2015/05/06.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
// Copyright (c) 2015 John Rommel Estropia
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
import Foundation
import CoreData
// MARK: - HardcoreData

View File

@@ -94,8 +94,10 @@ internal extension NSManagedObjectContext {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
"Failed to obtain permanent ID(s) for \(numberOfInsertedObjects) inserted object(s).")
})
"Failed to obtain permanent ID(s) for \(numberOfInsertedObjects) inserted object(s)."
)
}
)
}

View File

@@ -2,13 +2,37 @@
// SynchronousDataTransaction.swift
// HardcoreData
//
// Created by John Rommel Estropia on 2015/02/28.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
// Copyright (c) 2015 John Rommel Estropia
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
import Foundation
import CoreData
import GCDKit
// MARK: - SynchronousDataTransaction
/**
The SynchronousDataTransaction provides an interface for NSManagedObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:), or from HardcoreData.beginSynchronous(_:).
*/
public final class SynchronousDataTransaction: BaseDataTransaction {
// MARK: Public

View File

@@ -7,18 +7,18 @@
objects = {
/* Begin PBXBuildFile section */
B503FADF1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B503FADB1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift */; };
B503FAE01AFDC71700F90881 /* ObjectObserverDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B503FADC1AFDC71700F90881 /* ObjectObserverDemoViewController.swift */; };
B503FAE11AFDC71700F90881 /* Palette.swift in Sources */ = {isa = PBXBuildFile; fileRef = B503FADD1AFDC71700F90881 /* Palette.swift */; };
B503FAE21AFDC71700F90881 /* PaletteTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B503FADE1AFDC71700F90881 /* PaletteTableViewCell.swift */; };
B54AAD4F1AF4D26E00848AE0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */; };
B54AAD521AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD501AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld */; };
B54AAD541AF4D26E00848AE0 /* ObjectListObserverDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD531AF4D26E00848AE0 /* ObjectListObserverDemoViewController.swift */; };
B54AAD591AF4D26E00848AE0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD571AF4D26E00848AE0 /* Main.storyboard */; };
B54AAD5B1AF4D26E00848AE0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */; };
B54AAD5E1AF4D26E00848AE0 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD5C1AF4D26E00848AE0 /* LaunchScreen.xib */; };
B54AAD6A1AF4D26E00848AE0 /* HardcoreDataDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD691AF4D26E00848AE0 /* HardcoreDataDemoTests.swift */; };
B583A9201AF5F542001F76AF /* HardcoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */; };
B583A9211AF5F542001F76AF /* HardcoreData.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B5BC26E41AF8F67900276889 /* PaletteTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC26E31AF8F67900276889 /* PaletteTableViewCell.swift */; };
B5BC26E81AF8FD9600276889 /* Palette.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC26E71AF8FD9600276889 /* Palette.swift */; };
B5BC271B1AFA4E6900276889 /* ObjectObserverDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC271A1AFA4E6900276889 /* ObjectObserverDemoViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -74,11 +74,14 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
B503FADB1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectListObserverDemoViewController.swift; sourceTree = "<group>"; };
B503FADC1AFDC71700F90881 /* ObjectObserverDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectObserverDemoViewController.swift; sourceTree = "<group>"; };
B503FADD1AFDC71700F90881 /* Palette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Palette.swift; sourceTree = "<group>"; };
B503FADE1AFDC71700F90881 /* PaletteTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaletteTableViewCell.swift; sourceTree = "<group>"; };
B54AAD491AF4D26E00848AE0 /* HardcoreDataDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HardcoreDataDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
B54AAD4D1AF4D26E00848AE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B54AAD511AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = HardcoreDataDemo.xcdatamodel; sourceTree = "<group>"; };
B54AAD531AF4D26E00848AE0 /* ObjectListObserverDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjectListObserverDemoViewController.swift; sourceTree = "<group>"; };
B54AAD581AF4D26E00848AE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
B54AAD5D1AF4D26E00848AE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
@@ -87,9 +90,6 @@
B54AAD691AF4D26E00848AE0 /* HardcoreDataDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HardcoreDataDemoTests.swift; sourceTree = "<group>"; };
B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = HardcoreData.xcodeproj; path = ../HardcoreData.xcodeproj; sourceTree = "<group>"; };
B583A9251AF5F547001F76AF /* GCDKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = GCDKit.framework; path = "/Users/johnestropia/Library/Developer/Xcode/DerivedData/HardcoreDataDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos/GCDKit.framework"; sourceTree = "<absolute>"; };
B5BC26E31AF8F67900276889 /* PaletteTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaletteTableViewCell.swift; sourceTree = "<group>"; };
B5BC26E71AF8FD9600276889 /* Palette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Palette.swift; sourceTree = "<group>"; };
B5BC271A1AFA4E6900276889 /* ObjectObserverDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectObserverDemoViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -111,6 +111,17 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
B503FADA1AFDC71700F90881 /* List and Object Observers Demo */ = {
isa = PBXGroup;
children = (
B503FADB1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift */,
B503FADC1AFDC71700F90881 /* ObjectObserverDemoViewController.swift */,
B503FADD1AFDC71700F90881 /* Palette.swift */,
B503FADE1AFDC71700F90881 /* PaletteTableViewCell.swift */,
);
path = "List and Object Observers Demo";
sourceTree = "<group>";
};
B54AAD401AF4D26E00848AE0 = {
isa = PBXGroup;
children = (
@@ -135,9 +146,7 @@
isa = PBXGroup;
children = (
B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */,
B5BC26E51AF8F67D00276889 /* Cells */,
B5BC27191AFA4E0500276889 /* Demo */,
B5BC26E61AF8F68200276889 /* Entities */,
B503FADA1AFDC71700F90881 /* List and Object Observers Demo */,
B54AAD571AF4D26E00848AE0 /* Main.storyboard */,
B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */,
B54AAD5C1AF4D26E00848AE0 /* LaunchScreen.xib */,
@@ -181,31 +190,6 @@
name = Products;
sourceTree = "<group>";
};
B5BC26E51AF8F67D00276889 /* Cells */ = {
isa = PBXGroup;
children = (
B5BC26E31AF8F67900276889 /* PaletteTableViewCell.swift */,
);
name = Cells;
sourceTree = "<group>";
};
B5BC26E61AF8F68200276889 /* Entities */ = {
isa = PBXGroup;
children = (
B5BC26E71AF8FD9600276889 /* Palette.swift */,
);
name = Entities;
sourceTree = "<group>";
};
B5BC27191AFA4E0500276889 /* Demo */ = {
isa = PBXGroup;
children = (
B54AAD531AF4D26E00848AE0 /* ObjectListObserverDemoViewController.swift */,
B5BC271A1AFA4E6900276889 /* ObjectObserverDemoViewController.swift */,
);
name = Demo;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -332,12 +316,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B503FAE01AFDC71700F90881 /* ObjectObserverDemoViewController.swift in Sources */,
B54AAD521AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld in Sources */,
B503FAE11AFDC71700F90881 /* Palette.swift in Sources */,
B503FAE21AFDC71700F90881 /* PaletteTableViewCell.swift in Sources */,
B503FADF1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift in Sources */,
B54AAD4F1AF4D26E00848AE0 /* AppDelegate.swift in Sources */,
B5BC271B1AFA4E6900276889 /* ObjectObserverDemoViewController.swift in Sources */,
B5BC26E41AF8F67900276889 /* PaletteTableViewCell.swift in Sources */,
B5BC26E81AF8FD9600276889 /* Palette.swift in Sources */,
B54AAD541AF4D26E00848AE0 /* ObjectListObserverDemoViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -7,7 +7,7 @@
<key>IDESourceControlProjectIdentifier</key>
<string>7C5E31AC-5DD0-43DA-A5C6-AF73B4532D86</string>
<key>IDESourceControlProjectName</key>
<string>project</string>
<string>HardcoreDataDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
@@ -16,13 +16,13 @@
<string>github.com:JohnEstropia/GCDKit.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>HardcoreDataDemo/HardcoreDataDemo.xcodeproj/project.xcworkspace</string>
<string>HardcoreDataDemo/HardcoreDataDemo.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>../../..</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>../../../Libraries/GCDKit</string>
<string>../../..Libraries/GCDKit/</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:JohnEstropia/HardcoreData.git</string>

View File

@@ -10,17 +10,6 @@ import UIKit
import HardcoreData
let paletteList: ManagedObjectListController<Palette> = {
HardcoreData.defaultStack.addSQLiteStore()
return HardcoreData.observeObjectList(
From(Palette),
GroupBy("colorName"),
SortedBy(.Ascending("hue"), .Ascending("dateAdded"))
)
}()
// MARK: - AppDelegate
@UIApplicationMain
@@ -32,6 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
HardcoreData.defaultStack.addSQLiteStore()
return true
}
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="szK-z4-VnV">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Ni8-QF-XHB">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
@@ -15,20 +15,20 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection headerTitle="Observing Changes" id="wIP-Hn-YfF">
<tableViewSection headerTitle="Demos" id="wIP-Hn-YfF">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="vpt-cT-gMo" detailTextLabel="ou9-TZ-8bf" style="IBUITableViewCellStyleSubtitle" id="fsb-zw-8Ii">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="vpt-cT-gMo" detailTextLabel="ou9-TZ-8bf" style="IBUITableViewCellStyleSubtitle" id="fsb-zw-8Ii">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fsb-zw-8Ii" id="Upm-AO-Fw3">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Observing Object Lists" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vpt-cT-gMo">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Colors" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vpt-cT-gMo">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="ManagedObjectListController and ManagedObjectListObserver" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ou9-TZ-8bf">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Observing list changes and single object changes" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ou9-TZ-8bf">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -40,7 +40,7 @@
<segue destination="YOI-b7-Nxn" kind="show" id="29o-wO-3LK"/>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="quG-kg-ady" detailTextLabel="hPD-ed-MbJ" style="IBUITableViewCellStyleSubtitle" id="OnF-07-qx3">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="quG-kg-ady" detailTextLabel="hPD-ed-MbJ" style="IBUITableViewCellStyleSubtitle" id="OnF-07-qx3">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OnF-07-qx3" id="3rZ-A6-AuF">
<autoresizingMask key="autoresizingMask"/>
@@ -59,9 +59,6 @@
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="dX3-kR-CYC" kind="show" id="OVk-P4-N24"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
@@ -77,72 +74,72 @@
</objects>
<point key="canvasLocation" x="2982" y="1325"/>
</scene>
<!--Object Observer Demo-->
<!--Object Observer-->
<scene sceneID="Y7v-tc-8cX">
<objects>
<viewController id="dX3-kR-CYC" customClass="ObjectObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<viewController automaticallyAdjustsScrollViewInsets="NO" id="dX3-kR-CYC" customClass="ObjectObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="J6W-Ki-cRQ"/>
<viewControllerLayoutGuide type="bottom" id="aI4-O3-OCi"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="w8K-eN-RvU">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NhC-oM-bkd">
<rect key="frame" x="16" y="101" width="568" height="184"/>
<view contentMode="scaleToFill" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="NhC-oM-bkd">
<rect key="frame" x="16" y="70" width="568" height="36"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" id="TIX-qi-B34"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Vfe-Yq-3Xa">
<rect key="frame" x="16" y="305" width="568" height="22"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QUO-BC-xwq">
<rect key="frame" x="16" y="347" width="568" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="250" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Vfe-Yq-3Xa">
<rect key="frame" x="16" y="116" width="568" height="18"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" id="4h9-ha-EzR"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hue" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sgg-Md-Nf3">
<rect key="frame" x="16" y="398" width="82" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="16" y="154" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Saturation" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rry-vh-bRK">
<rect key="frame" x="16" y="449" width="82" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="16" y="192" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Brightness" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vTa-ly-eyO">
<rect key="frame" x="16" y="500" width="82" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="16" y="230" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="359" translatesAutoresizingMaskIntoConstraints="NO" id="YQ6-fq-3Wb">
<rect key="frame" x="106" y="394" width="480" height="31"/>
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="359" translatesAutoresizingMaskIntoConstraints="NO" id="YQ6-fq-3Wb">
<rect key="frame" x="98" y="149" width="488" height="31"/>
<connections>
<action selector="hueSliderValueDidChange:" destination="dX3-kR-CYC" eventType="valueChanged" id="9Hy-3h-llE"/>
</connections>
</slider>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="xXz-78-tAd">
<rect key="frame" x="106" y="445" width="480" height="31"/>
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="xXz-78-tAd">
<rect key="frame" x="98" y="187" width="488" height="31"/>
<connections>
<action selector="saturationSliderValueDidChange:" destination="dX3-kR-CYC" eventType="valueChanged" id="qtU-ua-ZTc"/>
</connections>
</slider>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="hpy-2d-eOP">
<rect key="frame" x="106" y="496" width="480" height="31"/>
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="hpy-2d-eOP">
<rect key="frame" x="98" y="225" width="488" height="31"/>
<connections>
<action selector="brightnessSliderValueDidChange:" destination="dX3-kR-CYC" eventType="valueChanged" id="F09-EP-2iD"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p4O-tf-dgt">
<rect key="frame" x="16" y="72" width="568" height="21"/>
<rect key="frame" x="16" y="49" width="568" height="21"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@@ -151,44 +148,37 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="p4O-tf-dgt" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="022-ll-1s1"/>
<constraint firstItem="vTa-ly-eyO" firstAttribute="top" secondItem="rry-vh-bRK" secondAttribute="bottom" constant="30" id="1hd-Ti-CnT"/>
<constraint firstItem="vTa-ly-eyO" firstAttribute="top" secondItem="rry-vh-bRK" secondAttribute="bottom" constant="20" id="1hd-Ti-CnT"/>
<constraint firstItem="Vfe-Yq-3Xa" firstAttribute="leading" secondItem="NhC-oM-bkd" secondAttribute="leading" id="3rk-Q6-4Ie"/>
<constraint firstItem="vTa-ly-eyO" firstAttribute="centerY" secondItem="hpy-2d-eOP" secondAttribute="centerY" id="5Co-ZW-1dc"/>
<constraint firstItem="rry-vh-bRK" firstAttribute="top" secondItem="sgg-Md-Nf3" secondAttribute="bottom" constant="30" id="6H6-0Y-N5Q"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="top" secondItem="p4O-tf-dgt" secondAttribute="bottom" constant="8" id="CQS-Rq-7xk"/>
<constraint firstItem="rry-vh-bRK" firstAttribute="top" secondItem="sgg-Md-Nf3" secondAttribute="bottom" constant="20" id="6H6-0Y-N5Q"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="top" secondItem="p4O-tf-dgt" secondAttribute="bottom" id="CQS-Rq-7xk"/>
<constraint firstItem="Vfe-Yq-3Xa" firstAttribute="top" relation="greaterThanOrEqual" secondItem="NhC-oM-bkd" secondAttribute="bottom" id="DnV-QO-i6H"/>
<constraint firstItem="xXz-78-tAd" firstAttribute="leading" secondItem="rry-vh-bRK" secondAttribute="trailing" constant="10" id="FPg-7d-dMf"/>
<constraint firstItem="QUO-BC-xwq" firstAttribute="top" secondItem="Vfe-Yq-3Xa" secondAttribute="bottom" constant="20" id="GIR-51-M1N"/>
<constraint firstItem="sgg-Md-Nf3" firstAttribute="width" secondItem="rry-vh-bRK" secondAttribute="width" id="GuJ-R3-bkO"/>
<constraint firstItem="Vfe-Yq-3Xa" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="LRJ-jz-iLc"/>
<constraint firstItem="sgg-Md-Nf3" firstAttribute="leading" secondItem="rry-vh-bRK" secondAttribute="leading" id="Q80-Q8-P50"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="top" secondItem="J6W-Ki-cRQ" secondAttribute="bottom" constant="10" id="RTD-70-ONq"/>
<constraint firstItem="sgg-Md-Nf3" firstAttribute="top" secondItem="Vfe-Yq-3Xa" secondAttribute="bottom" priority="750" constant="20" id="Qlv-73-Ufn"/>
<constraint firstItem="xXz-78-tAd" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="SBR-p4-7GG"/>
<constraint firstItem="p4O-tf-dgt" firstAttribute="leading" secondItem="w8K-eN-RvU" secondAttribute="leadingMargin" id="TaP-gA-0bN"/>
<constraint firstItem="QUO-BC-xwq" firstAttribute="leading" secondItem="Vfe-Yq-3Xa" secondAttribute="leading" id="UHl-td-kLB"/>
<constraint firstItem="hpy-2d-eOP" firstAttribute="leading" secondItem="vTa-ly-eyO" secondAttribute="trailing" constant="10" id="VNh-Vh-dqM"/>
<constraint firstItem="xXz-78-tAd" firstAttribute="centerY" secondItem="rry-vh-bRK" secondAttribute="centerY" id="WRO-Vk-ye1"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="ZiZ-4C-chU"/>
<constraint firstItem="Vfe-Yq-3Xa" firstAttribute="top" secondItem="NhC-oM-bkd" secondAttribute="bottom" constant="20" id="bXc-vc-59m"/>
<constraint firstItem="Vfe-Yq-3Xa" firstAttribute="top" secondItem="NhC-oM-bkd" secondAttribute="bottom" priority="750" constant="10" id="bXc-vc-59m"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="leading" secondItem="sgg-Md-Nf3" secondAttribute="leading" id="cQF-su-64Q"/>
<constraint firstItem="YQ6-fq-3Wb" firstAttribute="leading" secondItem="sgg-Md-Nf3" secondAttribute="trailing" constant="10" id="dGq-Wa-rjW"/>
<constraint firstItem="sgg-Md-Nf3" firstAttribute="top" secondItem="QUO-BC-xwq" secondAttribute="bottom" constant="30" id="eDl-uM-yLg"/>
<constraint firstItem="rry-vh-bRK" firstAttribute="width" secondItem="vTa-ly-eyO" secondAttribute="width" id="iPH-pR-QYo"/>
<constraint firstItem="YQ6-fq-3Wb" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="qDj-es-UUM"/>
<constraint firstItem="aI4-O3-OCi" firstAttribute="top" secondItem="vTa-ly-eyO" secondAttribute="bottom" constant="30" id="qY2-8I-BM4"/>
<constraint firstItem="aI4-O3-OCi" firstAttribute="top" secondItem="vTa-ly-eyO" secondAttribute="bottom" constant="20" id="qY2-8I-BM4"/>
<constraint firstItem="YQ6-fq-3Wb" firstAttribute="centerY" secondItem="sgg-Md-Nf3" secondAttribute="centerY" id="rcc-Gx-Ecs"/>
<constraint firstItem="sgg-Md-Nf3" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Vfe-Yq-3Xa" secondAttribute="bottom" id="sLe-Hu-Zgb"/>
<constraint firstItem="NhC-oM-bkd" firstAttribute="leading" secondItem="w8K-eN-RvU" secondAttribute="leadingMargin" id="tce-5z-WaM"/>
<constraint firstItem="QUO-BC-xwq" firstAttribute="trailing" secondItem="Vfe-Yq-3Xa" secondAttribute="trailing" id="vFK-4s-8b6"/>
<constraint firstItem="rry-vh-bRK" firstAttribute="leading" secondItem="vTa-ly-eyO" secondAttribute="leading" id="wca-tt-sfc"/>
<constraint firstItem="p4O-tf-dgt" firstAttribute="top" secondItem="J6W-Ki-cRQ" secondAttribute="bottom" constant="8" id="yJO-fO-0yi"/>
<constraint firstItem="p4O-tf-dgt" firstAttribute="top" secondItem="J6W-Ki-cRQ" secondAttribute="bottom" constant="5" id="yJO-fO-0yi"/>
<constraint firstItem="hpy-2d-eOP" firstAttribute="trailing" secondItem="w8K-eN-RvU" secondAttribute="trailingMargin" id="zgJ-h5-hYt"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="RTD-70-ONq"/>
</mask>
</variation>
</view>
<navigationItem key="navigationItem" title="Object Observer Demo" id="5Tu-3i-YwC">
<navigationItem key="navigationItem" title="Object Observer" id="5Tu-3i-YwC">
<barButtonItem key="rightBarButtonItem" systemItem="trash" id="gyh-ob-cjb">
<connections>
<action selector="deleteBarButtonTapped:" destination="dX3-kR-CYC" id="Q7t-Oy-AK2"/>
@@ -199,7 +189,6 @@
<outlet property="brightnessSlider" destination="hpy-2d-eOP" id="FoT-Do-G34"/>
<outlet property="colorNameLabel" destination="p4O-tf-dgt" id="H99-zx-Qiw"/>
<outlet property="colorView" destination="NhC-oM-bkd" id="faB-ez-kxQ"/>
<outlet property="dateLabel" destination="QUO-BC-xwq" id="AN0-yh-I8j"/>
<outlet property="hsbLabel" destination="Vfe-Yq-3Xa" id="ETG-DW-Aie"/>
<outlet property="hueSlider" destination="YQ6-fq-3Wb" id="6tR-oU-VF4"/>
<outlet property="saturationSlider" destination="xXz-78-tAd" id="hVN-Py-7Nr"/>
@@ -207,28 +196,28 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="49t-Sy-Rq7" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3694" y="2078"/>
<point key="canvasLocation" x="5864" y="1324.5"/>
</scene>
<!--Multiple List Observers Demo-->
<!--Colors-->
<scene sceneID="3lD-lX-hIc">
<objects>
<viewController hidesBottomBarWhenPushed="YES" id="YOI-b7-Nxn" sceneMemberID="viewController">
<viewController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="YOI-b7-Nxn" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="IML-3o-caw"/>
<viewControllerLayoutGuide type="bottom" id="LNL-mj-D7l"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6x3-vn-Egt">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="64" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L5f-tW-lXf">
<rect key="frame" x="0.0" y="0.0" width="600" height="325"/>
<rect key="frame" x="0.0" y="64" width="600" height="268"/>
<connections>
<segue destination="3AE-ED-0oj" kind="embed" id="YcI-2Z-ijV"/>
<segue destination="5Fw-je-9gI" kind="embed" id="YcI-2Z-ijV"/>
</connections>
</containerView>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6So-f3-4Gp">
<rect key="frame" x="0.0" y="325" width="600" height="324"/>
<rect key="frame" x="0.0" y="332" width="600" height="268"/>
<connections>
<segue destination="sll-yo-mBc" kind="embed" id="AAl-HS-dq2"/>
</connections>
@@ -238,95 +227,22 @@
<constraints>
<constraint firstItem="6So-f3-4Gp" firstAttribute="top" secondItem="L5f-tW-lXf" secondAttribute="bottom" id="3m8-tj-Nd4"/>
<constraint firstAttribute="trailingMargin" secondItem="6So-f3-4Gp" secondAttribute="trailing" constant="-16" id="4L8-wZ-F59"/>
<constraint firstItem="LNL-mj-D7l" firstAttribute="top" secondItem="6So-f3-4Gp" secondAttribute="bottom" constant="-49" id="8wL-zm-wnt"/>
<constraint firstItem="L5f-tW-lXf" firstAttribute="height" secondItem="6So-f3-4Gp" secondAttribute="height" id="8XS-L3-hvN"/>
<constraint firstItem="LNL-mj-D7l" firstAttribute="top" secondItem="6So-f3-4Gp" secondAttribute="bottom" id="8wL-zm-wnt"/>
<constraint firstItem="L5f-tW-lXf" firstAttribute="leading" secondItem="6x3-vn-Egt" secondAttribute="leadingMargin" constant="-16" id="CbE-2f-7wk"/>
<constraint firstAttribute="trailingMargin" secondItem="L5f-tW-lXf" secondAttribute="trailing" constant="-16" id="dso-2g-fgA"/>
<constraint firstItem="6So-f3-4Gp" firstAttribute="leading" secondItem="6x3-vn-Egt" secondAttribute="leadingMargin" constant="-16" id="eXM-D3-NLv"/>
<constraint firstItem="L5f-tW-lXf" firstAttribute="height" secondItem="6So-f3-4Gp" secondAttribute="height" id="xc9-x7-u66"/>
<constraint firstItem="L5f-tW-lXf" firstAttribute="top" secondItem="IML-3o-caw" secondAttribute="bottom" constant="-64" id="zJ5-sE-iJA"/>
<constraint firstItem="L5f-tW-lXf" firstAttribute="top" secondItem="IML-3o-caw" secondAttribute="bottom" id="zJ5-sE-iJA"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<navigationItem key="navigationItem" title="Multiple List Observers Demo" id="7Gd-Ad-Bzu"/>
<navigationItem key="navigationItem" title="Colors" id="7Gd-Ad-Bzu"/>
<nil key="simulatedBottomBarMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="C9h-Ba-WoL" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3694" y="1325"/>
</scene>
<!--Data Source-->
<scene sceneID="bjb-2c-ZyA">
<objects>
<tableViewController id="n8m-TO-mNX" customClass="ObjectListObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="Rtx-h6-8jn">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="H3Q-dW-6zD" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="H3Q-dW-6zD" id="66x-XH-nr3">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qce-fh-1hq">
<rect key="frame" x="8" y="8" width="43" height="43"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="Qce-fh-1hq" secondAttribute="height" multiplier="1:1" id="vc2-65-W9v"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iyX-f6-aWG">
<rect key="frame" x="61" y="8" width="46" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="iyX-f6-aWG" firstAttribute="leading" secondItem="Qce-fh-1hq" secondAttribute="trailing" constant="10" id="KfE-Ey-VHT"/>
<constraint firstAttribute="bottomMargin" secondItem="Qce-fh-1hq" secondAttribute="bottom" id="T2z-OS-Ewz"/>
<constraint firstItem="iyX-f6-aWG" firstAttribute="height" secondItem="Qce-fh-1hq" secondAttribute="height" id="Wzu-s3-3WB"/>
<constraint firstAttribute="centerY" secondItem="iyX-f6-aWG" secondAttribute="centerY" id="XrI-RK-gmT"/>
<constraint firstItem="Qce-fh-1hq" firstAttribute="top" secondItem="66x-XH-nr3" secondAttribute="topMargin" id="cqj-bh-MAd"/>
<constraint firstItem="Qce-fh-1hq" firstAttribute="leading" secondItem="66x-XH-nr3" secondAttribute="leadingMargin" id="xga-8N-Tg8"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="colorView" destination="Qce-fh-1hq" id="p2C-6x-E23"/>
<outlet property="label" destination="iyX-f6-aWG" id="QQj-z6-zlJ"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="n8m-TO-mNX" id="mJd-Ez-IgP"/>
<outlet property="delegate" destination="n8m-TO-mNX" id="kCy-Z4-W6S"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Data Source" id="Rlh-3D-rPD"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Wss-ed-4dj" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2982" y="608"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="G36-km-fMb">
<objects>
<tabBarController automaticallyAdjustsScrollViewInsets="NO" id="szK-z4-VnV" sceneMemberID="viewController">
<toolbarItems/>
<nil key="simulatedBottomBarMetrics"/>
<tabBar key="tabBar" contentMode="scaleToFill" id="PnD-bJ-rHY">
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tabBar>
<connections>
<segue destination="EQn-RG-F8w" kind="relationship" relationship="viewControllers" id="LVq-O5-Dy8"/>
<segue destination="Ni8-QF-XHB" kind="relationship" relationship="viewControllers" id="W8q-TH-uRN"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xkC-5P-6Tl" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1408" y="902"/>
</scene>
<!--Demo-->
<scene sceneID="Ffr-kh-wmT">
<objects>
@@ -346,49 +262,30 @@
</objects>
<point key="canvasLocation" x="2170" y="1325"/>
</scene>
<!--Data Source-->
<scene sceneID="gWT-4Y-Q7f">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="EQn-RG-F8w" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Data Source" image="first" id="RhG-RY-VGb"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="rAn-Lz-7zg">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="n8m-TO-mNX" kind="relationship" relationship="rootViewController" id="XnX-7f-B7r"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ST8-TK-asq" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2170" y="608"/>
</scene>
<!--Object List Observer Demo View Controller-->
<!--List Observer-->
<scene sceneID="gkX-bd-Rel">
<objects>
<tableViewController id="3AE-ED-0oj" customClass="ObjectListObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="DAz-BE-6Ca">
<rect key="frame" x="0.0" y="0.0" width="600" height="325"/>
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="DAz-BE-6Ca">
<rect key="frame" x="0.0" y="0.0" width="600" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="G3X-70-BCD" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="G3X-70-BCD" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="G3X-70-BCD" id="aT8-nz-i5l">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uQX-PI-UWF">
<rect key="frame" x="8" y="8" width="43" height="43"/>
<rect key="frame" x="8" y="8" width="27" height="27"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="uQX-PI-UWF" secondAttribute="height" multiplier="1:1" id="9qA-iN-Neb"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HJC-5w-lIN">
<rect key="frame" x="61" y="8" width="46" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<rect key="frame" x="45" y="8" width="37" height="27"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
@@ -414,35 +311,39 @@
</connections>
</tableView>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<navigationItem key="navigationItem" title="List Observer" id="JjF-x3-ixG"/>
<connections>
<segue destination="dX3-kR-CYC" kind="show" identifier="ObjectObserverDemoViewController" id="hyN-De-zte"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="P5L-49-pOr" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4404" y="1145"/>
<point key="canvasLocation" x="5085" y="1144.5"/>
</scene>
<!--Edit List-->
<!--List Observer-->
<scene sceneID="iDB-TD-It9">
<objects>
<tableViewController id="lCE-i6-UCT" customClass="ObjectListObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="Zba-8M-Zd7">
<rect key="frame" x="0.0" y="0.0" width="600" height="324"/>
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Zba-8M-Zd7">
<rect key="frame" x="0.0" y="0.0" width="600" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="zSO-3e-OVq" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="zSO-3e-OVq" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zSO-3e-OVq" id="cHA-by-n4b">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5uq-Yi-XwH">
<rect key="frame" x="8" y="8" width="43" height="43"/>
<rect key="frame" x="8" y="8" width="27" height="27"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="5uq-Yi-XwH" secondAttribute="height" multiplier="1:1" id="oOe-HC-VyN"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zyu-PC-WmO">
<rect key="frame" x="61" y="8" width="46" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<rect key="frame" x="45" y="8" width="37" height="27"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
@@ -467,7 +368,11 @@
<outlet property="delegate" destination="lCE-i6-UCT" id="Ken-sI-O2f"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Edit List" id="koc-aK-cgD"/>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<navigationItem key="navigationItem" title="List Observer" id="koc-aK-cgD"/>
<connections>
<segue destination="dX3-kR-CYC" kind="show" identifier="ObjectObserverDemoViewController" id="fIB-GS-Ppk"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="QAS-su-ZdM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
@@ -476,7 +381,7 @@
<!--Navigation Controller-->
<scene sceneID="DTD-lH-nr5">
<objects>
<navigationController id="sll-yo-mBc" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="sll-yo-mBc" sceneMemberID="viewController">
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="6XA-6M-yvZ">
@@ -492,9 +397,30 @@
</objects>
<point key="canvasLocation" x="4404" y="1546"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="3ih-RN-P43">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="5Fw-je-9gI" sceneMemberID="viewController">
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="wJo-mp-1pS">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="3AE-ED-0oj" kind="relationship" relationship="rootViewController" id="GLh-MA-ZsP"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="0DC-2l-nbt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4404" y="1144.5"/>
</scene>
</scenes>
<resources>
<image name="first" width="30" height="30"/>
<image name="second" width="30" height="30"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="fIB-GS-Ppk"/>
</inferredMetricsTieBreakers>
</document>

View File

@@ -10,6 +10,16 @@ import UIKit
import HardcoreData
struct Shared {
static let palettes = HardcoreData.observeObjectList(
From(Palette),
GroupBy("colorName"),
SortedBy(.Ascending("hue"), .Ascending("dateAdded"))
)
}
// MARK: - ObjectListObserverDemoViewController
class ObjectListObserverDemoViewController: UITableViewController, ManagedObjectListSectionObserver {
@@ -18,7 +28,7 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
deinit {
paletteList.removeObserver(self)
Shared.palettes.removeObserver(self)
}
@@ -41,21 +51,22 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
target: self,
action: "addBarButtonItemTouched:"
)
Shared.palettes.addObserver(self)
}
override func viewWillAppear(animated: Bool) {
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
super.viewWillAppear(animated)
super.prepareForSegue(segue, sender: sender)
paletteList.addObserver(self)
self.tableView.reloadData()
}
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
paletteList.removeObserver(self)
switch (segue.identifier, segue.destinationViewController, sender) {
case (.Some("ObjectObserverDemoViewController"), let destinationViewController as ObjectObserverDemoViewController, let palette as Palette):
destinationViewController.palette = palette
default:
break
}
}
@@ -63,19 +74,19 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return paletteList.numberOfSections()
return Shared.palettes.numberOfSections()
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return paletteList.numberOfObjectsInSection(section)
return Shared.palettes.numberOfObjectsInSection(section)
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("PaletteTableViewCell") as! PaletteTableViewCell
let palette = paletteList[indexPath]
let palette = Shared.palettes[indexPath]
cell.colorView?.backgroundColor = palette.color
cell.label?.text = palette.colorText
@@ -85,12 +96,22 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
// MARK: UITableViewDelegate
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
self.performSegueWithIdentifier(
"ObjectObserverDemoViewController",
sender: Shared.palettes[indexPath]
)
}
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
switch editingStyle {
case .Delete:
let palette = paletteList[indexPath]
let palette = Shared.palettes[indexPath]
HardcoreData.beginAsynchronous{ (transaction) -> Void in
transaction.delete(palette)
@@ -104,7 +125,7 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return paletteList.sectionInfoAtIndex(section).name
return Shared.palettes.sectionInfoAtIndex(section).name
}
@@ -135,12 +156,18 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
func managedObjectList(listController: ManagedObjectListController<Palette>, didUpdateObject object: Palette, atIndexPath indexPath: NSIndexPath) {
self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
if let cell = self.tableView.cellForRowAtIndexPath(indexPath) as? PaletteTableViewCell {
let palette = Shared.palettes[indexPath]
cell.colorView?.backgroundColor = palette.color
cell.label?.text = palette.colorText
}
}
func managedObjectList(listController: ManagedObjectListController<Palette>, didMoveObject object: Palette, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
self.tableView.moveRowAtIndexPath(fromIndexPath, toIndexPath: toIndexPath)
self.tableView.deleteRowsAtIndexPaths([fromIndexPath], withRowAnimation: .Automatic)
self.tableView.insertRowsAtIndexPaths([toIndexPath], withRowAnimation: .Automatic)
}
@@ -172,11 +199,8 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
HardcoreData.beginAsynchronous { (transaction) -> Void in
for _ in 0 ... 2 {
let palette = transaction.create(Palette)
palette.setInitialValues()
}
let palette = transaction.create(Palette)
palette.setInitialValues()
transaction.commit { (result) -> Void in }
}

View File

@@ -14,11 +14,30 @@ import HardcoreData
class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver {
var palette: Palette? {
get {
return self.objectController?.object
}
set {
if let palette = newValue {
self.objectController = HardcoreData.observeObject(palette)
}
else {
self.objectController = nil
}
}
}
// MARK: NSObject
deinit {
self.objectController.removeObserver(self)
self.objectController?.removeObserver(self)
}
@@ -50,14 +69,11 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
override func viewDidLoad() {
super.viewDidLoad()
self.objectController.addObserver(self)
self.objectController?.addObserver(self)
if let palette = self.objectController.object {
if let palette = self.objectController?.object {
self.reloadPaletteInfo(palette)
self.hueSlider?.value = Float(palette.hue)
self.saturationSlider?.value = palette.saturation
self.brightnessSlider?.value = palette.brightness
}
}
@@ -66,6 +82,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
func managedObjectWillUpdate(objectController: ManagedObjectController<Palette>, object: Palette) {
// none
}
func managedObjectWasUpdated(objectController: ManagedObjectController<Palette>, object: Palette) {
@@ -75,10 +92,13 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
func managedObjectWasDeleted(objectController: ManagedObjectController<Palette>, object: Palette) {
self.navigationItem.rightBarButtonItem?.enabled = false
self.colorNameLabel?.alpha = 0.3
self.colorView?.alpha = 0.3
self.dateLabel?.text = "Deleted"
self.dateLabel?.textColor = UIColor.redColor()
self.hsbLabel?.text = "Deleted"
self.hsbLabel?.textColor = UIColor.redColor()
self.hueSlider?.enabled = false
self.saturationSlider?.enabled = false
@@ -88,7 +108,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
// MARK: Private
let objectController: ManagedObjectController<Palette>
var objectController: ManagedObjectController<Palette>?
@IBOutlet weak var colorNameLabel: UILabel?
@IBOutlet weak var colorView: UIView?
@@ -103,7 +123,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let hue = self.hueSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController.object) {
if let palette = transaction.fetch(self?.objectController?.object) {
palette.hue = Int32(hue)
palette.dateAdded = NSDate()
@@ -117,7 +137,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let saturation = self.saturationSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController.object) {
if let palette = transaction.fetch(self?.objectController?.object) {
palette.saturation = saturation
palette.dateAdded = NSDate()
@@ -131,7 +151,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
let brightness = self.brightnessSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController.object) {
if let palette = transaction.fetch(self?.objectController?.object) {
palette.brightness = brightness
palette.dateAdded = NSDate()
@@ -144,11 +164,9 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
transaction.delete(self?.objectController.object)
transaction.delete(self?.objectController?.object)
transaction.commit { (result) -> Void in }
}
(sender as? UIBarButtonItem)?.enabled = false
}
func reloadPaletteInfo(palette: Palette) {
@@ -159,13 +177,23 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
self.colorNameLabel?.textColor = color
self.colorView?.backgroundColor = color
self.hsbLabel?.text = "H: \(palette.hue)˚, S: \(round(palette.saturation * 100.0))%, B: \(round(palette.brightness * 100.0))%"
let hue = palette.hue
let saturation = palette.saturation
let brightness = palette.brightness
let dateString = NSDateFormatter.localizedStringFromDate(
palette.dateAdded,
dateStyle: .ShortStyle,
timeStyle: .LongStyle
)
self.dateLabel?.text = "Updated: \(dateString)"
self.hsbLabel?.text = "H: \(hue)˚, S: \(Int(saturation * 100))%, B: \(Int(brightness * 100))%"
if Int32(self.hueSlider?.value ?? 0) != hue {
self.hueSlider?.value = Float(hue)
}
if self.saturationSlider?.value != saturation {
self.saturationSlider?.value = saturation
}
if self.brightnessSlider?.value != brightness {
self.brightnessSlider?.value = brightness
}
}
}

View File

@@ -9,6 +9,10 @@
import Foundation
import UIKit
import CoreData
import HardcoreData
// MARK: - Palette
class Palette: NSManagedObject {