Skip to content

Commit

Permalink
Merge pull request #6 from EurekaCommunity/swift4
Browse files Browse the repository at this point in the history
Adds compatibility with xcode 9 (Swift 4).
  • Loading branch information
pera authored and pera committed Oct 9, 2017
2 parents 6260479 + c6e63be commit 2686692
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: objective-c
osx_image: xcode8
osx_image: xcode9
env:
- DESTINATION="OS=10.0,name=iPhone 6s" SCHEME="PostalAddressRow" SDK=iphonesimulator10.0
- DESTINATION="OS=11.0,name=iPhone 7" SCHEME="PostalAddressRow" SDK=iphonesimulator

before_install:
- brew update
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" ~> 3.0
github "xmartlabs/Eureka" ~> 4.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" "3.0.0"
github "xmartlabs/Eureka" "4.0.1"
182 changes: 124 additions & 58 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Example/ExampleUITests/ExampleUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ExampleUITests.swift
// ExampleUITests
//
// Copyright © 2016 Xmartlabs SRL. All rights reserved.
// Created by Santiago Fernandez on 10/9/17.
//

import XCTest
Expand Down
4 changes: 1 addition & 3 deletions Example/ExampleUITests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand All @@ -16,8 +16,6 @@
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions PostalAddressRow.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PostalAddressRow"
s.version = "1.1.0"
s.version = "2.0.0"
s.summary = "An Eureka row that shows a series of UITextField's for the user to enter postal address information."
s.homepage = "https://github.com/EurekaCommunity/PostalAddressRow"
s.license = { type: 'MIT', file: 'LICENSE' }
Expand All @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
'PostalAddressRow' => ['Sources/**/*.xib']
}
# s.ios.frameworks = 'UIKit', 'Foundation'
s.dependency 'Eureka', '3.0'
s.dependency 'Eureka', '4.0'
end
59 changes: 37 additions & 22 deletions PostalAddressRow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
287D0A6E1C4B73BD004566D6 /* PostalAddressRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287D0A6D1C4B73BD004566D6 /* PostalAddressRowTests.swift */; };
28F828811C494B2C00330CF4 /* PostalAddressRow.h in Headers */ = {isa = PBXBuildFile; fileRef = 28F828801C494B2C00330CF4 /* PostalAddressRow.h */; settings = {ATTRIBUTES = (Public, ); }; };
28F828881C494B2C00330CF4 /* PostalAddressRow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28F8287D1C494B2C00330CF4 /* PostalAddressRow.framework */; };
8F49F8AB1D871ED40058ACF9 /* Eureka.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F49F8AA1D871ED40058ACF9 /* Eureka.framework */; };
8F58BC761D889B6400F14961 /* PostalAddressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F58BC751D889B6400F14961 /* PostalAddressCell.swift */; };
8FDB703D1D871BAD0008694A /* PostalAddressRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FDB703C1D871BAD0008694A /* PostalAddressRow.swift */; };
8FDB703F1D871C3F0008694A /* PostalAddressCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FDB703E1D871C3F0008694A /* PostalAddressCell.xib */; };
CB3F7D691F8BEF7900C856E5 /* PostalAddressRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5142631F8BEECC00E20AD5 /* PostalAddressRowTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -27,16 +27,16 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
287D0A6D1C4B73BD004566D6 /* PostalAddressRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PostalAddressRowTests.swift; path = Tests/PostalAddressRowTests.swift; sourceTree = SOURCE_ROOT; };
28F8287D1C494B2C00330CF4 /* PostalAddressRow.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PostalAddressRow.framework; sourceTree = BUILT_PRODUCTS_DIR; };
28F828801C494B2C00330CF4 /* PostalAddressRow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PostalAddressRow.h; sourceTree = "<group>"; };
28F828821C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
28F828871C494B2C00330CF4 /* PostalAddressRowTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PostalAddressRowTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
28F8288E1C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Tests/Info.plist; sourceTree = "<group>"; };
8F49F8AA1D871ED40058ACF9 /* Eureka.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Eureka.framework; path = Carthage/Build/iOS/Eureka.framework; sourceTree = "<group>"; };
8F58BC751D889B6400F14961 /* PostalAddressCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostalAddressCell.swift; sourceTree = "<group>"; };
8FDB703C1D871BAD0008694A /* PostalAddressRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostalAddressRow.swift; sourceTree = "<group>"; };
8FDB703E1D871C3F0008694A /* PostalAddressCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PostalAddressCell.xib; sourceTree = "<group>"; };
CB5142631F8BEECC00E20AD5 /* PostalAddressRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostalAddressRowTests.swift; sourceTree = SOURCE_ROOT; };
CB5142641F8BEECC00E20AD5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -64,7 +64,7 @@
children = (
28F828971C494B4200330CF4 /* Sources */,
28F8287F1C494B2C00330CF4 /* PostalAddressRow */,
28F8288B1C494B2C00330CF4 /* Tests */,
CB3F7D681F8BEF4E00C856E5 /* Tests */,
28F8287E1C494B2C00330CF4 /* Products */,
8F49F8A91D871ED40058ACF9 /* Frameworks */,
);
Expand All @@ -89,16 +89,6 @@
path = Sources/PostalAddressRow;
sourceTree = "<group>";
};
28F8288B1C494B2C00330CF4 /* Tests */ = {
isa = PBXGroup;
children = (
28F8288E1C494B2C00330CF4 /* Info.plist */,
287D0A6D1C4B73BD004566D6 /* PostalAddressRowTests.swift */,
);
name = Tests;
path = PostalAddressRowTests;
sourceTree = "<group>";
};
28F828971C494B4200330CF4 /* Sources */ = {
isa = PBXGroup;
children = (
Expand All @@ -117,6 +107,15 @@
name = Frameworks;
sourceTree = "<group>";
};
CB3F7D681F8BEF4E00C856E5 /* Tests */ = {
isa = PBXGroup;
children = (
CB5142631F8BEECC00E20AD5 /* PostalAddressRowTests.swift */,
CB5142641F8BEECC00E20AD5 /* Info.plist */,
);
name = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -174,15 +173,15 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
TargetAttributes = {
28F8287C1C494B2C00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
28F828861C494B2C00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
};
};
Expand Down Expand Up @@ -236,7 +235,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
287D0A6E1C4B73BD004566D6 /* PostalAddressRowTests.swift in Sources */,
CB3F7D691F8BEF7900C856E5 /* PostalAddressRowTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -259,14 +258,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -309,14 +314,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -363,7 +374,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.PostalAddressRow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -385,7 +397,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.PostalAddressRow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -398,7 +411,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.PostalAddressRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -410,7 +424,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.PostalAddressRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.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 = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions Sources/PostalAddressCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ open class _PostalAddressCell<T: PostalAddressType>: Cell<T>, CellType, PostalAd
private func setPlaceholderToTextField(textField: UITextField?, placeholder: String?) {
if let placeholder = placeholder, let textField = textField {
if let color = (row as? PostalAddressRowConformance)?.placeholderColor {
textField.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSForegroundColorAttributeName: color])
textField.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSAttributedStringKey.foregroundColor: color])
} else {
textField.placeholder = placeholder
}
Expand Down Expand Up @@ -181,7 +181,7 @@ open class _PostalAddressCell<T: PostalAddressType>: Cell<T>, CellType, PostalAd
return super.inputAccessoryView
}

func internalNavigationAction(_ sender: UIBarButtonItem) {
@objc func internalNavigationAction(_ sender: UIBarButtonItem) {
guard let inputAccesoryView = inputAccessoryView as? NavigationAccessoryView else { return }

var index = 0
Expand All @@ -203,7 +203,7 @@ open class _PostalAddressCell<T: PostalAddressType>: Cell<T>, CellType, PostalAd
}
}

open func textFieldDidChange(_ textField : UITextField){
@objc open func textFieldDidChange(_ textField : UITextField){
if row.baseValue == nil{
row.baseValue = PostalAddress()
}
Expand Down

0 comments on commit 2686692

Please sign in to comment.