Skip to content

Commit

Permalink
Update for Swift 5 and Eureka 5.0 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mats-claassen authored Jun 11, 2019
1 parent 6402596 commit 9d1b7c1
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
5.0
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: objective-c
osx_image: xcode9
osx_image: xcode10.2
env:
- DESTINATION="OS=11.0,name=iPhone 7" SCHEME="CreditCardRow" SDK=iphonesimulator
- DESTINATION="OS=12.0,name=iPhone X" SCHEME="CreditCardRow" SDK=iphonesimulator

before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
- carthage update --platform iOS
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --quiet

script:
- xcodebuild clean build -project CreditCardRow.xcodeproj -scheme "$SCHEME" -sdk "$SDK"
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Change Log
All notable changes to CreditCardRow will be documented in this file.

### [3.2.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/3.2.0)
<!-- Released on 2019-06-11. -->

* Adds support for Eureka ~> 5.x
* Swift 5 support

### [3.1.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/3.1.0)
<!-- Released on 2017-10-09. -->
<!-- Released on ???. -->

* Adds support for Eureka ~> 4.x

Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" ~> 4.0
github "xmartlabs/Eureka" ~> 5.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" "4.2.0"
github "xmartlabs/Eureka" "5.0.0"
7 changes: 4 additions & 3 deletions CreditCardRow.podspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Pod::Spec.new do |s|
s.name = "CreditCardRow"
s.version = "3.1.0"
s.version = "3.2.0"
s.summary = "An Eureka row that allows the user to input a credit card number with optional CVC and expiration date."
s.homepage = "https://github.com/EurekaCommunity/CreditCardRow"
s.license = { type: 'MIT', file: 'LICENSE' }
s.author = { "Xmartlabs SRL" => "[email protected]" }
s.source = { git: "https://github.com/EurekaCommunity/CreditCardRow.git", tag: s.version.to_s }
s.social_media_url = 'https://twitter.com/xmartlabs'
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.3'
s.requires_arc = true
s.ios.source_files = 'Sources/**/*.swift'
s.resource_bundles = {
'CreditCardRow' => ['Sources/CreditCardCell.xib']
}
s.ios.frameworks = 'UIKit', 'Foundation'
s.dependency 'Eureka', '~> 4.0'
s.dependency 'Eureka', '~> 5.0'
s.swift_version = '5.0'
end
33 changes: 16 additions & 17 deletions CreditCardRow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
8F7E92301D78BA29002BEFC3 /* CreditCardRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardRow.swift; sourceTree = "<group>"; };
8F9B3A091D7DBA12005F8273 /* String+CreditCardRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+CreditCardRow.swift"; sourceTree = "<group>"; };
8FD114E51D79F8B6006976C8 /* CreditCardCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CreditCardCell.xib; sourceTree = "<group>"; };
CB3F7D831F8BF41900C856E5 /* CreditCardRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CreditCardRowTests.swift; path = ExampleUITests/CreditCardRowTests.swift; sourceTree = SOURCE_ROOT; };
CB3F7D831F8BF41900C856E5 /* CreditCardRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CreditCardRowTests.swift; path = Tests/CreditCardRowTests.swift; sourceTree = SOURCE_ROOT; };
CB3F7D841F8BF41900C856E5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ExampleUITests/Info.plist; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -178,24 +178,25 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1020;
TargetAttributes = {
28F8287C1C494B2C00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
28F828861C494B2C00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 28F828771C494B2C00330CF4 /* Build configuration list for PBXProject "CreditCardRow" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 28F828731C494B2C00330CF4;
productRefGroup = 28F8287E1C494B2C00330CF4 /* Products */;
Expand Down Expand Up @@ -279,6 +280,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -322,7 +324,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -338,6 +340,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -375,7 +378,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -401,13 +404,12 @@
);
INFOPLIST_FILE = CreditCardRow/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -425,13 +427,12 @@
);
INFOPLIST_FILE = CreditCardRow/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -444,8 +445,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -457,8 +457,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
35 changes: 16 additions & 19 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,22 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1020;
TargetAttributes = {
28F828CB1C4B714D00330CF4 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 6F2G55XL63;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
28F828DF1C4B714D00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
TestTargetID = 28F828CB1C4B714D00330CF4;
};
};
};
buildConfigurationList = 28F828C71C4B714D00330CF4 /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -376,6 +375,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -418,7 +418,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -430,6 +430,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -466,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -479,19 +480,18 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 6F2G55XL63;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
"$(PROJECT_DIR)/Carthage/Build/iOS/",
);
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -500,19 +500,18 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 6F2G55XL63;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
"$(PROJECT_DIR)/Carthage/Build/iOS/",
);
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -525,8 +524,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
Expand All @@ -540,8 +538,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ By [Xmartlabs SRL](http://xmartlabs.com).

<img src="Media/CreditCardRow.gif" width="300"/>

The master branch is in Swift 4. Use release 1.0.0 for Swift 2 or release 2.* for Swift 3.

## Usage

```swift
Expand All @@ -53,8 +51,8 @@ class ViewController: FormViewController {

## Requirements

* iOS 8.0+
* Xcode 9.0+
* iOS 9.3+
* Xcode 10.2+

## Getting involved

Expand Down Expand Up @@ -83,7 +81,7 @@ Follow these steps to run Example project:
To install CreditCardRow, simply add the following line to your Podfile:

```ruby
pod 'CreditCardRow', '~> 3.0'
pod 'CreditCardRow', '~> 3.2'
```

#### Carthage
Expand Down
2 changes: 1 addition & 1 deletion Sources/CreditCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class CreditCardCell: Cell<CreditCardInfo>, UITextFieldDelegate, CellType {
fileprivate var previousTextFieldContent: String?
fileprivate var previousSelection: UITextRange?

required public init(style: UITableViewCellStyle, reuseIdentifier: String?) {
required public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/String+CreditCardRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension String {
subscript (r: Range<Int>) -> String {
let start = index(startIndex, offsetBy: r.lowerBound)
let end = index(start, offsetBy: r.upperBound - r.lowerBound)
return String(self[Range(start ..< end)])
return String(self[start..<end])
}

}
Expand Down
2 changes: 1 addition & 1 deletion Tests/CreditCardRowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CreditCardRowTests: XCTestCase {
XCTAssertEqual(testString[0], "a")
XCTAssertEqual(testString[3], "d")
XCTAssertEqual(testString[Range(0...1)], "ab")
XCTAssertEqual(testString[Range(3..<6)], "def")
XCTAssertEqual(testString[3..<6], "def")
}

}

0 comments on commit 9d1b7c1

Please sign in to comment.