From ce76b5629cc588e35f8987242c46ab49595321bb Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Wed, 24 Jun 2015 23:00:16 -0700 Subject: [PATCH] Added a category for NSIndexPath and a framework for watchOS 2 --- .../IGInterfaceDataTable watchOS.h | 9 ++ IGInterfaceDataTable watchOS/Info.plist | 26 ++++ IGInterfaceDataTable watchOS/module.modulemap | 6 + IGInterfaceDataTable.podspec | 1 + .../project.pbxproj | 145 +++++++++++++++++- .../IGInterfaceDataTable watchOS.xcscheme | 80 ++++++++++ .../xcschemes/IGInterfaceDataTable.xcscheme | 5 +- IGInterfaceDataTable/IGInterfaceDataTable.h | 1 + IGInterfaceDataTable/Info.plist | 2 +- .../NSIndexPath+WatchOSIndexPath.h | 18 +++ .../NSIndexPath+WatchOSIndexPath.m | 26 ++++ .../WKInterfaceTable+IGInterfaceDataTable.h | 2 +- .../WKInterfaceTable+IGInterfaceDataTable.m | 4 +- 13 files changed, 319 insertions(+), 6 deletions(-) create mode 100644 IGInterfaceDataTable watchOS/IGInterfaceDataTable watchOS.h create mode 100644 IGInterfaceDataTable watchOS/Info.plist create mode 100644 IGInterfaceDataTable watchOS/module.modulemap create mode 100644 IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable watchOS.xcscheme create mode 100644 IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.h create mode 100644 IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.m diff --git a/IGInterfaceDataTable watchOS/IGInterfaceDataTable watchOS.h b/IGInterfaceDataTable watchOS/IGInterfaceDataTable watchOS.h new file mode 100644 index 0000000..1ac75d4 --- /dev/null +++ b/IGInterfaceDataTable watchOS/IGInterfaceDataTable watchOS.h @@ -0,0 +1,9 @@ +// +// IGInterfaceDataTable watchOS.h +// IGInterfaceDataTable watchOS +// +// Created by Daniel Brooks on 6/24/15. +// Copyright © 2015 Facebook. All rights reserved. +// + +#import diff --git a/IGInterfaceDataTable watchOS/Info.plist b/IGInterfaceDataTable watchOS/Info.plist new file mode 100644 index 0000000..d3de8ee --- /dev/null +++ b/IGInterfaceDataTable watchOS/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/IGInterfaceDataTable watchOS/module.modulemap b/IGInterfaceDataTable watchOS/module.modulemap new file mode 100644 index 0000000..ba79a02 --- /dev/null +++ b/IGInterfaceDataTable watchOS/module.modulemap @@ -0,0 +1,6 @@ +framework module IGInterfaceDataTable { + umbrella header "IGInterfaceDataTable watchOS.h" + + export * + module * { export * } +} diff --git a/IGInterfaceDataTable.podspec b/IGInterfaceDataTable.podspec index f9e46c7..626c2e5 100644 --- a/IGInterfaceDataTable.podspec +++ b/IGInterfaceDataTable.podspec @@ -20,4 +20,5 @@ Pod::Spec.new do |spec| spec.social_media_url = 'https://twitter.com/fbOpenSource' spec.ios.deployment_target = '8.2' + spec.watchos.deployment_target = '2.0' end diff --git a/IGInterfaceDataTable.xcodeproj/project.pbxproj b/IGInterfaceDataTable.xcodeproj/project.pbxproj index 193f7a6..1537fe4 100644 --- a/IGInterfaceDataTable.xcodeproj/project.pbxproj +++ b/IGInterfaceDataTable.xcodeproj/project.pbxproj @@ -10,6 +10,13 @@ 29BE4EC71A97A59F0025C38E /* IGInterfaceDataTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 29BE4EC61A97A59F0025C38E /* IGInterfaceDataTable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29BE4EE61A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 29BE4EE41A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29BE4EE71A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE4EE51A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m */; }; + 6595295E1B3BC97000AED25B /* IGInterfaceDataTable watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 6595295D1B3BC97000AED25B /* IGInterfaceDataTable watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 659529631B3BC97F00AED25B /* WKInterfaceTable+IGInterfaceDataTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 29BE4EE41A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 659529641B3BC99100AED25B /* WKInterfaceTable+IGInterfaceDataTable.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE4EE51A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m */; }; + 659529671B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 659529651B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 659529681B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 659529661B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m */; }; + 6595296B1B3BD0E100AED25B /* NSIndexPath+WatchOSIndexPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 659529661B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m */; }; + 6595296C1B3BD0EC00AED25B /* NSIndexPath+WatchOSIndexPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 659529651B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -18,6 +25,12 @@ 29BE4EC61A97A59F0025C38E /* IGInterfaceDataTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IGInterfaceDataTable.h; sourceTree = ""; }; 29BE4EE41A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKInterfaceTable+IGInterfaceDataTable.h"; sourceTree = ""; }; 29BE4EE51A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKInterfaceTable+IGInterfaceDataTable.m"; sourceTree = ""; }; + 6595295B1B3BC97000AED25B /* IGInterfaceDataTable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IGInterfaceDataTable.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6595295D1B3BC97000AED25B /* IGInterfaceDataTable watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IGInterfaceDataTable watchOS.h"; sourceTree = ""; }; + 6595295F1B3BC97000AED25B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 659529651B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSIndexPath+WatchOSIndexPath.h"; sourceTree = ""; }; + 659529661B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSIndexPath+WatchOSIndexPath.m"; sourceTree = ""; }; + 6595296A1B3BCFC900AED25B /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -28,6 +41,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 659529571B3BC97000AED25B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -35,6 +55,7 @@ isa = PBXGroup; children = ( 29BE4EC31A97A59F0025C38E /* IGInterfaceDataTable */, + 6595295C1B3BC97000AED25B /* IGInterfaceDataTable watchOS */, 29BE4EC21A97A59F0025C38E /* Products */, ); sourceTree = ""; @@ -43,6 +64,7 @@ isa = PBXGroup; children = ( 29BE4EC11A97A59F0025C38E /* IGInterfaceDataTable.framework */, + 6595295B1B3BC97000AED25B /* IGInterfaceDataTable.framework */, ); name = Products; sourceTree = ""; @@ -54,6 +76,8 @@ 29BE4EC41A97A59F0025C38E /* Supporting Files */, 29BE4EE41A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h */, 29BE4EE51A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m */, + 659529651B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h */, + 659529661B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m */, ); path = IGInterfaceDataTable; sourceTree = ""; @@ -66,6 +90,16 @@ name = "Supporting Files"; sourceTree = ""; }; + 6595295C1B3BC97000AED25B /* IGInterfaceDataTable watchOS */ = { + isa = PBXGroup; + children = ( + 6595295D1B3BC97000AED25B /* IGInterfaceDataTable watchOS.h */, + 6595295F1B3BC97000AED25B /* Info.plist */, + 6595296A1B3BCFC900AED25B /* module.modulemap */, + ); + path = "IGInterfaceDataTable watchOS"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -73,8 +107,19 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 29BE4EE61A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h in Headers */, 29BE4EC71A97A59F0025C38E /* IGInterfaceDataTable.h in Headers */, + 29BE4EE61A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.h in Headers */, + 659529671B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 659529581B3BC97000AED25B /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6595295E1B3BC97000AED25B /* IGInterfaceDataTable watchOS.h in Headers */, + 659529631B3BC97F00AED25B /* WKInterfaceTable+IGInterfaceDataTable.h in Headers */, + 6595296C1B3BD0EC00AED25B /* NSIndexPath+WatchOSIndexPath.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,18 +144,39 @@ productReference = 29BE4EC11A97A59F0025C38E /* IGInterfaceDataTable.framework */; productType = "com.apple.product-type.framework"; }; + 6595295A1B3BC97000AED25B /* IGInterfaceDataTable watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 659529621B3BC97000AED25B /* Build configuration list for PBXNativeTarget "IGInterfaceDataTable watchOS" */; + buildPhases = ( + 659529561B3BC97000AED25B /* Sources */, + 659529571B3BC97000AED25B /* Frameworks */, + 659529581B3BC97000AED25B /* Headers */, + 659529591B3BC97000AED25B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "IGInterfaceDataTable watchOS"; + productName = "IGInterfaceDataTable watchOS"; + productReference = 6595295B1B3BC97000AED25B /* IGInterfaceDataTable.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29BE4EB81A97A59F0025C38E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0620; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = Facebook; TargetAttributes = { 29BE4EC01A97A59F0025C38E = { CreatedOnToolsVersion = 6.2; }; + 6595295A1B3BC97000AED25B = { + CreatedOnToolsVersion = 7.0; + }; }; }; buildConfigurationList = 29BE4EBB1A97A59F0025C38E /* Build configuration list for PBXProject "IGInterfaceDataTable" */; @@ -127,6 +193,7 @@ projectRoot = ""; targets = ( 29BE4EC01A97A59F0025C38E /* IGInterfaceDataTable */, + 6595295A1B3BC97000AED25B /* IGInterfaceDataTable watchOS */, ); }; /* End PBXProject section */ @@ -139,6 +206,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 659529591B3BC97000AED25B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -146,10 +220,20 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 659529681B3BCD1200AED25B /* NSIndexPath+WatchOSIndexPath.m in Sources */, 29BE4EE71A984D0A0025C38E /* WKInterfaceTable+IGInterfaceDataTable.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; + 659529561B3BC97000AED25B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6595296B1B3BD0E100AED25B /* NSIndexPath+WatchOSIndexPath.m in Sources */, + 659529641B3BC99100AED25B /* WKInterfaceTable+IGInterfaceDataTable.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -174,6 +258,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -248,6 +333,7 @@ INFOPLIST_FILE = IGInterfaceDataTable/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -264,11 +350,57 @@ INFOPLIST_FILE = IGInterfaceDataTable/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; name = Release; }; + 659529601B3BC97000AED25B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "IGInterfaceDataTable watchOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "${SRCROOT}/IGInterfaceDataTable watchOS/module.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.IGInterfaceDataTable-watchOS"; + PRODUCT_NAME = IGInterfaceDataTable; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 659529611B3BC97000AED25B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "IGInterfaceDataTable watchOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "${SRCROOT}/IGInterfaceDataTable watchOS/module.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.IGInterfaceDataTable-watchOS"; + PRODUCT_NAME = IGInterfaceDataTable; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -290,6 +422,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 659529621B3BC97000AED25B /* Build configuration list for PBXNativeTarget "IGInterfaceDataTable watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 659529601B3BC97000AED25B /* Debug */, + 659529611B3BC97000AED25B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 29BE4EB81A97A59F0025C38E /* Project object */; diff --git a/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable watchOS.xcscheme b/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable watchOS.xcscheme new file mode 100644 index 0000000..d957835 --- /dev/null +++ b/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable watchOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable.xcscheme b/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable.xcscheme index 502f6c5..fef889d 100644 --- a/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable.xcscheme +++ b/IGInterfaceDataTable.xcodeproj/xcshareddata/xcschemes/IGInterfaceDataTable.xcscheme @@ -1,6 +1,6 @@ + + +#import diff --git a/IGInterfaceDataTable/Info.plist b/IGInterfaceDataTable/Info.plist index 63f8161..d3de8ee 100644 --- a/IGInterfaceDataTable/Info.plist +++ b/IGInterfaceDataTable/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.facebook.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.h b/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.h new file mode 100644 index 0000000..c3c2b52 --- /dev/null +++ b/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.h @@ -0,0 +1,18 @@ +// +// NSIndexPath+WatchOSIndexPath.h +// IGInterfaceDataTable +// +// Created by Daniel Brooks on 6/24/15. +// Copyright © 2015 Facebook. All rights reserved. +// + +#import + +@interface NSIndexPath (WatchOSIndexPath) + +@property(nonatomic, readonly) NSInteger row; +@property(nonatomic, readonly) NSInteger section; + ++ (NSIndexPath*) indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section; + +@end diff --git a/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.m b/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.m new file mode 100644 index 0000000..d3151e8 --- /dev/null +++ b/IGInterfaceDataTable/NSIndexPath+WatchOSIndexPath.m @@ -0,0 +1,26 @@ +// +// NSIndexPath+WatchOSIndexPath.m +// IGInterfaceDataTable +// +// Created by Daniel Brooks on 6/24/15. +// Copyright © 2015 Facebook. All rights reserved. +// + +#import "NSIndexPath+WatchOSIndexPath.h" + +@implementation NSIndexPath (WatchOSIndexPath) + ++ (NSIndexPath*) indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section { + NSUInteger indexes[] = {section, row}; + return [NSIndexPath indexPathWithIndexes:indexes length:2]; +} + +- (NSInteger) row { + return [self indexAtPosition:1]; +} + +- (NSInteger) section { + return [self indexAtPosition:0]; +} + +@end diff --git a/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.h b/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.h index c2ae1d4..1af6031 100644 --- a/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.h +++ b/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.h @@ -10,7 +10,7 @@ #import #import - +#import "NSIndexPath+WatchOSIndexPath.h" @protocol IGInterfaceTableDataSource diff --git a/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.m b/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.m index 6be15d6..d99dc1a 100644 --- a/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.m +++ b/IGInterfaceDataTable/WKInterfaceTable+IGInterfaceDataTable.m @@ -9,7 +9,7 @@ */ #import "WKInterfaceTable+IGInterfaceDataTable.h" - +#import "NSIndexPath+WatchOSIndexPath.h" #import @@ -375,6 +375,8 @@ - (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowType:(NSString *)row [rowIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { NSObject *controller = [self rowControllerAtIndex:idx]; IGTableRowData *rowData = rowSectionData[idx]; + + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:rowData.row inSection:rowData.section]; [self.ig_dataSource table:self configureRowController:controller forIndexPath:indexPath]; }];