diff --git a/Tablet.xcworkspace/contents.xcworkspacedata b/Tablet.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..94b2795 --- /dev/null +++ b/Tablet.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,4 @@ + + + diff --git a/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..145551c Binary files /dev/null and b/Tablet.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Tablet/Info.plist b/Tablet/Info.plist new file mode 100644 index 0000000..d3de8ee --- /dev/null +++ b/Tablet/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 74bd1f2..d681cda 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -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) { diff --git a/Tablet/TableRowBuilder.swift b/Tablet/TableRowBuilder.swift index fcf8b8c..970989e 100644 --- a/Tablet/TableRowBuilder.swift +++ b/Tablet/TableRowBuilder.swift @@ -23,7 +23,7 @@ import Foundation public typealias ReturnValue = AnyObject? -internal enum ActionHandler { +enum ActionHandler { case actionBlock((data: ActionData) -> Void) case actionReturnBlock((data: ActionData) -> AnyObject?) diff --git a/Tablet/Tablet.h b/Tablet/Tablet.h new file mode 100644 index 0000000..a1d2602 --- /dev/null +++ b/Tablet/Tablet.h @@ -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[]; \ No newline at end of file diff --git a/Tablet/Tablet.swift b/Tablet/Tablet.swift index a4ceb60..0e71508 100644 --- a/Tablet/Tablet.swift +++ b/Tablet/Tablet.swift @@ -21,7 +21,7 @@ import UIKit import Foundation -internal struct TabletNotifications { +struct TabletNotifications { static let CellAction = "_cellaction" } diff --git a/Tablet/Tablet.xcodeproj/project.pbxproj b/Tablet/Tablet.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f178aa9 --- /dev/null +++ b/Tablet/Tablet.xcodeproj/project.pbxproj @@ -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 = ""; }; + DAC2D6851C9D7517009E9C19 /* Tablet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tablet.h; sourceTree = ""; }; + DAC2D68C1C9D799E009E9C19 /* TableDirector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableDirector.swift; sourceTree = ""; }; + DAC2D68D1C9D799E009E9C19 /* TableRowBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableRowBuilder.swift; sourceTree = ""; }; + DAC2D68E1C9D799E009E9C19 /* TableSectionBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableSectionBuilder.swift; sourceTree = ""; }; + DAC2D68F1C9D799E009E9C19 /* Tablet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tablet.swift; sourceTree = ""; }; + DAC2D6951C9D7A3B009E9C19 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DAC2D6961C9D7A3B009E9C19 /* TabletTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabletTests.swift; sourceTree = ""; }; +/* 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 = ""; + }; + DAC2D66A1C9D743D009E9C19 /* Products */ = { + isa = PBXGroup; + children = ( + DAC2D6691C9D743D009E9C19 /* Tablet.framework */, + DAC2D6731C9D743D009E9C19 /* TabletTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + DAC2D6831C9D74EE009E9C19 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + DAC2D6841C9D7517009E9C19 /* Info.plist */, + DAC2D6851C9D7517009E9C19 /* Tablet.h */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + DAC2D68B1C9D7990009E9C19 /* Classes */ = { + isa = PBXGroup; + children = ( + DAC2D68F1C9D799E009E9C19 /* Tablet.swift */, + DAC2D68C1C9D799E009E9C19 /* TableDirector.swift */, + DAC2D68D1C9D799E009E9C19 /* TableRowBuilder.swift */, + DAC2D68E1C9D799E009E9C19 /* TableSectionBuilder.swift */, + ); + name = Classes; + sourceTree = ""; + }; + DAC2D6941C9D7A03009E9C19 /* Tests */ = { + isa = PBXGroup; + children = ( + DAC2D6951C9D7A3B009E9C19 /* Info.plist */, + DAC2D6961C9D7A3B009E9C19 /* TabletTests.swift */, + ); + name = Tests; + path = ../Tests; + sourceTree = ""; + }; +/* 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 */; +} diff --git a/Tablet/Tablet.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Tablet/Tablet.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..78fd6b2 --- /dev/null +++ b/Tablet/Tablet.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a996426 Binary files /dev/null and b/Tablet/Tablet.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/Tablet.xcscheme b/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/Tablet.xcscheme new file mode 100644 index 0000000..b6e3630 --- /dev/null +++ b/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/Tablet.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/xcschememanagement.plist b/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..942caa5 --- /dev/null +++ b/Tablet/Tablet.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Tablet.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + DAC2D6681C9D743D009E9C19 + + primary + + + DAC2D6721C9D743D009E9C19 + + primary + + + + + diff --git a/TabletDemo/TabletDemo/AppDelegate.swift b/TabletDemo/Classes/Application/AppDelegate.swift similarity index 100% rename from TabletDemo/TabletDemo/AppDelegate.swift rename to TabletDemo/Classes/Application/AppDelegate.swift diff --git a/TabletDemo/Classes/Presentation/Main/ViewControllers/MainViewController.swift b/TabletDemo/Classes/Presentation/Main/ViewControllers/MainViewController.swift new file mode 100644 index 0000000..6677dd7 --- /dev/null +++ b/TabletDemo/Classes/Presentation/Main/ViewControllers/MainViewController.swift @@ -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(items: [1, 2, 3, 4], id: "cell") + .action(.configure) { data -> Void in + + data.cell?.accessoryType = .DisclosureIndicator + data.cell?.textLabel?.text = "\(data.item)" + } + } +} \ No newline at end of file diff --git a/TabletDemo/TabletDemo/Base.lproj/LaunchScreen.storyboard b/TabletDemo/Resources/Storyboards/LaunchScreen.storyboard similarity index 100% rename from TabletDemo/TabletDemo/Base.lproj/LaunchScreen.storyboard rename to TabletDemo/Resources/Storyboards/LaunchScreen.storyboard diff --git a/TabletDemo/TabletDemo/Base.lproj/Main.storyboard b/TabletDemo/Resources/Storyboards/Main.storyboard similarity index 75% rename from TabletDemo/TabletDemo/Base.lproj/Main.storyboard rename to TabletDemo/Resources/Storyboards/Main.storyboard index 65ef436..d299801 100644 --- a/TabletDemo/TabletDemo/Base.lproj/Main.storyboard +++ b/TabletDemo/Resources/Storyboards/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -19,7 +19,6 @@ - @@ -32,15 +31,12 @@ - - @@ -51,7 +47,6 @@ - @@ -80,7 +73,6 @@ - @@ -89,7 +81,6 @@ - @@ -107,6 +98,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,7 +135,6 @@ - @@ -126,5 +145,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/TabletDemo/TabletDemo.xcodeproj/project.pbxproj b/TabletDemo/TabletDemo.xcodeproj/project.pbxproj index c043d8b..4d8e6af 100644 --- a/TabletDemo/TabletDemo.xcodeproj/project.pbxproj +++ b/TabletDemo/TabletDemo.xcodeproj/project.pbxproj @@ -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 = ""; }; 508B71851BF48E0D00272920 /* TableRowBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableRowBuilder.swift; sourceTree = ""; }; DA1BCD0E1BF5472C00CC0479 /* TableDirector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableDirector.swift; sourceTree = ""; }; DA1BCD101BF7388C00CC0479 /* CustomTableActions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTableActions.swift; sourceTree = ""; }; 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 = ""; }; DAB7EB2C1BEF787300D2AD5E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - DAB7EB2F1BEF787300D2AD5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; DAB7EB311BEF787300D2AD5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - DAB7EB341BEF787300D2AD5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; DAB7EB361BEF787300D2AD5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DAB7EB3D1BEF78A400D2AD5E /* Tablet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tablet.swift; sourceTree = ""; }; DAB7EB3F1BEFD07E00D2AD5E /* ConfigurableTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurableTableViewCell.swift; sourceTree = ""; }; + DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; + DAC2D5D31C9D3118009E9C19 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; + DAC2D5D61C9D638F009E9C19 /* TabletTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabletTests.swift; sourceTree = ""; }; + 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 = ""; }; DAF003951C14DC0C0028C3D6 /* MyNibTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyNibTableViewCell.swift; sourceTree = ""; }; DAF003971C14DC250028C3D6 /* MyNibTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyNibTableViewCell.xib; sourceTree = ""; }; @@ -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 = ""; @@ -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 = ""; }; + DAC2D5C41C9D2F5C009E9C19 /* Presentation */ = { + isa = PBXGroup; + children = ( + ); + name = Presentation; + sourceTree = ""; + }; + DAC2D5C61C9D2FE5009E9C19 /* Classes */ = { + isa = PBXGroup; + children = ( + DAC2D5C81C9D3014009E9C19 /* Application */, + DAC2D5C71C9D3005009E9C19 /* Presentation */, + ); + path = Classes; + sourceTree = ""; + }; + DAC2D5C71C9D3005009E9C19 /* Presentation */ = { + isa = PBXGroup; + children = ( + DAC2D5D11C9D30D8009E9C19 /* Main */, + ); + path = Presentation; + sourceTree = ""; + }; + DAC2D5C81C9D3014009E9C19 /* Application */ = { + isa = PBXGroup; + children = ( + DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */, + ); + path = Application; + sourceTree = ""; + }; + DAC2D5CB1C9D3058009E9C19 /* Resources */ = { + isa = PBXGroup; + children = ( + DAC2D5CC1C9D306C009E9C19 /* Storyboards */, + ); + path = Resources; + sourceTree = ""; + }; + DAC2D5CC1C9D306C009E9C19 /* Storyboards */ = { + isa = PBXGroup; + children = ( + DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */, + DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + DAC2D5D11C9D30D8009E9C19 /* Main */ = { + isa = PBXGroup; + children = ( + DAC2D5D21C9D30E4009E9C19 /* ViewControllers */, + ); + path = Main; + sourceTree = ""; + }; + DAC2D5D21C9D30E4009E9C19 /* ViewControllers */ = { + isa = PBXGroup; + children = ( + DAC2D5D31C9D3118009E9C19 /* MainViewController.swift */, + ); + path = ViewControllers; + sourceTree = ""; + }; + DAC2D5D51C9D635F009E9C19 /* Tests */ = { + isa = PBXGroup; + children = ( + DAC2D5D61C9D638F009E9C19 /* TabletTests.swift */, + ); + name = Tests; + path = ../Tests; + sourceTree = ""; + }; /* 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 = ""; +/* 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 = ""; - }; -/* 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 */; diff --git a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate index 9bdfdde..c254aa2 100644 Binary files a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate and b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TabletDemo/TabletDemo.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/TabletDemo.xcscheme b/TabletDemo/TabletDemo.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/TabletDemo.xcscheme index 6db4123..5b59ce8 100644 --- a/TabletDemo/TabletDemo.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/TabletDemo.xcscheme +++ b/TabletDemo/TabletDemo.xcodeproj/xcuserdata/maxsokolov.xcuserdatad/xcschemes/TabletDemo.xcscheme @@ -28,6 +28,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + primary + DAC2D5DB1C9D6433009E9C19 + + primary + + diff --git a/TabletDemo/TabletDemo/ConfigurableTableViewCell.swift b/TabletDemo/TabletDemo/ConfigurableTableViewCell.swift index 3160b73..4887c0e 100644 --- a/TabletDemo/TabletDemo/ConfigurableTableViewCell.swift +++ b/TabletDemo/TabletDemo/ConfigurableTableViewCell.swift @@ -28,6 +28,7 @@ class ConfigurableTableViewCell: UITableViewCell, ConfigurableCell { func configureWithItem(item: Item) { + accessoryType = .DisclosureIndicator button.setTitle("Button \(item)", forState: .Normal) } diff --git a/TabletDemo/TabletDemo/ViewController.swift b/TabletDemo/TabletDemo/ViewController.swift index 805aad2..388260c 100644 --- a/TabletDemo/TabletDemo/ViewController.swift +++ b/TabletDemo/TabletDemo/ViewController.swift @@ -35,7 +35,7 @@ class ViewController: UIViewController, UIScrollViewDelegate { print("end display: \(data.indexPath)") } - + let configurableRowBuilder = TableConfigurableRowBuilder(items: ["5", "6", "7", "8"]) .action(.click) { data -> Void in diff --git a/Tests/Info.plist b/Tests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/Tests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Tests/TabletTests.swift b/Tests/TabletTests.swift new file mode 100644 index 0000000..30c6f5c --- /dev/null +++ b/Tests/TabletTests.swift @@ -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) + } +} \ No newline at end of file