diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 762e35d..0030b16 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -483,7 +483,9 @@ C4175BBA075FDF4F3308F095 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0640; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; }; buildConfigurationList = 4907D894AC8F3F6054A998C5 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -658,6 +660,7 @@ OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Pods_TNImageSliderViewController_Example; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -685,6 +688,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = TNImageSliderViewController; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -712,6 +716,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Pods-TNImageSliderViewController_Example-TNImageSliderViewController/Pods-TNImageSliderViewController_Example-TNImageSliderViewController.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = TNImageSliderViewController; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -799,6 +804,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Pods-TNImageSliderViewController_Example-TNImageSliderViewController/Pods-TNImageSliderViewController_Example-TNImageSliderViewController.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = TNImageSliderViewController; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -827,6 +833,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = TNImageSliderViewController; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -857,6 +864,7 @@ OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Pods_TNImageSliderViewController_Tests; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -899,6 +907,7 @@ OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Pods_TNImageSliderViewController_Example; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -929,6 +938,7 @@ OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Pods_TNImageSliderViewController_Tests; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -957,6 +967,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-TNImageSliderViewController_Example-TNImageSliderViewController-TNImageSliderViewController.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-TNImageSliderViewController_Example-TNImageSliderViewController-TNImageSliderViewController.xcscheme index 110fbaf..e01142f 100644 --- a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-TNImageSliderViewController_Example-TNImageSliderViewController-TNImageSliderViewController.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-TNImageSliderViewController_Example-TNImageSliderViewController-TNImageSliderViewController.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.1.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + diff --git a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Example/Info.plist b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Example/Info.plist index 6974542..11db4b7 100644 --- a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Example/Info.plist +++ b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Example/Info.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + diff --git a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Info.plist b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Info.plist index 4ba5fa2..aa182b6 100644 --- a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Info.plist +++ b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests-TNImageSliderViewController/Info.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.1.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + diff --git a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests/Info.plist b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests/Info.plist index 6974542..11db4b7 100644 --- a/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests/Info.plist +++ b/Example/Pods/Target Support Files/Pods-TNImageSliderViewController_Tests/Info.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + diff --git a/Pod/Classes/TNImageSliderViewController.swift b/Pod/Classes/TNImageSliderViewController.swift index 031f286..b105c59 100644 --- a/Pod/Classes/TNImageSliderViewController.swift +++ b/Pod/Classes/TNImageSliderViewController.swift @@ -106,7 +106,7 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData } - required public init(coder aDecoder: NSCoder) { + required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) @@ -121,6 +121,7 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData setupCollectionView() setupPageControl() + setupTapGestureRecognizer() } @@ -175,7 +176,7 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData layout.minimumInteritemSpacing = 0 collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout:layout) - collectionView.setTranslatesAutoresizingMaskIntoConstraints(false) + collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.pagingEnabled = true let bundle = NSBundle(forClass: TNImageSliderViewController.classForCoder()) @@ -187,8 +188,8 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData collectionView.dataSource = self view.addSubview(collectionView) - let horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:|[collectionView]|", options: nil, metrics: nil, views: ["collectionView":collectionView]) - let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[collectionView]|", options: nil, metrics: nil, views: ["collectionView":collectionView]) + let horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:|[collectionView]|", options: [], metrics: nil, views: ["collectionView":collectionView]) + let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[collectionView]|", options: [], metrics: nil, views: ["collectionView":collectionView]) view.addConstraints(horizontalConstraints) view.addConstraints(verticalConstraints) @@ -198,7 +199,7 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData private func setupPageControl() { pageControl = UIPageControl() - pageControl.setTranslatesAutoresizingMaskIntoConstraints(false) + pageControl.translatesAutoresizingMaskIntoConstraints = false pageControl.currentPage = 0 pageControl.currentPageIndicatorTintColor = options.pageControlCurrentIndicatorTintColor @@ -226,6 +227,17 @@ public class TNImageSliderViewController: UIViewController, UICollectionViewData } + private func setupTapGestureRecognizer() { + let singleFingerTap = UITapGestureRecognizer(target: self, action: "handleSingleFingerTap:") + singleFingerTap.numberOfTapsRequired = 1 + self.view.addGestureRecognizer(singleFingerTap) + } + + func handleSingleFingerTap(sender: UITapGestureRecognizer) { + self.modalTransitionStyle = .CrossDissolve + self.dismissViewControllerAnimated(true, completion: nil) + } + // MARK: - Public methods // MARK: - Getter & setter methods