From 121e3f388469f8e642437c1f154ce8c1528f91cf Mon Sep 17 00:00:00 2001 From: Stan Feldman Date: Tue, 25 Apr 2017 17:30:54 +0800 Subject: [PATCH 1/2] created framework project to support Carthage --- .gitignore | 65 ++++ SwipeView.h | 19 ++ SwipeView.xcodeproj/project.pbxproj | 300 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/xcschemes/SwipeView.xcscheme | 80 +++++ SwipeView/Info.plist | 24 ++ 6 files changed, 495 insertions(+) create mode 100644 .gitignore create mode 100644 SwipeView.h create mode 100644 SwipeView.xcodeproj/project.pbxproj create mode 100644 SwipeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 SwipeView.xcodeproj/xcshareddata/xcschemes/SwipeView.xcscheme create mode 100644 SwipeView/Info.plist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc6c63b --- /dev/null +++ b/.gitignore @@ -0,0 +1,65 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +Carthage/Checkouts +Carthage/Build +Cartfile.resolved + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output diff --git a/SwipeView.h b/SwipeView.h new file mode 100644 index 0000000..6bd2fd7 --- /dev/null +++ b/SwipeView.h @@ -0,0 +1,19 @@ +// +// SwipeView.h +// SwipeView +// +// Created by Stan on 25/04/2017. +// Copyright © 2017 Limehat. All rights reserved. +// + +#import + +//! Project version number for SwipeView. +FOUNDATION_EXPORT double SwipeViewVersionNumber; + +//! Project version string for SwipeView. +FOUNDATION_EXPORT const unsigned char SwipeViewVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/SwipeView.xcodeproj/project.pbxproj b/SwipeView.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4e74c70 --- /dev/null +++ b/SwipeView.xcodeproj/project.pbxproj @@ -0,0 +1,300 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + F6B68FE41EAF4CC000121353 /* SwipeView.h in Headers */ = {isa = PBXBuildFile; fileRef = F6B68FE21EAF4CC000121353 /* SwipeView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F6B68FEB1EAF4D6300121353 /* SwipeView.m in Sources */ = {isa = PBXBuildFile; fileRef = F6B68FEA1EAF4D6300121353 /* SwipeView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F6B68FDF1EAF4CC000121353 /* SwipeView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwipeView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F6B68FE21EAF4CC000121353 /* SwipeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwipeView.h; sourceTree = ""; }; + F6B68FE31EAF4CC000121353 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F6B68FEA1EAF4D6300121353 /* SwipeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SwipeView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F6B68FDB1EAF4CC000121353 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F6B68FD51EAF4CC000121353 = { + isa = PBXGroup; + children = ( + F6B68FE11EAF4CC000121353 /* SwipeView */, + F6B68FE01EAF4CC000121353 /* Products */, + ); + sourceTree = ""; + }; + F6B68FE01EAF4CC000121353 /* Products */ = { + isa = PBXGroup; + children = ( + F6B68FDF1EAF4CC000121353 /* SwipeView.framework */, + ); + name = Products; + sourceTree = ""; + }; + F6B68FE11EAF4CC000121353 /* SwipeView */ = { + isa = PBXGroup; + children = ( + F6B68FEA1EAF4D6300121353 /* SwipeView.m */, + F6B68FE21EAF4CC000121353 /* SwipeView.h */, + F6B68FE31EAF4CC000121353 /* Info.plist */, + ); + path = SwipeView; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + F6B68FDC1EAF4CC000121353 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F6B68FE41EAF4CC000121353 /* SwipeView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + F6B68FDE1EAF4CC000121353 /* SwipeView */ = { + isa = PBXNativeTarget; + buildConfigurationList = F6B68FE71EAF4CC000121353 /* Build configuration list for PBXNativeTarget "SwipeView" */; + buildPhases = ( + F6B68FDA1EAF4CC000121353 /* Sources */, + F6B68FDB1EAF4CC000121353 /* Frameworks */, + F6B68FDC1EAF4CC000121353 /* Headers */, + F6B68FDD1EAF4CC000121353 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwipeView; + productName = SwipeView; + productReference = F6B68FDF1EAF4CC000121353 /* SwipeView.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F6B68FD61EAF4CC000121353 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = Limehat; + TargetAttributes = { + F6B68FDE1EAF4CC000121353 = { + CreatedOnToolsVersion = 8.3.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = F6B68FD91EAF4CC000121353 /* Build configuration list for PBXProject "SwipeView" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = F6B68FD51EAF4CC000121353; + productRefGroup = F6B68FE01EAF4CC000121353 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F6B68FDE1EAF4CC000121353 /* SwipeView */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F6B68FDD1EAF4CC000121353 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F6B68FDA1EAF4CC000121353 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F6B68FEB1EAF4D6300121353 /* SwipeView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + F6B68FE51EAF4CC000121353 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + F6B68FE61EAF4CC000121353 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F6B68FE81EAF4CC000121353 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = SwipeView/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.limehat.SwipeView; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + F6B68FE91EAF4CC000121353 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = SwipeView/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.limehat.SwipeView; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F6B68FD91EAF4CC000121353 /* Build configuration list for PBXProject "SwipeView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F6B68FE51EAF4CC000121353 /* Debug */, + F6B68FE61EAF4CC000121353 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F6B68FE71EAF4CC000121353 /* Build configuration list for PBXNativeTarget "SwipeView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F6B68FE81EAF4CC000121353 /* Debug */, + F6B68FE91EAF4CC000121353 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F6B68FD61EAF4CC000121353 /* Project object */; +} diff --git a/SwipeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwipeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7bd1931 --- /dev/null +++ b/SwipeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwipeView.xcodeproj/xcshareddata/xcschemes/SwipeView.xcscheme b/SwipeView.xcodeproj/xcshareddata/xcschemes/SwipeView.xcscheme new file mode 100644 index 0000000..0ed885b --- /dev/null +++ b/SwipeView.xcodeproj/xcshareddata/xcschemes/SwipeView.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwipeView/Info.plist b/SwipeView/Info.plist new file mode 100644 index 0000000..a6867d0 --- /dev/null +++ b/SwipeView/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.3.3 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + From ab9019571dd2fd561808a4b42fdd9bd593b9e913 Mon Sep 17 00:00:00 2001 From: Stan Date: Tue, 25 Apr 2017 17:41:17 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 59 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 886a100..a74186e 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,18 @@ SwipeView is a class designed to simplify the implementation of horizontal, page SwipeView's interface and implementation is based on the iCarousel library, and should be familiar to anyone who has used iCarousel. +Installation +-------------- +### Carthage -Supported OS & SDK Versions ------------------------------ - -* Supported build target - iOS 7.0 (Xcode 5.0, Apple LLVM compiler 5.0) -* Earliest supported deployment target - iOS 5.0 -* Earliest compatible deployment target - iOS 4.3 - -NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this OS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly. - - -ARC Compatibility ------------------- - -As of version 1.3, SwipeView requires ARC. If you wish to use SwipeView in a non-ARC project, just add the -fobjc-arc compiler flag to the SwipeView.m class. To do this, go to the Build Phases tab in your target settings, open the Compile Sources group, double-click SwipeView.m in the list and type -fobjc-arc into the popover. +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -If you wish to convert your whole project to ARC, comment out the #error line in SwipeView.m, then run the Edit > Refactor > Convert to Objective-C ARC... tool in Xcode and make sure all files that you wish to use ARC for (including SwipeView.m) are checked. +If you are using Carthage, add following line into your Cartfile + github "stanfeldman/SwipeView" -Thread Safety --------------- - -SwipeView is derived from UIView and - as with all UIKit components - it should only be accessed from the main thread. You may wish to use threads for loading or updating SwipeView contents or items, but always ensure that once your content has loaded, you switch back to the main thread before updating the SwipeView. +### Manual +To use the SwipeView class in an app, just drag the SwipeView class files (demo files and assets are not needed) into your project. Examples -------------- @@ -37,12 +26,6 @@ Examples ### Paging Example ![paging](http://g.recordit.co/RKT9OEHboL.gif) -Installation --------------- - -To use the SwipeView class in an app, just drag the SwipeView class files (demo files and assets are not needed) into your project. - - Properties -------------- @@ -254,9 +237,35 @@ You can also nest UIControls within your item views and these will receive touch If you wish to detect other types of interaction such as swipes, double taps or long presses, the simplest way is to attach a UIGestureRecognizer to your item view or its subviews before passing it to the SwipeView. +Supported OS & SDK Versions +----------------------------- + +* Supported build target - iOS 7.0 (Xcode 5.0, Apple LLVM compiler 5.0) +* Earliest supported deployment target - iOS 5.0 +* Earliest compatible deployment target - iOS 4.3 + +NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this OS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly. + + +ARC Compatibility +------------------ + +As of version 1.3, SwipeView requires ARC. If you wish to use SwipeView in a non-ARC project, just add the -fobjc-arc compiler flag to the SwipeView.m class. To do this, go to the Build Phases tab in your target settings, open the Compile Sources group, double-click SwipeView.m in the list and type -fobjc-arc into the popover. + +If you wish to convert your whole project to ARC, comment out the #error line in SwipeView.m, then run the Edit > Refactor > Convert to Objective-C ARC... tool in Xcode and make sure all files that you wish to use ARC for (including SwipeView.m) are checked. + + +Thread Safety +-------------- + +SwipeView is derived from UIView and - as with all UIKit components - it should only be accessed from the main thread. You may wish to use threads for loading or updating SwipeView contents or items, but always ensure that once your content has loaded, you switch back to the main thread before updating the SwipeView. + Release Notes ---------------- +Version 1.3.3 + +- Added Carthage support Version 1.3.2