setup project for tests

This commit is contained in:
Max Sokolov 2016-03-19 15:17:43 +03:00
parent 5ac120da0c
commit 0fefdecac0
24 changed files with 960 additions and 49 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
</Workspace>

26
Tablet/Info.plist Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -27,8 +27,8 @@ import Foundation
public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
public private(set) weak var tableView: UITableView!
private var sections = [TableSectionBuilder]()
public weak var scrollDelegate: UIScrollViewDelegate?
private var sections = [TableSectionBuilder]()
public init(tableView: UITableView) {
super.init()
@ -166,10 +166,10 @@ public extension TableDirector {
return invokeAction(.height, cell: nil, indexPath: indexPath) as? CGFloat ?? UITableViewAutomaticDimension
}
func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
/*func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
return invokeAction(.willSelect, cell: tableView.cellForRowAtIndexPath(indexPath), indexPath: indexPath) as? NSIndexPath
}
}*/
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

View File

@ -23,7 +23,7 @@ import Foundation
public typealias ReturnValue = AnyObject?
internal enum ActionHandler<I, C> {
enum ActionHandler<I, C> {
case actionBlock((data: ActionData<I, C>) -> Void)
case actionReturnBlock((data: ActionData<I, C>) -> AnyObject?)

12
Tablet/Tablet.h Normal file
View File

@ -0,0 +1,12 @@
//
// Tablet.h
// Tablet
//
// Created by Max Sokolov on 19/03/16.
// Copyright © 2016 Tablet. All rights reserved.
//
@import Foundation;
FOUNDATION_EXPORT double TabletVersionNumber;
FOUNDATION_EXPORT const unsigned char TabletVersionString[];

View File

@ -21,7 +21,7 @@
import UIKit
import Foundation
internal struct TabletNotifications {
struct TabletNotifications {
static let CellAction = "_cellaction"
}

View File

@ -0,0 +1,423 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
DAC2D6741C9D743D009E9C19 /* Tablet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC2D6691C9D743D009E9C19 /* Tablet.framework */; };
DAC2D6871C9D7517009E9C19 /* Tablet.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2D6851C9D7517009E9C19 /* Tablet.h */; settings = {ATTRIBUTES = (Public, ); }; };
DAC2D6901C9D799E009E9C19 /* TableDirector.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D68C1C9D799E009E9C19 /* TableDirector.swift */; };
DAC2D6911C9D799E009E9C19 /* TableRowBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D68D1C9D799E009E9C19 /* TableRowBuilder.swift */; };
DAC2D6921C9D799E009E9C19 /* TableSectionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D68E1C9D799E009E9C19 /* TableSectionBuilder.swift */; };
DAC2D6931C9D799E009E9C19 /* Tablet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D68F1C9D799E009E9C19 /* Tablet.swift */; };
DAC2D6991C9D7A3F009E9C19 /* TabletTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D6961C9D7A3B009E9C19 /* TabletTests.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
DAC2D6751C9D743D009E9C19 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DAC2D6601C9D743D009E9C19 /* Project object */;
proxyType = 1;
remoteGlobalIDString = DAC2D6681C9D743D009E9C19;
remoteInfo = Tablet;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
DAC2D6691C9D743D009E9C19 /* Tablet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Tablet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DAC2D6731C9D743D009E9C19 /* TabletTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TabletTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
DAC2D6841C9D7517009E9C19 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DAC2D6851C9D7517009E9C19 /* Tablet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tablet.h; sourceTree = "<group>"; };
DAC2D68C1C9D799E009E9C19 /* TableDirector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableDirector.swift; sourceTree = "<group>"; };
DAC2D68D1C9D799E009E9C19 /* TableRowBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableRowBuilder.swift; sourceTree = "<group>"; };
DAC2D68E1C9D799E009E9C19 /* TableSectionBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableSectionBuilder.swift; sourceTree = "<group>"; };
DAC2D68F1C9D799E009E9C19 /* Tablet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tablet.swift; sourceTree = "<group>"; };
DAC2D6951C9D7A3B009E9C19 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DAC2D6961C9D7A3B009E9C19 /* TabletTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabletTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
DAC2D6651C9D743D009E9C19 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D6701C9D743D009E9C19 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DAC2D6741C9D743D009E9C19 /* Tablet.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
DAC2D65F1C9D743D009E9C19 = {
isa = PBXGroup;
children = (
DAC2D68B1C9D7990009E9C19 /* Classes */,
DAC2D6941C9D7A03009E9C19 /* Tests */,
DAC2D6831C9D74EE009E9C19 /* Supporting Files */,
DAC2D66A1C9D743D009E9C19 /* Products */,
);
sourceTree = "<group>";
};
DAC2D66A1C9D743D009E9C19 /* Products */ = {
isa = PBXGroup;
children = (
DAC2D6691C9D743D009E9C19 /* Tablet.framework */,
DAC2D6731C9D743D009E9C19 /* TabletTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
DAC2D6831C9D74EE009E9C19 /* Supporting Files */ = {
isa = PBXGroup;
children = (
DAC2D6841C9D7517009E9C19 /* Info.plist */,
DAC2D6851C9D7517009E9C19 /* Tablet.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
DAC2D68B1C9D7990009E9C19 /* Classes */ = {
isa = PBXGroup;
children = (
DAC2D68F1C9D799E009E9C19 /* Tablet.swift */,
DAC2D68C1C9D799E009E9C19 /* TableDirector.swift */,
DAC2D68D1C9D799E009E9C19 /* TableRowBuilder.swift */,
DAC2D68E1C9D799E009E9C19 /* TableSectionBuilder.swift */,
);
name = Classes;
sourceTree = "<group>";
};
DAC2D6941C9D7A03009E9C19 /* Tests */ = {
isa = PBXGroup;
children = (
DAC2D6951C9D7A3B009E9C19 /* Info.plist */,
DAC2D6961C9D7A3B009E9C19 /* TabletTests.swift */,
);
name = Tests;
path = ../Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
DAC2D6661C9D743D009E9C19 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
DAC2D6871C9D7517009E9C19 /* Tablet.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
DAC2D6681C9D743D009E9C19 /* Tablet */ = {
isa = PBXNativeTarget;
buildConfigurationList = DAC2D67D1C9D743D009E9C19 /* Build configuration list for PBXNativeTarget "Tablet" */;
buildPhases = (
DAC2D6641C9D743D009E9C19 /* Sources */,
DAC2D6651C9D743D009E9C19 /* Frameworks */,
DAC2D6661C9D743D009E9C19 /* Headers */,
DAC2D6671C9D743D009E9C19 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Tablet;
productName = Tablet;
productReference = DAC2D6691C9D743D009E9C19 /* Tablet.framework */;
productType = "com.apple.product-type.framework";
};
DAC2D6721C9D743D009E9C19 /* TabletTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = DAC2D6801C9D743D009E9C19 /* Build configuration list for PBXNativeTarget "TabletTests" */;
buildPhases = (
DAC2D66F1C9D743D009E9C19 /* Sources */,
DAC2D6701C9D743D009E9C19 /* Frameworks */,
DAC2D6711C9D743D009E9C19 /* Resources */,
);
buildRules = (
);
dependencies = (
DAC2D6761C9D743D009E9C19 /* PBXTargetDependency */,
);
name = TabletTests;
productName = TabletTests;
productReference = DAC2D6731C9D743D009E9C19 /* TabletTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
DAC2D6601C9D743D009E9C19 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = Tablet;
TargetAttributes = {
DAC2D6681C9D743D009E9C19 = {
CreatedOnToolsVersion = 7.2;
};
DAC2D6721C9D743D009E9C19 = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = DAC2D6631C9D743D009E9C19 /* Build configuration list for PBXProject "Tablet" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = DAC2D65F1C9D743D009E9C19;
productRefGroup = DAC2D66A1C9D743D009E9C19 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
DAC2D6681C9D743D009E9C19 /* Tablet */,
DAC2D6721C9D743D009E9C19 /* TabletTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
DAC2D6671C9D743D009E9C19 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D6711C9D743D009E9C19 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
DAC2D6641C9D743D009E9C19 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAC2D6901C9D799E009E9C19 /* TableDirector.swift in Sources */,
DAC2D6921C9D799E009E9C19 /* TableSectionBuilder.swift in Sources */,
DAC2D6911C9D799E009E9C19 /* TableRowBuilder.swift in Sources */,
DAC2D6931C9D799E009E9C19 /* Tablet.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D66F1C9D743D009E9C19 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAC2D6991C9D7A3F009E9C19 /* TabletTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
DAC2D6761C9D743D009E9C19 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DAC2D6681C9D743D009E9C19 /* Tablet */;
targetProxy = DAC2D6751C9D743D009E9C19 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
DAC2D67B1C9D743D009E9C19 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
DAC2D67C1C9D743D009E9C19 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
DAC2D67E1C9D743D009E9C19 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet.Tablet;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
DAC2D67F1C9D743D009E9C19 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet.Tablet;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
DAC2D6811C9D743D009E9C19 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = ../Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet.TabletTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
DAC2D6821C9D743D009E9C19 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = ../Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet.TabletTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
DAC2D6631C9D743D009E9C19 /* Build configuration list for PBXProject "Tablet" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DAC2D67B1C9D743D009E9C19 /* Debug */,
DAC2D67C1C9D743D009E9C19 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DAC2D67D1C9D743D009E9C19 /* Build configuration list for PBXNativeTarget "Tablet" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DAC2D67E1C9D743D009E9C19 /* Debug */,
DAC2D67F1C9D743D009E9C19 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DAC2D6801C9D743D009E9C19 /* Build configuration list for PBXNativeTarget "TabletTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DAC2D6811C9D743D009E9C19 /* Debug */,
DAC2D6821C9D743D009E9C19 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = DAC2D6601C9D743D009E9C19 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Tablet.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D6681C9D743D009E9C19"
BuildableName = "Tablet.framework"
BlueprintName = "Tablet"
ReferencedContainer = "container:Tablet.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D6721C9D743D009E9C19"
BuildableName = "TabletTests.xctest"
BlueprintName = "TabletTests"
ReferencedContainer = "container:Tablet.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D6681C9D743D009E9C19"
BuildableName = "Tablet.framework"
BlueprintName = "Tablet"
ReferencedContainer = "container:Tablet.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D6681C9D743D009E9C19"
BuildableName = "Tablet.framework"
BlueprintName = "Tablet"
ReferencedContainer = "container:Tablet.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D6681C9D743D009E9C19"
BuildableName = "Tablet.framework"
BlueprintName = "Tablet"
ReferencedContainer = "container:Tablet.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Tablet.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>DAC2D6681C9D743D009E9C19</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>DAC2D6721C9D743D009E9C19</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,28 @@
//
// MainViewController.swift
// TabletDemo
//
// Created by Max Sokolov on 19/03/16.
// Copyright © 2016 Tablet. All rights reserved.
//
import Foundation
import UIKit
class MainViewController : UITableViewController {
var tableDirector: TableDirector!
override func viewDidLoad() {
super.viewDidLoad()
tableDirector = TableDirector(tableView: tableView)
tableDirector += TableRowBuilder<Int, UITableViewCell>(items: [1, 2, 3, 4], id: "cell")
.action(.configure) { data -> Void in
data.cell?.accessoryType = .DisclosureIndicator
data.cell?.textLabel?.text = "\(data.item)"
}
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jN2-c3-xf5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="dOU-ON-YYD">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--View Controller-->
@ -19,7 +19,6 @@
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="ovi-uI-31e">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<animations/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" textLabel="Rrx-qY-GXL" style="IBUITableViewCellStyleDefault" id="MhM-yS-XTS">
@ -32,15 +31,12 @@
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Rrx-qY-GXL">
<rect key="frame" x="15" y="0.0" width="570" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
</tableViewCellContentView>
<animations/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ConfigurableTableViewCell" id="GPe-Vu-z5d" customClass="ConfigurableTableViewCell" customModule="TabletDemo" customModuleProvider="target">
<rect key="frame" x="0.0" y="158" width="600" height="44"/>
@ -51,7 +47,6 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="C3u-xz-sbM">
<rect key="frame" x="14" y="5" width="70" height="34"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="70" id="MSu-D8-6BO"/>
</constraints>
@ -64,13 +59,11 @@
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wWp-hU-I3e">
<rect key="frame" x="92" y="12" width="498" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<constraints>
<constraint firstItem="C3u-xz-sbM" firstAttribute="leading" secondItem="GMV-qL-pTv" secondAttribute="leading" constant="14" id="6j5-PX-P9O"/>
<constraint firstItem="C3u-xz-sbM" firstAttribute="centerY" secondItem="GMV-qL-pTv" secondAttribute="centerY" id="OU7-rr-jUL"/>
@ -80,7 +73,6 @@
<constraint firstAttribute="trailing" secondItem="wWp-hU-I3e" secondAttribute="trailing" constant="10" id="wlJ-Ga-0f7"/>
</constraints>
</tableViewCellContentView>
<animations/>
<connections>
<outlet property="button" destination="C3u-xz-sbM" id="7KC-FU-lBA"/>
<outlet property="contentLabel" destination="wWp-hU-I3e" id="uo4-ez-ea8"/>
@ -89,7 +81,6 @@
</prototypes>
</tableView>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ovi-uI-31e" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="J1O-uy-ywm"/>
@ -107,6 +98,35 @@
</objects>
<point key="canvasLocation" x="1185" y="-317"/>
</scene>
<!--Main View Controller-->
<scene sceneID="oP2-EZ-N5W">
<objects>
<tableViewController id="ZyD-Ww-nfe" customClass="MainViewController" customModule="TabletDemo" 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="xii-6e-J4f">
<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 clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="eQJ-7O-k03">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="eQJ-7O-k03" id="Ufi-z4-pLt">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="ZyD-Ww-nfe" id="dup-HU-FfF"/>
<outlet property="delegate" destination="ZyD-Ww-nfe" id="bRX-uu-KTX"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="6ba-xC-prc"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="uxV-eY-exN" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1190" y="531"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="2aE-PW-F7u">
<objects>
@ -115,7 +135,6 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" id="4L0-SI-HVz">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
@ -126,5 +145,23 @@
</objects>
<point key="canvasLocation" x="444" y="-317"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="Nb3-Yi-ik8">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="dOU-ON-YYD" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Ngx-L8-cbs">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="ZyD-Ww-nfe" kind="relationship" relationship="rootViewController" id="vRk-x4-ylh"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="1px-T5-UXL" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="444" y="531"/>
</scene>
</scenes>
</document>

View File

@ -11,32 +11,47 @@
508B71861BF48E0D00272920 /* TableRowBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508B71851BF48E0D00272920 /* TableRowBuilder.swift */; };
DA1BCD0F1BF5472C00CC0479 /* TableDirector.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA1BCD0E1BF5472C00CC0479 /* TableDirector.swift */; };
DA1BCD111BF7388C00CC0479 /* CustomTableActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA1BCD101BF7388C00CC0479 /* CustomTableActions.swift */; };
DAB7EB2B1BEF787300D2AD5E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAB7EB2A1BEF787300D2AD5E /* AppDelegate.swift */; };
DAB7EB2D1BEF787300D2AD5E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAB7EB2C1BEF787300D2AD5E /* ViewController.swift */; };
DAB7EB301BEF787300D2AD5E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAB7EB2E1BEF787300D2AD5E /* Main.storyboard */; };
DAB7EB321BEF787300D2AD5E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DAB7EB311BEF787300D2AD5E /* Assets.xcassets */; };
DAB7EB351BEF787300D2AD5E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAB7EB331BEF787300D2AD5E /* LaunchScreen.storyboard */; };
DAB7EB3E1BEF78A400D2AD5E /* Tablet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAB7EB3D1BEF78A400D2AD5E /* Tablet.swift */; };
DAB7EB401BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAB7EB3F1BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift */; };
DAC2D5CA1C9D303E009E9C19 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */; };
DAC2D5CF1C9D30A7009E9C19 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */; };
DAC2D5D01C9D30A7009E9C19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */; };
DAC2D5D41C9D3118009E9C19 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D5D31C9D3118009E9C19 /* MainViewController.swift */; };
DAC2D5E61C9D6493009E9C19 /* TabletTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D5D61C9D638F009E9C19 /* TabletTests.swift */; };
DAED08F11C14DE7E006C04D8 /* MyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAED08F01C14DE7E006C04D8 /* MyTableViewCell.swift */; };
DAF003961C14DC0C0028C3D6 /* MyNibTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAF003951C14DC0C0028C3D6 /* MyNibTableViewCell.swift */; };
DAF003981C14DC250028C3D6 /* MyNibTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DAF003971C14DC250028C3D6 /* MyNibTableViewCell.xib */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
DAC2D5E11C9D6433009E9C19 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DAB7EB1F1BEF787300D2AD5E /* Project object */;
proxyType = 1;
remoteGlobalIDString = DAB7EB261BEF787300D2AD5E;
remoteInfo = TabletDemo;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
508B71831BF48DD300272920 /* TableSectionBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableSectionBuilder.swift; sourceTree = "<group>"; };
508B71851BF48E0D00272920 /* TableRowBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableRowBuilder.swift; sourceTree = "<group>"; };
DA1BCD0E1BF5472C00CC0479 /* TableDirector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableDirector.swift; sourceTree = "<group>"; };
DA1BCD101BF7388C00CC0479 /* CustomTableActions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTableActions.swift; sourceTree = "<group>"; };
DAB7EB271BEF787300D2AD5E /* TabletDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TabletDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
DAB7EB2A1BEF787300D2AD5E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
DAB7EB2C1BEF787300D2AD5E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
DAB7EB2F1BEF787300D2AD5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
DAB7EB311BEF787300D2AD5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
DAB7EB341BEF787300D2AD5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
DAB7EB361BEF787300D2AD5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DAB7EB3D1BEF78A400D2AD5E /* Tablet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tablet.swift; sourceTree = "<group>"; };
DAB7EB3F1BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurableTableViewCell.swift; sourceTree = "<group>"; };
DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
DAC2D5D31C9D3118009E9C19 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
DAC2D5D61C9D638F009E9C19 /* TabletTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabletTests.swift; sourceTree = "<group>"; };
DAC2D5DC1C9D6433009E9C19 /* TabletTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TabletTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
DAED08F01C14DE7E006C04D8 /* MyTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyTableViewCell.swift; sourceTree = "<group>"; };
DAF003951C14DC0C0028C3D6 /* MyNibTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyNibTableViewCell.swift; sourceTree = "<group>"; };
DAF003971C14DC250028C3D6 /* MyNibTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyNibTableViewCell.xib; sourceTree = "<group>"; };
@ -50,6 +65,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D5D91C9D6433009E9C19 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@ -57,6 +79,9 @@
isa = PBXGroup;
children = (
DAB7EB3C1BEF789500D2AD5E /* Tablet */,
DAC2D5C61C9D2FE5009E9C19 /* Classes */,
DAC2D5CB1C9D3058009E9C19 /* Resources */,
DAC2D5D51C9D635F009E9C19 /* Tests */,
DAB7EB291BEF787300D2AD5E /* TabletDemo */,
DAB7EB281BEF787300D2AD5E /* Products */,
);
@ -66,6 +91,7 @@
isa = PBXGroup;
children = (
DAB7EB271BEF787300D2AD5E /* TabletDemo.app */,
DAC2D5DC1C9D6433009E9C19 /* TabletTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -73,16 +99,14 @@
DAB7EB291BEF787300D2AD5E /* TabletDemo */ = {
isa = PBXGroup;
children = (
DAB7EB2A1BEF787300D2AD5E /* AppDelegate.swift */,
DAC2D5C41C9D2F5C009E9C19 /* Presentation */,
DAB7EB2C1BEF787300D2AD5E /* ViewController.swift */,
DAB7EB3F1BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift */,
DA1BCD101BF7388C00CC0479 /* CustomTableActions.swift */,
DAF003951C14DC0C0028C3D6 /* MyNibTableViewCell.swift */,
DAF003971C14DC250028C3D6 /* MyNibTableViewCell.xib */,
DAED08F01C14DE7E006C04D8 /* MyTableViewCell.swift */,
DAB7EB2E1BEF787300D2AD5E /* Main.storyboard */,
DAB7EB311BEF787300D2AD5E /* Assets.xcassets */,
DAB7EB331BEF787300D2AD5E /* LaunchScreen.storyboard */,
DAB7EB361BEF787300D2AD5E /* Info.plist */,
);
path = TabletDemo;
@ -100,6 +124,80 @@
path = ../Tablet;
sourceTree = "<group>";
};
DAC2D5C41C9D2F5C009E9C19 /* Presentation */ = {
isa = PBXGroup;
children = (
);
name = Presentation;
sourceTree = "<group>";
};
DAC2D5C61C9D2FE5009E9C19 /* Classes */ = {
isa = PBXGroup;
children = (
DAC2D5C81C9D3014009E9C19 /* Application */,
DAC2D5C71C9D3005009E9C19 /* Presentation */,
);
path = Classes;
sourceTree = "<group>";
};
DAC2D5C71C9D3005009E9C19 /* Presentation */ = {
isa = PBXGroup;
children = (
DAC2D5D11C9D30D8009E9C19 /* Main */,
);
path = Presentation;
sourceTree = "<group>";
};
DAC2D5C81C9D3014009E9C19 /* Application */ = {
isa = PBXGroup;
children = (
DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */,
);
path = Application;
sourceTree = "<group>";
};
DAC2D5CB1C9D3058009E9C19 /* Resources */ = {
isa = PBXGroup;
children = (
DAC2D5CC1C9D306C009E9C19 /* Storyboards */,
);
path = Resources;
sourceTree = "<group>";
};
DAC2D5CC1C9D306C009E9C19 /* Storyboards */ = {
isa = PBXGroup;
children = (
DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */,
DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */,
);
path = Storyboards;
sourceTree = "<group>";
};
DAC2D5D11C9D30D8009E9C19 /* Main */ = {
isa = PBXGroup;
children = (
DAC2D5D21C9D30E4009E9C19 /* ViewControllers */,
);
path = Main;
sourceTree = "<group>";
};
DAC2D5D21C9D30E4009E9C19 /* ViewControllers */ = {
isa = PBXGroup;
children = (
DAC2D5D31C9D3118009E9C19 /* MainViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
DAC2D5D51C9D635F009E9C19 /* Tests */ = {
isa = PBXGroup;
children = (
DAC2D5D61C9D638F009E9C19 /* TabletTests.swift */,
);
name = Tests;
path = ../Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -120,12 +218,31 @@
productReference = DAB7EB271BEF787300D2AD5E /* TabletDemo.app */;
productType = "com.apple.product-type.application";
};
DAC2D5DB1C9D6433009E9C19 /* TabletTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = DAC2D5E31C9D6433009E9C19 /* Build configuration list for PBXNativeTarget "TabletTests" */;
buildPhases = (
DAC2D5D81C9D6433009E9C19 /* Sources */,
DAC2D5D91C9D6433009E9C19 /* Frameworks */,
DAC2D5DA1C9D6433009E9C19 /* Resources */,
);
buildRules = (
);
dependencies = (
DAC2D5E21C9D6433009E9C19 /* PBXTargetDependency */,
);
name = TabletTests;
productName = TabletTests;
productReference = DAC2D5DC1C9D6433009E9C19 /* TabletTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
DAB7EB1F1BEF787300D2AD5E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = Tablet;
TargetAttributes = {
@ -133,6 +250,10 @@
CreatedOnToolsVersion = 7.0.1;
DevelopmentTeam = Z48R734SJX;
};
DAC2D5DB1C9D6433009E9C19 = {
CreatedOnToolsVersion = 7.2;
TestTargetID = DAB7EB261BEF787300D2AD5E;
};
};
};
buildConfigurationList = DAB7EB221BEF787300D2AD5E /* Build configuration list for PBXProject "TabletDemo" */;
@ -149,6 +270,7 @@
projectRoot = "";
targets = (
DAB7EB261BEF787300D2AD5E /* TabletDemo */,
DAC2D5DB1C9D6433009E9C19 /* TabletTests */,
);
};
/* End PBXProject section */
@ -158,10 +280,17 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAB7EB351BEF787300D2AD5E /* LaunchScreen.storyboard in Resources */,
DAC2D5CF1C9D30A7009E9C19 /* Main.storyboard in Resources */,
DAC2D5D01C9D30A7009E9C19 /* LaunchScreen.storyboard in Resources */,
DAF003981C14DC250028C3D6 /* MyNibTableViewCell.xib in Resources */,
DAB7EB321BEF787300D2AD5E /* Assets.xcassets in Resources */,
DAB7EB301BEF787300D2AD5E /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D5DA1C9D6433009E9C19 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -173,6 +302,7 @@
buildActionMask = 2147483647;
files = (
508B71841BF48DD300272920 /* TableSectionBuilder.swift in Sources */,
DAC2D5D41C9D3118009E9C19 /* MainViewController.swift in Sources */,
DAB7EB2D1BEF787300D2AD5E /* ViewController.swift in Sources */,
DAB7EB3E1BEF78A400D2AD5E /* Tablet.swift in Sources */,
DAED08F11C14DE7E006C04D8 /* MyTableViewCell.swift in Sources */,
@ -180,31 +310,28 @@
508B71861BF48E0D00272920 /* TableRowBuilder.swift in Sources */,
DA1BCD0F1BF5472C00CC0479 /* TableDirector.swift in Sources */,
DAB7EB401BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift in Sources */,
DAB7EB2B1BEF787300D2AD5E /* AppDelegate.swift in Sources */,
DAC2D5CA1C9D303E009E9C19 /* AppDelegate.swift in Sources */,
DA1BCD111BF7388C00CC0479 /* CustomTableActions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DAC2D5D81C9D6433009E9C19 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAC2D5E61C9D6493009E9C19 /* TabletTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
DAB7EB2E1BEF787300D2AD5E /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
DAB7EB2F1BEF787300D2AD5E /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
/* Begin PBXTargetDependency section */
DAC2D5E21C9D6433009E9C19 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DAB7EB261BEF787300D2AD5E /* TabletDemo */;
targetProxy = DAC2D5E11C9D6433009E9C19 /* PBXContainerItemProxy */;
};
DAB7EB331BEF787300D2AD5E /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
DAB7EB341BEF787300D2AD5E /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
DAB7EB371BEF787300D2AD5E /* Debug */ = {
@ -297,7 +424,7 @@
INFOPLIST_FILE = TabletDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.TabletDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
@ -312,12 +439,38 @@
INFOPLIST_FILE = TabletDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.TabletDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.tablet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Release;
};
DAC2D5E41C9D6433009E9C19 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = TabletTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.TabletTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TabletDemo.app/TabletDemo";
};
name = Debug;
};
DAC2D5E51C9D6433009E9C19 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = TabletTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tablet.TabletTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TabletDemo.app/TabletDemo";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@ -339,6 +492,14 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DAC2D5E31C9D6433009E9C19 /* Build configuration list for PBXNativeTarget "TabletTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DAC2D5E41C9D6433009E9C19 /* Debug */,
DAC2D5E51C9D6433009E9C19 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = DAB7EB1F1BEF787300D2AD5E /* Project object */;

