Skip to content

Commit

Permalink
Merge pull request #32 from Electrode-iOS/swift5
Browse files Browse the repository at this point in the history
support Swift 5 and Xcode 10.2
  • Loading branch information
angelodipaolo authored Apr 11, 2019
2 parents 099e765 + d03cf85 commit e34e4e4
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9.3
osx_image: xcode10.2
script:
- xcodebuild -project ELFoundation.xcodeproj -scheme ELFoundation -sdk iphonesimulator clean test -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.1' CODE_SIGNING_REQUIRED=NO
- xcodebuild -project ELFoundation.xcodeproj -scheme ELFoundation_static -sdk iphonesimulator clean build -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.1' CODE_SIGNING_REQUIRED=NO
- xcodebuild -scheme ELFoundation -sdk iphonesimulator clean test -destination 'OS=12.2,name=iPhone ' CODE_SIGNING_REQUIRED=NO
- xcodebuild -scheme ELFoundation_static -sdk iphonesimulator clean build -destination 'OS=12.2,name=iPhone ' CODE_SIGNING_REQUIRED=NO
30 changes: 14 additions & 16 deletions ELFoundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = WalmartLabs;
TargetAttributes = {
CA8CD5591B7A9DCA00DA8BF7 = {
Expand All @@ -414,20 +414,21 @@
};
CACF2A091A9614D20084EFAE = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
CACF2A141A9614D20084EFAE = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = CACF2A041A9614D20084EFAE /* Build configuration list for PBXProject "ELFoundation" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = CACF2A001A9614D20084EFAE;
productRefGroup = CACF2A0B1A9614D20084EFAE /* Products */;
Expand Down Expand Up @@ -577,6 +578,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 @@ -645,8 +647,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = QADeployment;
};
Expand All @@ -663,8 +664,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = QADeployment;
};
Expand Down Expand Up @@ -831,6 +831,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 @@ -890,6 +891,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 @@ -954,8 +956,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -973,8 +974,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -991,8 +991,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1005,8 +1004,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion ELFoundation/Extensions/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public extension Array where Element : Equatable {
Removes each occurrence of `element` from this array.
*/
mutating func removeElement(_ element: Element) {
while let index = self.index(of: element) {
while let index = self.firstIndex(of: element) {
self.remove(at: index)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ELFoundation/Extensions/NSBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public extension Bundle {

Example: com.walmartlabs.thgfoundation
*/
public func reverseBundleIdentifier() -> String? {
func reverseBundleIdentifier() -> String? {
if let id = bundleIdentifier {
let components: [String] = id.components(separatedBy: ".")
let reverseComponents = Array(components.reversed())
Expand Down
4 changes: 2 additions & 2 deletions ELFoundation/Extensions/NSObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import Foundation

public extension NSObject {
/// Returns the NSBundle containing self's class.
@objc public static func bundle() -> Bundle {
@objc static func bundle() -> Bundle {
return Bundle(for: self)
}

/// Returns the NSBundle containing self's class.
@objc public func bundle() -> Bundle {
@objc func bundle() -> Bundle {
return Swift.type(of: self).bundle()
}
}
2 changes: 1 addition & 1 deletion ELFoundation/Extensions/NSThread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension Thread {
- parameter locale: The locale for the date formatter.
- returns: The date formatter.
*/
public class func dateFormatter(_ format: String, locale: Locale? = Locale.current) -> DateFormatter {
class func dateFormatter(_ format: String, locale: Locale? = Locale.current) -> DateFormatter {
let threadDictionary = Thread.current.threadDictionary

var cache: Dictionary<String, DateFormatter>? = threadDictionary.object(forKey: formatterCacheKey) as? Dictionary<String, DateFormatter>
Expand Down
4 changes: 2 additions & 2 deletions ELFoundation/Utilities/Swizzling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Foundation
*/
public extension NSObject {
/// Swizzles a class method on an Objective-C object.
public class func swizzleClassMethod(_ originalSelector: Selector, swizzledSelector:Selector) {
class func swizzleClassMethod(_ originalSelector: Selector, swizzledSelector:Selector) {
if let c: AnyClass = object_getClass(self) {
let originalMethod = class_getClassMethod(c, originalSelector)
let swizzledMethod = class_getClassMethod(c, swizzledSelector)
Expand All @@ -33,7 +33,7 @@ public extension NSObject {
}

/// Swizzles an instance method on an Objective-C object.
public class func swizzleInstanceMethod(_ originalSelector: Selector, swizzledSelector:Selector) {
class func swizzleInstanceMethod(_ originalSelector: Selector, swizzledSelector:Selector) {
let originalMethod = class_getInstanceMethod(self, originalSelector)
let swizzledMethod = class_getInstanceMethod(self, swizzledSelector)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ELFoundation is a collection of Swift utilities for iOS development.

## Requirements

ELFoundation requires Swift 4 and Xcode 9.2.
ELFoundation requires Swift 5 and Xcode 10.2.

## Installation

Expand Down

0 comments on commit e34e4e4

Please sign in to comment.