diff --git a/.gitignore b/.gitignore
index 31e6fd9..f300d1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,6 @@ profile
DerivedData
.idea/
*.hmap
+
+# Swift Package Manager
+.build
\ No newline at end of file
diff --git a/Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
similarity index 65%
rename from Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
index 347e8f4..919434a 100644
--- a/Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/Package.swift b/Package.swift
new file mode 100644
index 0000000..2ba5e9a
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,20 @@
+// swift-tools-version:5.5
+import PackageDescription
+
+let package = Package(
+ name: "BDKCollectionIndexView",
+ platforms: [
+ .iOS(.v8)
+ ],
+ products: [
+ .library(name: "BDKCollectionIndexView",
+ targets: ["BDKCollectionIndexView"])
+ ],
+ targets: [
+ .target(
+ name: "BDKCollectionIndexView",
+ path: "Sources/BDKCollectionIndexView",
+ publicHeadersPath: "."
+ )
+ ]
+)
diff --git a/Project/BDKAppDelegate.h b/Project/BDKAppDelegate.h
deleted file mode 100644
index 2545dbc..0000000
--- a/Project/BDKAppDelegate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// BDKAppDelegate.h
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import
-
-@interface BDKAppDelegate : UIResponder
-
-@property (strong, nonatomic) UIWindow *window;
-
-@end
diff --git a/Project/BDKAppDelegate.m b/Project/BDKAppDelegate.m
deleted file mode 100644
index d49bf51..0000000
--- a/Project/BDKAppDelegate.m
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// BDKAppDelegate.m
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import "BDKAppDelegate.h"
-
-#import "BDKViewController.h"
-
-@implementation BDKAppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
- self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
- // Override point for customization after application launch.
- self.window.backgroundColor = [UIColor whiteColor];
- BDKViewController *vc = [BDKViewController new];
- vc.title = @"BDKCollectionIndexView Example";
- UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
- self.window.rootViewController = nav;
- [self.window makeKeyAndVisible];
- return YES;
-}
-
-- (void)applicationWillResignActive:(UIApplication *)application
-{
- // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
- // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
- // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
- // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
- // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
- // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
- // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
-@end
diff --git a/Project/BDKCell.h b/Project/BDKCell.h
deleted file mode 100644
index 3f8e977..0000000
--- a/Project/BDKCell.h
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// BDKCell.h
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import
-
-extern NSString * const BDKCellID;
-
-@interface BDKCell : UICollectionViewCell
-
-@property (readonly) UILabel *label;
-
-@end
diff --git a/Project/BDKCell.m b/Project/BDKCell.m
deleted file mode 100644
index 7a48d70..0000000
--- a/Project/BDKCell.m
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// BDKCell.m
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import "BDKCell.h"
-
-NSString * const BDKCellID = @"BDKCell";
-
-@interface BDKCell ()
-
-- (void)setup;
-
-@end
-
-@implementation BDKCell
-
-@synthesize label = _label;
-
-- (instancetype)init {
- self = [super init];
- if (!self) return nil;
- [self setup];
- return self;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
- self = [super initWithCoder:aDecoder];
- if (!self) return nil;
- [self setup];
- return self;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (!self) return nil;
- [self setup];
- return self;
-}
-
-- (void)setup {
- [self.contentView addSubview:self.label];
- self.label.frame = self.contentView.bounds;
- self.layer.borderColor = [[UIColor blackColor] CGColor];
- self.layer.borderWidth = 1;
-}
-
-- (void)prepareForReuse {
- [super prepareForReuse];
- self.label.text = nil;
-}
-
-#pragma mark - Properties
-
-- (UILabel *)label {
- if (_label) return _label;
- _label = [UILabel new];
- _label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- _label.font = [UIFont boldSystemFontOfSize:64];
- _label.textAlignment = NSTextAlignmentCenter;
- return _label;
-}
-
-@end
diff --git a/Project/BDKCollectionIndexView.xcodeproj/project.pbxproj b/Project/BDKCollectionIndexView.xcodeproj/project.pbxproj
deleted file mode 100644
index 7976d26..0000000
--- a/Project/BDKCollectionIndexView.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,345 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1548B4E31AD826D000B17B7A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1548B4E21AD826D000B17B7A /* Images.xcassets */; };
- C368DD731816BE1C002F428D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C368DD721816BE1C002F428D /* Foundation.framework */; };
- C368DD751816BE1C002F428D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C368DD741816BE1C002F428D /* CoreGraphics.framework */; };
- C368DD771816BE1C002F428D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C368DD761816BE1C002F428D /* UIKit.framework */; };
- C393E05E1816BE5B001D7837 /* BDKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C393E0571816BE5B001D7837 /* BDKAppDelegate.m */; };
- C393E05F1816BE5B001D7837 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C393E0591816BE5B001D7837 /* InfoPlist.strings */; };
- C393E0611816BE5B001D7837 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C393E05C1816BE5B001D7837 /* main.m */; };
- C393E0651816BE6C001D7837 /* BDKCollectionIndexView.m in Sources */ = {isa = PBXBuildFile; fileRef = C393E0641816BE6C001D7837 /* BDKCollectionIndexView.m */; };
- C393E06A1816C060001D7837 /* BDKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C393E0691816C060001D7837 /* BDKViewController.m */; };
- C393E06D1816C33D001D7837 /* BDKCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C393E06C1816C33D001D7837 /* BDKCell.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 1548B4E21AD826D000B17B7A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BDKCollectionIndexView/Images.xcassets; sourceTree = ""; };
- C368DD6F1816BE1C002F428D /* BDKCollectionIndexView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BDKCollectionIndexView.app; sourceTree = BUILT_PRODUCTS_DIR; };
- C368DD721816BE1C002F428D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- C368DD741816BE1C002F428D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- C368DD761816BE1C002F428D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
- C368DD8B1816BE1C002F428D /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
- C393E0561816BE5B001D7837 /* BDKAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKAppDelegate.h; sourceTree = ""; };
- C393E0571816BE5B001D7837 /* BDKAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKAppDelegate.m; sourceTree = ""; };
- C393E05A1816BE5B001D7837 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; };
- C393E05B1816BE5B001D7837 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- C393E05C1816BE5B001D7837 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
- C393E05D1816BE5B001D7837 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; };
- C393E0631816BE6C001D7837 /* BDKCollectionIndexView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BDKCollectionIndexView.h; path = ../BDKCollectionIndexView.h; sourceTree = ""; };
- C393E0641816BE6C001D7837 /* BDKCollectionIndexView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BDKCollectionIndexView.m; path = ../BDKCollectionIndexView.m; sourceTree = ""; };
- C393E0681816C060001D7837 /* BDKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKViewController.h; sourceTree = ""; };
- C393E0691816C060001D7837 /* BDKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKViewController.m; sourceTree = ""; };
- C393E06B1816C33D001D7837 /* BDKCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKCell.h; sourceTree = ""; };
- C393E06C1816C33D001D7837 /* BDKCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKCell.m; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- C368DD6C1816BE1C002F428D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C368DD751816BE1C002F428D /* CoreGraphics.framework in Frameworks */,
- C368DD771816BE1C002F428D /* UIKit.framework in Frameworks */,
- C368DD731816BE1C002F428D /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- C368DD661816BE1C002F428D = {
- isa = PBXGroup;
- children = (
- C393E0671816BE85001D7837 /* Resources */,
- C393E0661816BE7A001D7837 /* Classes */,
- C393E0621816BE5F001D7837 /* BDKCollectionIndexView */,
- C368DD711816BE1C002F428D /* Frameworks */,
- C368DD701816BE1C002F428D /* Products */,
- );
- sourceTree = "";
- };
- C368DD701816BE1C002F428D /* Products */ = {
- isa = PBXGroup;
- children = (
- C368DD6F1816BE1C002F428D /* BDKCollectionIndexView.app */,
- );
- name = Products;
- sourceTree = "";
- };
- C368DD711816BE1C002F428D /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- C368DD721816BE1C002F428D /* Foundation.framework */,
- C368DD741816BE1C002F428D /* CoreGraphics.framework */,
- C368DD761816BE1C002F428D /* UIKit.framework */,
- C368DD8B1816BE1C002F428D /* XCTest.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
- C393E0581816BE5B001D7837 /* en.lproj */ = {
- isa = PBXGroup;
- children = (
- C393E0591816BE5B001D7837 /* InfoPlist.strings */,
- );
- path = en.lproj;
- sourceTree = "";
- };
- C393E0621816BE5F001D7837 /* BDKCollectionIndexView */ = {
- isa = PBXGroup;
- children = (
- C393E0631816BE6C001D7837 /* BDKCollectionIndexView.h */,
- C393E0641816BE6C001D7837 /* BDKCollectionIndexView.m */,
- );
- name = BDKCollectionIndexView;
- sourceTree = "";
- };
- C393E0661816BE7A001D7837 /* Classes */ = {
- isa = PBXGroup;
- children = (
- C393E0561816BE5B001D7837 /* BDKAppDelegate.h */,
- C393E0571816BE5B001D7837 /* BDKAppDelegate.m */,
- C393E05C1816BE5B001D7837 /* main.m */,
- C393E05D1816BE5B001D7837 /* Prefix.pch */,
- C393E0681816C060001D7837 /* BDKViewController.h */,
- C393E0691816C060001D7837 /* BDKViewController.m */,
- C393E06B1816C33D001D7837 /* BDKCell.h */,
- C393E06C1816C33D001D7837 /* BDKCell.m */,
- );
- name = Classes;
- sourceTree = "";
- };
- C393E0671816BE85001D7837 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 1548B4E21AD826D000B17B7A /* Images.xcassets */,
- C393E0581816BE5B001D7837 /* en.lproj */,
- C393E05B1816BE5B001D7837 /* Info.plist */,
- );
- name = Resources;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- C368DD6E1816BE1C002F428D /* BDKCollectionIndexView */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C368DD9B1816BE1C002F428D /* Build configuration list for PBXNativeTarget "BDKCollectionIndexView" */;
- buildPhases = (
- C368DD6B1816BE1C002F428D /* Sources */,
- C368DD6C1816BE1C002F428D /* Frameworks */,
- C368DD6D1816BE1C002F428D /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = BDKCollectionIndexView;
- productName = BDKCollectionIndexView;
- productReference = C368DD6F1816BE1C002F428D /* BDKCollectionIndexView.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- C368DD671816BE1C002F428D /* Project object */ = {
- isa = PBXProject;
- attributes = {
- CLASSPREFIX = BDK;
- LastUpgradeCheck = 0500;
- ORGANIZATIONNAME = "Ben Kreeger";
- };
- buildConfigurationList = C368DD6A1816BE1C002F428D /* Build configuration list for PBXProject "BDKCollectionIndexView" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = C368DD661816BE1C002F428D;
- productRefGroup = C368DD701816BE1C002F428D /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- C368DD6E1816BE1C002F428D /* BDKCollectionIndexView */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- C368DD6D1816BE1C002F428D /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C393E05F1816BE5B001D7837 /* InfoPlist.strings in Resources */,
- 1548B4E31AD826D000B17B7A /* Images.xcassets in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- C368DD6B1816BE1C002F428D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C393E0611816BE5B001D7837 /* main.m in Sources */,
- C393E0651816BE6C001D7837 /* BDKCollectionIndexView.m in Sources */,
- C393E06A1816C060001D7837 /* BDKViewController.m in Sources */,
- C393E05E1816BE5B001D7837 /* BDKAppDelegate.m in Sources */,
- C393E06D1816C33D001D7837 /* BDKCell.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- C393E0591816BE5B001D7837 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- C393E05A1816BE5B001D7837 /* en */,
- );
- name = InfoPlist.strings;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- C368DD991816BE1C002F428D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
- 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__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- 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;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = 2;
- };
- name = Debug;
- };
- C368DD9A1816BE1C002F428D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
- 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__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = YES;
- ENABLE_NS_ASSERTIONS = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- 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;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = 2;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- C368DD9C1816BE1C002F428D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Prefix.pch;
- INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TARGETED_DEVICE_FAMILY = "1,2";
- WRAPPER_EXTENSION = app;
- };
- name = Debug;
- };
- C368DD9D1816BE1C002F428D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Prefix.pch;
- INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TARGETED_DEVICE_FAMILY = "1,2";
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C368DD6A1816BE1C002F428D /* Build configuration list for PBXProject "BDKCollectionIndexView" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C368DD991816BE1C002F428D /* Debug */,
- C368DD9A1816BE1C002F428D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C368DD9B1816BE1C002F428D /* Build configuration list for PBXNativeTarget "BDKCollectionIndexView" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C368DD9C1816BE1C002F428D /* Debug */,
- C368DD9D1816BE1C002F428D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = C368DD671816BE1C002F428D /* Project object */;
-}
diff --git a/Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/xcshareddata/BDKCollectionIndexView.xccheckout b/Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/xcshareddata/BDKCollectionIndexView.xccheckout
deleted file mode 100644
index d706259..0000000
--- a/Project/BDKCollectionIndexView.xcodeproj/project.xcworkspace/xcshareddata/BDKCollectionIndexView.xccheckout
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- IDESourceControlProjectFavoriteDictionaryKey
-
- IDESourceControlProjectIdentifier
- FEA6B552-653A-48E5-9BFD-062182F2AE26
- IDESourceControlProjectName
- BDKCollectionIndexView
- IDESourceControlProjectOriginsDictionary
-
- E6A77159-54A1-4910-A557-8AC6F5B1B734
- ssh://github.com/kreeger/BDKCollectionIndexView.git
-
- IDESourceControlProjectPath
- BDKCollectionIndexView/BDKCollectionIndexView.xcodeproj/project.xcworkspace
- IDESourceControlProjectRelativeInstallPathDictionary
-
- E6A77159-54A1-4910-A557-8AC6F5B1B734
- ../../..
-
- IDESourceControlProjectURL
- ssh://github.com/kreeger/BDKCollectionIndexView.git
- IDESourceControlProjectVersion
- 110
- IDESourceControlProjectWCCIdentifier
- E6A77159-54A1-4910-A557-8AC6F5B1B734
- IDESourceControlProjectWCConfigurations
-
-
- IDESourceControlRepositoryExtensionIdentifierKey
- public.vcs.git
- IDESourceControlWCCIdentifierKey
- E6A77159-54A1-4910-A557-8AC6F5B1B734
- IDESourceControlWCCName
- BDKCollectionIndexView
-
-
-
-
diff --git a/Project/BDKCollectionIndexView/Images.xcassets/AppIcon.appiconset/Contents.json b/Project/BDKCollectionIndexView/Images.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index da837d9..0000000
--- a/Project/BDKCollectionIndexView/Images.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "iphone",
- "scale" : "1x",
- "size" : "57x57"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "57x57"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "60x60"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "72x72"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "72x72"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "76x76"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "76x76"
- },
- {
- "idiom" : "iphone",
- "scale" : "1x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "40x40"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "50x50"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "50x50"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "40x40"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "40x40"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "29x29"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "29x29"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/Project/BDKCollectionIndexView/Images.xcassets/LaunchImage.launchimage/Contents.json b/Project/BDKCollectionIndexView/Images.xcassets/LaunchImage.launchimage/Contents.json
deleted file mode 100644
index f62085c..0000000
--- a/Project/BDKCollectionIndexView/Images.xcassets/LaunchImage.launchimage/Contents.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "iphone",
- "scale" : "1x",
- "orientation" : "portrait"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "orientation" : "portrait"
- },
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "subtype" : "retina4",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "minimum-system-version" : "7.0",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "minimum-system-version" : "7.0",
- "subtype" : "retina4",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "ipad",
- "extent" : "to-status-bar",
- "scale" : "1x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "ipad",
- "extent" : "to-status-bar",
- "scale" : "2x"
- },
- {
- "orientation" : "landscape",
- "idiom" : "ipad",
- "extent" : "to-status-bar",
- "scale" : "1x"
- },
- {
- "orientation" : "landscape",
- "idiom" : "ipad",
- "extent" : "to-status-bar",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "ipad",
- "minimum-system-version" : "7.0",
- "extent" : "full-screen",
- "scale" : "1x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "ipad",
- "minimum-system-version" : "7.0",
- "extent" : "full-screen",
- "scale" : "2x"
- },
- {
- "orientation" : "landscape",
- "idiom" : "ipad",
- "minimum-system-version" : "7.0",
- "extent" : "full-screen",
- "scale" : "1x"
- },
- {
- "orientation" : "landscape",
- "idiom" : "ipad",
- "minimum-system-version" : "7.0",
- "extent" : "full-screen",
- "scale" : "2x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/Project/BDKViewController.h b/Project/BDKViewController.h
deleted file mode 100644
index 0952e73..0000000
--- a/Project/BDKViewController.h
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// BDKViewController.h
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Contributors: Adrian Maurer
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import
-
-@interface BDKViewController : UIViewController
-
-@end
diff --git a/Project/BDKViewController.m b/Project/BDKViewController.m
deleted file mode 100644
index f339a75..0000000
--- a/Project/BDKViewController.m
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// BDKViewController.m
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Contributors: Adrian Maurer
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import "BDKViewController.h"
-
-#import "BDKCollectionIndexView.h"
-
-#import "BDKCell.h"
-
-@interface BDKViewController ()
-
-@property (strong, nonatomic) UICollectionView *collectionView;
-
-@property (strong, nonatomic) UICollectionViewFlowLayout *flowLayout;
-
-@property (strong, nonatomic) BDKCollectionIndexView *indexView;
-
-@property (strong, nonatomic) NSArray *sections;
-
-- (void)indexViewValueChanged:(BDKCollectionIndexView *)sender;
-
-@end
-
-@implementation BDKViewController
-
-#pragma mark - Lifecycle
-
-- (void)loadView {
- self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
- self.view.backgroundColor = [UIColor whiteColor];
- [self.view addSubview:self.collectionView];
- [self.view addSubview:self.indexView];
-}
-
-- (void)viewDidLoad {
- [super viewDidLoad];
-
- // Create data
- NSMutableArray *sections = [NSMutableArray new];
- for (NSInteger count = 0; count <= 30; count++) {
- [sections addObject:[NSString stringWithFormat:@"%ld", (long)count]];
- }
-
- self.sections = sections.copy;
- self.indexView.indexTitles = self.sections;
-}
-
-- (void)viewWillLayoutSubviews {
- const CGFloat indexWidth = 28.0f;
- NSDictionary *views = @{@"iv" : self.indexView};
-
- [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.indexView
- attribute:NSLayoutAttributeTop
- relatedBy:NSLayoutRelationEqual
- toItem:self.topLayoutGuide
- attribute:NSLayoutAttributeBottom
- multiplier:1.0
- constant:0.0]];
-
- [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[iv]-0-|"
- options:0
- metrics:nil
- views:views]];
-
- [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[iv(w)]-0-|"
- options:0
- metrics:@{@"w" : @(indexWidth)} views:views]];
-}
-
-#pragma mark - Properties
-
-- (UICollectionView *)collectionView {
- if (_collectionView) return _collectionView;
- _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:self.flowLayout];
- _collectionView.dataSource = self;
- _collectionView.backgroundColor = [UIColor whiteColor];
- _collectionView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
- [_collectionView registerClass:[BDKCell class] forCellWithReuseIdentifier:BDKCellID];
- return _collectionView;
-}
-
-- (UICollectionViewFlowLayout *)flowLayout {
- if (_flowLayout) return _flowLayout;
- _flowLayout = [UICollectionViewFlowLayout new];
- _flowLayout.itemSize = CGSizeMake(320, 320);
- return _flowLayout;
-}
-
-- (BDKCollectionIndexView *)indexView {
- if (_indexView) return _indexView;
- _indexView = [BDKCollectionIndexView indexViewWithFrame:CGRectZero indexTitles:@[]];
- _indexView.translatesAutoresizingMaskIntoConstraints = NO; // auto layout
- [_indexView addTarget:self action:@selector(indexViewValueChanged:) forControlEvents:UIControlEventValueChanged];
- return _indexView;
-}
-
-#pragma mark - Actions
-
-- (void)indexViewValueChanged:(BDKCollectionIndexView *)sender {
- NSIndexPath *path = [NSIndexPath indexPathForItem:0 inSection:sender.currentIndex];
- if (![self collectionView:self.collectionView cellForItemAtIndexPath:path])
- return;
-
- [self.collectionView scrollToItemAtIndexPath:path atScrollPosition:UICollectionViewScrollPositionTop animated:NO];
- CGFloat yOffset = self.collectionView.contentOffset.y;
-
- self.collectionView.contentOffset = CGPointMake(self.collectionView.contentOffset.x, yOffset);
-}
-
-#pragma mark - UICollectionViewDataSource
-
-- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
- return [self.sections count];
-}
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
- return 1;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
- BDKCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:BDKCellID forIndexPath:indexPath];
- cell.label.text = self.sections[indexPath.section];
- return cell;
-}
-
-@end
diff --git a/Project/Info.plist b/Project/Info.plist
deleted file mode 100644
index 59078f8..0000000
--- a/Project/Info.plist
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleDisplayName
- BDKCIV
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIcons
-
- CFBundleIcons~ipad
-
- CFBundleIdentifier
- gr.kree.${PRODUCT_NAME:rfc1034identifier}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- LSRequiresIPhoneOS
-
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
-
-
diff --git a/Project/Prefix.pch b/Project/Prefix.pch
deleted file mode 100644
index 743435c..0000000
--- a/Project/Prefix.pch
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Prefix header
-//
-// The contents of this file are implicitly included at the beginning of every source file.
-//
-
-#import
-
-#ifndef __IPHONE_3_0
-#warning "This project uses features only available in iOS SDK 3.0 and later."
-#endif
-
-#ifdef __OBJC__
- #import
- #import
-#endif
diff --git a/Project/en.lproj/InfoPlist.strings b/Project/en.lproj/InfoPlist.strings
deleted file mode 100644
index 477b28f..0000000
--- a/Project/en.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
diff --git a/Project/main.m b/Project/main.m
deleted file mode 100644
index db7a576..0000000
--- a/Project/main.m
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// main.m
-// BDKCollectionIndexView
-//
-// Created by Ben Kreeger on 10/22/13.
-// Copyright (c) 2013 Ben Kreeger. All rights reserved.
-//
-
-#import
-
-#import "BDKAppDelegate.h"
-
-int main(int argc, char * argv[])
-{
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([BDKAppDelegate class]));
- }
-}
diff --git a/readme.markdown b/README.md
similarity index 77%
rename from readme.markdown
rename to README.md
index f2e2b83..3501b18 100644
--- a/readme.markdown
+++ b/README.md
@@ -4,7 +4,9 @@ An index-title-scrubber-bar, for use with a `UICollectionView` or as a replaceme

