Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates project to 10.2 and Swift 5.0 #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Xcode
#
build/
DerivedData/

*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -18,6 +20,14 @@ DerivedData
*.xcscmblueprint
*.xcuserstate


### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
Expand Down
31 changes: 16 additions & 15 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 @@ -418,16 +418,17 @@
};
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 @@ -624,7 +626,7 @@
ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0.1;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -646,7 +648,7 @@
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 +665,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 +832,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 @@ -879,7 +881,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0.1;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -890,6 +892,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 @@ -932,7 +935,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0.1;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -955,7 +958,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -974,7 +977,7 @@
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 +994,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 +1007,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
4 changes: 2 additions & 2 deletions ELFoundation_osx/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<string>3.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 WalmartLabs. All rights reserved.</string>
<string>Copyright © 2019 WalmartLabs. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
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