View File

@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAC2D5DB1C9D6433009E9C19"
BuildableName = "TabletTests.xctest"
BlueprintName = "TabletTests"
ReferencedContainer = "container:TabletDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference

View File

@ -17,6 +17,11 @@
<key>primary</key>
<true/>
</dict>
<key>DAC2D5DB1C9D6433009E9C19</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -28,6 +28,7 @@ class ConfigurableTableViewCell: UITableViewCell, ConfigurableCell {
func configureWithItem(item: Item) {
accessoryType = .DisclosureIndicator
button.setTitle("Button \(item)", forState: .Normal)
}

View File

@ -35,7 +35,7 @@ class ViewController: UIViewController, UIScrollViewDelegate {
print("end display: \(data.indexPath)")
}
let configurableRowBuilder = TableConfigurableRowBuilder<String, ConfigurableTableViewCell>(items: ["5", "6", "7", "8"])
.action(.click) { data -> Void in

24
Tests/Info.plist Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

47
Tests/TabletTests.swift Normal file
View File

@ -0,0 +1,47 @@
//
// TableDirectorTests.swift
// TabletDemo
//
// Created by Max Sokolov on 19/03/16.
// Copyright © 2016 Tablet. All rights reserved.
//
import XCTest
import Tablet
class TestController : UITableViewController {
var tableDirector: TableDirector!
override func viewDidLoad() {
super.viewDidLoad()
tableDirector = TableDirector(tableView: tableView)
}
}
class TabletTests: XCTestCase {
var testController: TestController!
override func setUp() {
super.setUp()
testController = TestController()
}
override func tearDown() {
testController = nil
super.tearDown()
}
func testTableDirectorHasTableView() {
testController.view.hidden = false
XCTAssertNotNil(testController.tableView)
XCTAssertNotNil(testController.tableDirector)
XCTAssertNotNil(testController.tableDirector.tableView)
}
}