-## Usage
+## Setup
+
+### CocoaPods
To install it via [CocoaPods](http://cocoapods.org), just drop this line in your `Podfile`:
@@ -12,7 +14,22 @@ To install it via [CocoaPods](http://cocoapods.org), just drop this line in your
pod 'BDKCollectionIndexView'
```
-And then run `pod install`, naturally. After that, create an instance of `BDKCollectionIndexView`, and add it as a subview of whatever `view` contains your `tableView` or `collectionView` (but not the `tableView` or `collectionView` itself). Then assign it a `width` value of 28 (or `height`, if you're using it as a horizontal index view). Attach whatever other layout constraints you see fit!
+And then run `pod install`, naturally.
+
+### Swift Package Manager
+
+Alternatively you can integrate directly in Xcode using Swift Package Manager. You can find more info about this dependency manager [here](https://www.swift.org/package-manager/)
+
+ To integrate using Xcode:
+
+ File -> Swift Packages -> Add Package Dependency
+
+ Enter package URL: https://github.com/kreeger/BDKCollectionIndexView
+
+ See [here](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app) for more info
+
+## Usage
+After that, create an instance of `BDKCollectionIndexView`, and add it as a subview of whatever `view` contains your `tableView` or `collectionView` (but not the `tableView` or `collectionView` itself). Then assign it a `width` value of 28 (or `height`, if you're using it as a horizontal index view). Attach whatever other layout constraints you see fit!
```swift
override func viewDidLoad() {
diff --git a/BDKCollectionIndexView.h b/Sources/BDKCollectionIndexView/BDKCollectionIndexView.h
similarity index 99%
rename from BDKCollectionIndexView.h
rename to Sources/BDKCollectionIndexView/BDKCollectionIndexView.h
index ec11b8a..de92006 100644
--- a/BDKCollectionIndexView.h
+++ b/Sources/BDKCollectionIndexView/BDKCollectionIndexView.h
@@ -1,5 +1,5 @@
#import
-
+// @import UIKit;
@protocol BDKCollectionIndexViewDelegate;
/**
diff --git a/BDKCollectionIndexView.m b/Sources/BDKCollectionIndexView/BDKCollectionIndexView.m
similarity index 100%
rename from BDKCollectionIndexView.m
rename to Sources/BDKCollectionIndexView/BDKCollectionIndexView.m
diff --git a/Tests/BDKCollectionIndexViewTests/BDKCollectionIndexViewTests.swift b/Tests/BDKCollectionIndexViewTests/BDKCollectionIndexViewTests.swift
new file mode 100644
index 0000000..18cbad1
--- /dev/null
+++ b/Tests/BDKCollectionIndexViewTests/BDKCollectionIndexViewTests.swift
@@ -0,0 +1,11 @@
+import XCTest
+@testable import BDKCollectionIndexView
+
+final class BDKCollectionIndexViewTests: XCTestCase {
+ func testExample() throws {
+ // This is an example of a functional test case.
+ // Use XCTAssert and related functions to verify your tests produce the correct
+ // results.
+ XCTAssertEqual(BDKCollectionIndexView().text, "Hello, World!")
+ }
+}