mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Xcode 8 WIP
This commit is contained in:
1 parent
abd6fe9f2d
commit
1d1d843dc7
7 files changed
+247
-106
No files matched your search
@@ -22,6 +22,76 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
5657AAFA1D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 560FC54D1CB003810014AA8E;
|
||||
remoteInfo = GRDBCipherOSX;
|
||||
};
|
||||
5657AAFC1D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 560FC5B01CB00B880014AA8E;
|
||||
remoteInfo = GRDBCipherOSXTests;
|
||||
};
|
||||
5657AAFE1D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 5671566C1CB16729007DC145;
|
||||
remoteInfo = GRDBCipherOSXEncryptedTests;
|
||||
};
|
||||
5657AB001D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F3BA805A1CFB2BB2003DC1BA;
|
||||
remoteInfo = GRDBCustomSQLiteOSX;
|
||||
};
|
||||
5657AB021D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F3BA809B1CFB2F6F003DC1BA;
|
||||
remoteInfo = GRDBCustomSQLiteOSXTests;
|
||||
};
|
||||
5657AB041D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56AFCA231CB1A8BB00F48B96;
|
||||
remoteInfo = GRDBCipheriOS;
|
||||
};
|
||||
5657AB061D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56AFCA7F1CB1AA9900F48B96;
|
||||
remoteInfo = GRDBCipheriOSTests;
|
||||
};
|
||||
5657AB081D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56AFCAD71CB1ABC800F48B96;
|
||||
remoteInfo = GRDBCipheriOSEncryptedTests;
|
||||
};
|
||||
5657AB0A1D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F3BA7FFE1CFB25E4003DC1BA;
|
||||
remoteInfo = GRDBCustomSQLiteiOS;
|
||||
};
|
||||
5657AB0C1D107C20006283EF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F3BA80411CFB2AD7003DC1BA;
|
||||
remoteInfo = GRDBCustomSQLiteiOSTests;
|
||||
};
|
||||
568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */;
|
||||
@@ -151,11 +221,21 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
568C7ACF1CA6C6BF00796484 /* GRDB.framework */,
|
||||
568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */,
|
||||
568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */,
|
||||
568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */,
|
||||
568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */,
|
||||
5657AAFB1D107C20006283EF /* GRDBCipher.framework */,
|
||||
5657AAFD1D107C20006283EF /* GRDBTests.xctest */,
|
||||
5657AAFF1D107C20006283EF /* GRDBCipherOSXEncryptedTests.xctest */,
|
||||
5657AB011D107C20006283EF /* GRDBCustomSQLite.framework */,
|
||||
5657AB031D107C20006283EF /* GRDBCustomSQLiteOSXTests.xctest */,
|
||||
568C7AD71CA6C6BF00796484 /* GRDB.framework */,
|
||||
568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */,
|
||||
5657AB051D107C20006283EF /* GRDBCipher.framework */,
|
||||
5657AB071D107C20006283EF /* GRDBTests.xctest */,
|
||||
5657AB091D107C20006283EF /* GRDBTests.xctest */,
|
||||
5657AB0B1D107C20006283EF /* GRDBCustomSQLite.framework */,
|
||||
5657AB0D1D107C20006283EF /* GRDBCustomSQLiteiOSTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -200,7 +280,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0730;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = Pierlis;
|
||||
TargetAttributes = {
|
||||
568C7A951CA6C63100796484 = {
|
||||
@@ -234,6 +314,76 @@
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
5657AAFB1D107C20006283EF /* GRDBCipher.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDBCipher.framework;
|
||||
remoteRef = 5657AAFA1D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AAFD1D107C20006283EF /* GRDBTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBTests.xctest;
|
||||
remoteRef = 5657AAFC1D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AAFF1D107C20006283EF /* GRDBCipherOSXEncryptedTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBCipherOSXEncryptedTests.xctest;
|
||||
remoteRef = 5657AAFE1D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB011D107C20006283EF /* GRDBCustomSQLite.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDBCustomSQLite.framework;
|
||||
remoteRef = 5657AB001D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB031D107C20006283EF /* GRDBCustomSQLiteOSXTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBCustomSQLiteOSXTests.xctest;
|
||||
remoteRef = 5657AB021D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB051D107C20006283EF /* GRDBCipher.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDBCipher.framework;
|
||||
remoteRef = 5657AB041D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB071D107C20006283EF /* GRDBTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBTests.xctest;
|
||||
remoteRef = 5657AB061D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB091D107C20006283EF /* GRDBTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBTests.xctest;
|
||||
remoteRef = 5657AB081D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB0B1D107C20006283EF /* GRDBCustomSQLite.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDBCustomSQLite.framework;
|
||||
remoteRef = 5657AB0A1D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5657AB0D1D107C20006283EF /* GRDBCustomSQLiteiOSTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBCustomSQLiteiOSTests.xctest;
|
||||
remoteRef = 5657AB0C1D107C20006283EF /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
568C7ACF1CA6C6BF00796484 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
@@ -422,10 +572,10 @@
|
||||
568C7AA91CA6C63100796484 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
@@ -438,16 +588,17 @@
|
||||
568C7AAA1CA6C63100796484 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = GRDB.GRDBDemoiOS;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="UAh-8N-CM8">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11129.15" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="UAh-8N-CM8">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11103.10"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Hall Of Fame-->
|
||||
@@ -11,29 +12,29 @@
|
||||
<objects>
|
||||
<tableViewController id="cyv-nk-Plb" customClass="SimplePersonsViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="oON-zg-8kO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="XIE-DF-pSO" detailTextLabel="vyz-CH-eMb" style="IBUITableViewCellStyleValue1" id="V5t-oJ-KD9">
|
||||
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
|
||||
<frame key="frameInset" minY="92" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V5t-oJ-KD9" id="Coo-th-ywF">
|
||||
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="XIE-DF-pSO">
|
||||
<rect key="frame" x="15" y="12" width="32" height="20"/>
|
||||
<frame key="frameInset" minX="15" minY="12" width="31.5" height="19.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vyz-CH-eMb">
|
||||
<rect key="frame" x="523" y="12" width="42" height="20"/>
|
||||
<frame key="frameInset" minX="298.5" minY="12" width="41.5" height="19.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
@@ -64,21 +65,20 @@
|
||||
<objects>
|
||||
<tableViewController id="iNr-Oe-muq" customClass="PersonEditionViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="vlV-lc-eQA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<sections>
|
||||
<tableViewSection id="Nzq-eO-jT3">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="2gb-gB-918">
|
||||
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
|
||||
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2gb-gB-918" id="iyM-TJ-JB4">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<frame key="frameInset" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Name" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="m5m-Zs-j0z">
|
||||
<rect key="frame" x="18" y="12" width="574" height="20"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no" returnKeyType="next"/>
|
||||
<connections>
|
||||
@@ -94,14 +94,13 @@
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="vp3-Ft-Gth">
|
||||
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
|
||||
<rect key="frame" x="0.0" y="108" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vp3-Ft-Gth" id="ccO-0O-u72">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<frame key="frameInset" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Score" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="rZ9-Fa-cyr">
|
||||
<rect key="frame" x="18" y="12" width="574" height="20"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" returnKeyType="done"/>
|
||||
</textField>
|
||||
@@ -154,24 +153,24 @@
|
||||
<objects>
|
||||
<tableViewController id="9kw-c5-KTk" customClass="DemoViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="f4Y-o2-7VW">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<sections>
|
||||
<tableViewSection id="dCg-qU-h2X">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="clL-nG-zPX" style="IBUITableViewCellStyleDefault" id="kJB-sX-YAb">
|
||||
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
|
||||
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kJB-sX-YAb" id="f5l-ob-3DG">
|
||||
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Simple TableView" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="clL-nG-zPX">
|
||||
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
|
||||
<frame key="frameInset" minX="15" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
@@ -181,17 +180,17 @@
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="I78-c5-0kp" style="IBUITableViewCellStyleDefault" id="q4C-mT-5mi">
|
||||
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
|
||||
<rect key="frame" x="0.0" y="108" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q4C-mT-5mi" id="2Cu-K1-hiz">
|
||||
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="FetchedRecordsController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="I78-c5-0kp">
|
||||
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
|
||||
<frame key="frameInset" minX="15" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
@@ -251,29 +250,29 @@
|
||||
<objects>
|
||||
<tableViewController id="PJp-Eq-ZjA" customClass="PersonsViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="tX0-ON-WSI">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="G8y-VE-YRu" detailTextLabel="NNc-J4-xiE" style="IBUITableViewCellStyleValue1" id="bFj-Hd-fwd">
|
||||
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
|
||||
<frame key="frameInset" minY="92" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bFj-Hd-fwd" id="kDf-TZ-xhb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="G8y-VE-YRu">
|
||||
<rect key="frame" x="15" y="12" width="32" height="20"/>
|
||||
<frame key="frameInset" minX="15" minY="12" width="31.5" height="19.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NNc-J4-xiE">
|
||||
<rect key="frame" x="523" y="12" width="42" height="20"/>
|
||||
<frame key="frameInset" minX="298.5" minY="12" width="41.5" height="19.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
@@ -306,6 +305,6 @@
|
||||
</scenes>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="7PC-xN-zD4"/>
|
||||
<segue reference="Lgu-Yd-HSy"/>
|
||||
<segue reference="czF-1h-sYn"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
</document>
|
||||
@@ -85,7 +85,7 @@ extension PersonEditionViewController: UITextFieldDelegate {
|
||||
nameTextField.becomeFirstResponder()
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: NSIndexPath) {
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
tableView.deselectRow(at: indexPath, animated: false)
|
||||
let cell = tableView.cellForRow(at: indexPath)
|
||||
if cell === nameCell {
|
||||
|
||||
@@ -86,15 +86,15 @@ extension PersonsViewController : PersonEditionViewControllerDelegate {
|
||||
performSegue(withIdentifier: "NewPerson", sender: sender)
|
||||
}
|
||||
|
||||
@IBAction func cancelPersonEdition(segue: UIStoryboardSegue) {
|
||||
@IBAction func cancelPersonEdition(_ segue: UIStoryboardSegue) {
|
||||
// Person creation: cancel button was tapped
|
||||
}
|
||||
|
||||
@IBAction func commitPersonEdition(segue: UIStoryboardSegue) {
|
||||
@IBAction func commitPersonEdition(_ segue: UIStoryboardSegue) {
|
||||
// Person creation: commit button was tapped
|
||||
let controller = segue.sourceViewController as! PersonEditionViewController
|
||||
controller.applyChanges()
|
||||
let person = controller.person
|
||||
let person = controller.person!
|
||||
if !person.name.isEmpty {
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.save(db)
|
||||
@@ -105,7 +105,7 @@ extension PersonsViewController : PersonEditionViewControllerDelegate {
|
||||
func personEditionControllerDidComplete(_ controller: PersonEditionViewController) {
|
||||
// Person edition: back button was tapped
|
||||
controller.applyChanges()
|
||||
let person = controller.person
|
||||
let person = controller.person!
|
||||
if !person.name.isEmpty {
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.save(db)
|
||||
@@ -118,7 +118,7 @@ extension PersonsViewController : PersonEditionViewControllerDelegate {
|
||||
// MARK: - UITableViewDataSource
|
||||
|
||||
extension PersonsViewController {
|
||||
func configure(_ cell: UITableViewCell, at indexPath: NSIndexPath) {
|
||||
func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
|
||||
let person = personsController.record(at: indexPath)
|
||||
cell.textLabel?.text = person.name
|
||||
cell.detailTextLabel?.text = abs(person.score) > 1 ? "\(person.score) points" : "0 point"
|
||||
@@ -132,17 +132,17 @@ extension PersonsViewController {
|
||||
return personsController.sections[section].numberOfRecords
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: NSIndexPath) -> UITableViewCell {
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "Person", for: indexPath)
|
||||
configure(cell, at: indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: NSIndexPath) {
|
||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
|
||||
// Delete the person
|
||||
let person = personsController.record(at: indexPath)
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.delete(db)
|
||||
_ = try person.delete(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,15 +54,15 @@ extension SimplePersonsViewController : PersonEditionViewControllerDelegate {
|
||||
performSegue(withIdentifier: "NewPerson", sender: sender)
|
||||
}
|
||||
|
||||
@IBAction func cancelPersonEdition(segue: UIStoryboardSegue) {
|
||||
@IBAction func cancelPersonEdition(_ segue: UIStoryboardSegue) {
|
||||
// Person creation: cancel button was tapped
|
||||
}
|
||||
|
||||
@IBAction func commitPersonEdition(segue: UIStoryboardSegue) {
|
||||
@IBAction func commitPersonEdition(_ segue: UIStoryboardSegue) {
|
||||
// Person creation: commit button was tapped
|
||||
let controller = segue.sourceViewController as! PersonEditionViewController
|
||||
controller.applyChanges()
|
||||
let person = controller.person
|
||||
let person = controller.person!
|
||||
if !person.name.isEmpty {
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.save(db)
|
||||
@@ -73,7 +73,7 @@ extension SimplePersonsViewController : PersonEditionViewControllerDelegate {
|
||||
func personEditionControllerDidComplete(_ controller: PersonEditionViewController) {
|
||||
// Person edition: back button was tapped
|
||||
controller.applyChanges()
|
||||
let person = controller.person
|
||||
let person = controller.person!
|
||||
if !person.name.isEmpty {
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.save(db)
|
||||
@@ -86,7 +86,7 @@ extension SimplePersonsViewController : PersonEditionViewControllerDelegate {
|
||||
// MARK: - UITableViewDataSource
|
||||
|
||||
extension SimplePersonsViewController {
|
||||
func configure(_ cell: UITableViewCell, at indexPath: NSIndexPath) {
|
||||
func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
|
||||
let person = persons[indexPath.row]
|
||||
cell.textLabel?.text = person.name
|
||||
cell.detailTextLabel?.text = abs(person.score) > 1 ? "\(person.score) points" : "0 point"
|
||||
@@ -96,17 +96,17 @@ extension SimplePersonsViewController {
|
||||
return persons.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: NSIndexPath) -> UITableViewCell {
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "Person", for: indexPath)
|
||||
configure(cell, at: indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: NSIndexPath) {
|
||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
|
||||
// Delete the person
|
||||
let person = persons[indexPath.row]
|
||||
try! dbQueue.inDatabase { db in
|
||||
try person.delete(db)
|
||||
_ = try person.delete(db)
|
||||
}
|
||||
persons.remove(at: indexPath.row)
|
||||
tableView.deleteRows(at: [indexPath], with: .fade)
|
||||
|
||||
@@ -680,11 +680,11 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
///
|
||||
/// If indexPath does not describe a valid index path in the fetched
|
||||
/// records, a fatal error is raised.
|
||||
public func record(at indexPath: NSIndexPath) -> Record {
|
||||
public func record(at indexPath: IndexPath) -> Record {
|
||||
guard let fetchedItems = fetchedItems else {
|
||||
fatalError("performFetch() has not been called.")
|
||||
}
|
||||
return fetchedItems[indexPath.index(atPosition: 1)].record
|
||||
return fetchedItems[indexPath.row].record
|
||||
}
|
||||
|
||||
|
||||
@@ -706,12 +706,12 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
///
|
||||
/// - returns: The index path of *record* in the fetched records, or nil
|
||||
/// if record could not be found.
|
||||
public func indexPath(for record: Record) -> NSIndexPath? {
|
||||
public func indexPath(for record: Record) -> IndexPath? {
|
||||
let item = Item<Record>(row: Row(record.persistentDictionary))
|
||||
guard let fetchedItems = fetchedItems, let index = fetchedItems.index(where: { isSameItem($0, item) }) else {
|
||||
return nil
|
||||
}
|
||||
return NSIndexPath(row: index, section: 0)
|
||||
return IndexPath(row: index, section: 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,14 +727,14 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
|
||||
var changes = [TableViewChange<Record>]()
|
||||
for (row, item) in s.enumerated() {
|
||||
let deletion = TableViewChange.deletion(item: item, indexPath: NSIndexPath(row: row, section: 0))
|
||||
let deletion = TableViewChange.deletion(item: item, indexPath: IndexPath(row: row, section: 0))
|
||||
changes.append(deletion)
|
||||
d[row + 1][0] = changes
|
||||
}
|
||||
|
||||
changes.removeAll()
|
||||
for (col, item) in t.enumerated() {
|
||||
let insertion = TableViewChange.insertion(item: item, indexPath: NSIndexPath(row: col, section: 0))
|
||||
let insertion = TableViewChange.insertion(item: item, indexPath: IndexPath(row: col, section: 0))
|
||||
changes.append(insertion)
|
||||
d[0][col + 1] = changes
|
||||
}
|
||||
@@ -757,16 +757,16 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
// Record operation.
|
||||
let minimumCount = min(del.count, ins.count, sub.count)
|
||||
if del.count == minimumCount {
|
||||
let deletion = TableViewChange.deletion(item: s[sx], indexPath: NSIndexPath(row: sx, section: 0))
|
||||
let deletion = TableViewChange.deletion(item: s[sx], indexPath: IndexPath(row: sx, section: 0))
|
||||
del.append(deletion)
|
||||
d[sx+1][tx+1] = del
|
||||
} else if ins.count == minimumCount {
|
||||
let insertion = TableViewChange.insertion(item: t[tx], indexPath: NSIndexPath(row: tx, section: 0))
|
||||
let insertion = TableViewChange.insertion(item: t[tx], indexPath: IndexPath(row: tx, section: 0))
|
||||
ins.append(insertion)
|
||||
d[sx+1][tx+1] = ins
|
||||
} else {
|
||||
let deletion = TableViewChange.deletion(item: s[sx], indexPath: NSIndexPath(row: sx, section: 0))
|
||||
let insertion = TableViewChange.insertion(item: t[tx], indexPath: NSIndexPath(row: tx, section: 0))
|
||||
let deletion = TableViewChange.deletion(item: s[sx], indexPath: IndexPath(row: sx, section: 0))
|
||||
let insertion = TableViewChange.insertion(item: t[tx], indexPath: IndexPath(row: tx, section: 0))
|
||||
sub.append(deletion)
|
||||
sub.append(insertion)
|
||||
d[sx+1][tx+1] = sub
|
||||
@@ -855,10 +855,10 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
}
|
||||
|
||||
private enum TableViewChange<T: RowConvertible> {
|
||||
case insertion(item: Item<T>, indexPath: NSIndexPath)
|
||||
case deletion(item: Item<T>, indexPath: NSIndexPath)
|
||||
case move(item: Item<T>, indexPath: NSIndexPath, newIndexPath: NSIndexPath, changes: [String: DatabaseValue])
|
||||
case update(item: Item<T>, indexPath: NSIndexPath, changes: [String: DatabaseValue])
|
||||
case insertion(item: Item<T>, indexPath: IndexPath)
|
||||
case deletion(item: Item<T>, indexPath: IndexPath)
|
||||
case move(item: Item<T>, indexPath: IndexPath, newIndexPath: IndexPath, changes: [String: DatabaseValue])
|
||||
case update(item: Item<T>, indexPath: IndexPath, changes: [String: DatabaseValue])
|
||||
}
|
||||
|
||||
extension TableViewChange {
|
||||
@@ -914,20 +914,20 @@ private final class FetchedRecordsObserver<Record: RowConvertible> : Transaction
|
||||
public enum TableViewEvent {
|
||||
|
||||
/// An insertion event, at given indexPath.
|
||||
case insertion(indexPath: NSIndexPath)
|
||||
case insertion(indexPath: IndexPath)
|
||||
|
||||
/// A deletion event, at given indexPath.
|
||||
case deletion(indexPath: NSIndexPath)
|
||||
case deletion(indexPath: IndexPath)
|
||||
|
||||
/// A move event, from indexPath to newIndexPath. The *changes* are a
|
||||
/// dictionary whose keys are column names, and values the old values that
|
||||
/// have been changed.
|
||||
case move(indexPath: NSIndexPath, newIndexPath: NSIndexPath, changes: [String: DatabaseValue])
|
||||
case move(indexPath: IndexPath, newIndexPath: IndexPath, changes: [String: DatabaseValue])
|
||||
|
||||
/// An update event, at given indexPath. The *changes* are a dictionary
|
||||
/// whose keys are column names, and values the old values that have
|
||||
/// been changed.
|
||||
case update(indexPath: NSIndexPath, changes: [String: DatabaseValue])
|
||||
case update(indexPath: IndexPath, changes: [String: DatabaseValue])
|
||||
}
|
||||
|
||||
extension TableViewEvent: CustomStringConvertible {
|
||||
|
||||
@@ -7,15 +7,6 @@ import XCTest
|
||||
import GRDB
|
||||
#endif
|
||||
|
||||
/// Same as NSIndexPath.row, but works on OSX as well.
|
||||
private func row(for indexPath:NSIndexPath) -> Int {
|
||||
#if os(iOS)
|
||||
return indexPath.row
|
||||
#else
|
||||
return indexPath.indexAtPosition(1)
|
||||
#endif
|
||||
}
|
||||
|
||||
private class ChangesRecorder<Record: RowConvertible> {
|
||||
var changes: [(record: Record, event: TableViewEvent)] = []
|
||||
var recordsBeforeChanges: [Record]!
|
||||
@@ -121,8 +112,8 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(controller.sections[0].records[0].name, "Arthur")
|
||||
XCTAssertEqual(controller.fetchedRecords!.count, 1)
|
||||
XCTAssertEqual(controller.fetchedRecords![0].name, "Arthur")
|
||||
XCTAssertEqual(controller.record(at: NSIndexPath(row: 0, section: 0)).name, "Arthur")
|
||||
XCTAssertEqual(controller.indexPath(for: arthur), NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(controller.record(at: IndexPath(row: 0, section: 0)).name, "Arthur")
|
||||
XCTAssertEqual(controller.indexPath(for: arthur), IndexPath(row: 0, section: 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +151,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Arthur")
|
||||
switch recorder.changes[0].event {
|
||||
case .insertion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
@@ -184,7 +175,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Barbara")
|
||||
switch recorder.changes[0].event {
|
||||
case .insertion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 1, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
@@ -238,7 +229,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Craig")
|
||||
switch recorder.changes[0].event {
|
||||
case .update(let indexPath, let changes):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(changes, ["name": "Arthur".databaseValue])
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -263,7 +254,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Danielle")
|
||||
switch recorder.changes[0].event {
|
||||
case .update(let indexPath, let changes):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(changes, ["name": "Barbara".databaseValue])
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -310,7 +301,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Arthur")
|
||||
switch recorder.changes[0].event {
|
||||
case .deletion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
@@ -331,7 +322,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Barbara")
|
||||
switch recorder.changes[0].event {
|
||||
case .deletion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
@@ -378,8 +369,8 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Craig")
|
||||
switch recorder.changes[0].event {
|
||||
case .move(let indexPath, let newIndexPath, let changes):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(newIndexPath, NSIndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(newIndexPath, IndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(changes, ["name": "Arthur".databaseValue])
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -434,7 +425,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.bookCount, 0)
|
||||
switch recorder.changes[0].event {
|
||||
case .update(let indexPath, let changes):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(changes, ["bookCount": 1.databaseValue])
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -464,28 +455,28 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
case .I(let s, let i):
|
||||
switch event {
|
||||
case .insertion(let indexPath):
|
||||
return s == name && i == row(for: indexPath)
|
||||
return s == name && i == indexPath.row
|
||||
default:
|
||||
return false
|
||||
}
|
||||
case .M(let s, let i, let j, let c):
|
||||
switch event {
|
||||
case .move(let indexPath, let newIndexPath, let changes):
|
||||
return s == name && i == row(for: indexPath) && j == row(for: newIndexPath) && c == changes["name"]!.value()
|
||||
return s == name && i == indexPath.row && j == newIndexPath.row && c == changes["name"]!.value()
|
||||
default:
|
||||
return false
|
||||
}
|
||||
case .D(let s, let i):
|
||||
switch event {
|
||||
case .deletion(let indexPath):
|
||||
return s == name && i == row(for: indexPath)
|
||||
return s == name && i == indexPath.row
|
||||
default:
|
||||
return false
|
||||
}
|
||||
case .U(let s, let i, let c):
|
||||
switch event {
|
||||
case .update(let indexPath, let changes):
|
||||
return s == name && i == row(for: indexPath) && c == changes["name"]!.value()
|
||||
return s == name && i == indexPath.row && c == changes["name"]!.value()
|
||||
default:
|
||||
return false
|
||||
}
|
||||
@@ -610,8 +601,8 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Barbara")
|
||||
switch recorder.changes[0].event {
|
||||
case .move(let indexPath, let newIndexPath, let changes):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(newIndexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(newIndexPath, IndexPath(row: 0, section: 0))
|
||||
XCTAssertTrue(changes.isEmpty)
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -633,7 +624,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[1].record.name, "Craig")
|
||||
switch recorder.changes[0].event {
|
||||
case .deletion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
@@ -641,8 +632,8 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
case .move(let indexPath, let newIndexPath, let changes):
|
||||
// TODO: is it really what we should expect? Wouldn't an update fit better?
|
||||
// What does UITableView think?
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(newIndexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 1, section: 0))
|
||||
XCTAssertEqual(newIndexPath, IndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(changes, ["name": "Arthur".databaseValue])
|
||||
default:
|
||||
XCTFail()
|
||||
@@ -680,7 +671,7 @@ class FetchedRecordsControlleriOSTests: GRDBTestCase {
|
||||
XCTAssertEqual(recorder.changes[0].record.name, "Arthur")
|
||||
switch recorder.changes[0].event {
|
||||
case .insertion(let indexPath):
|
||||
XCTAssertEqual(indexPath, NSIndexPath(row: 0, section: 0))
|
||||
XCTAssertEqual(indexPath, IndexPath(row: 0, section: 0))
|
||||
default:
|
||||
XCTFail()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user