diff --git a/.swift-version b/.swift-version index 5186d07..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 +5.0 diff --git a/Digger.xcodeproj/project.pbxproj b/Digger.xcodeproj/project.pbxproj index d2c30a9..418745d 100644 --- a/Digger.xcodeproj/project.pbxproj +++ b/Digger.xcodeproj/project.pbxproj @@ -114,12 +114,12 @@ EDBFF9851FA9ADEF00967C52 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = github.cornerant; TargetAttributes = { EDBFF98D1FA9ADEF00967C52 = { CreatedOnToolsVersion = 9.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; }; @@ -130,6 +130,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = EDBFF9841FA9ADEF00967C52; productRefGroup = EDBFF98F1FA9ADEF00967C52 /* Products */; @@ -184,6 +185,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -191,6 +193,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -244,6 +247,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -251,6 +255,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -302,7 +307,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -325,7 +330,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Digger.xcodeproj/xcshareddata/xcschemes/Digger.xcscheme b/Digger.xcodeproj/xcshareddata/xcschemes/Digger.xcscheme index 439534a..664952b 100644 --- a/Digger.xcodeproj/xcshareddata/xcschemes/Digger.xcscheme +++ b/Digger.xcodeproj/xcshareddata/xcschemes/Digger.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 5183212..99fc56c 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + DCD7EB20942117F1CE93CBC9 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F64FE8FFA120DE9E047FE9 /* Pods_Example.framework */; }; ED72D20C1FA9BCE90068EDFC /* Example.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED72D20B1FA9BCE90068EDFC /* Example.xcassets */; }; EDBFF95C1FA9587E00967C52 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDBFF95B1FA9587E00967C52 /* AppDelegate.swift */; }; EDBFF9611FA9587E00967C52 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDBFF95F1FA9587E00967C52 /* Main.storyboard */; }; @@ -39,6 +40,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 9D43B81FBD29C3970C1AF270 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; + D3AA581ADA161EA91030F406 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; + E7F64FE8FFA120DE9E047FE9 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; ED0978E21FAAA1E8008A64E0 /* Digger.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Digger.xcodeproj; path = ../Digger.xcodeproj; sourceTree = ""; }; ED72D20B1FA9BCE90068EDFC /* Example.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Example.xcassets; sourceTree = ""; }; EDBFF9581FA9587E00967C52 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,12 +59,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DCD7EB20942117F1CE93CBC9 /* Pods_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 4DB09E739D7B00A4A102C977 /* Pods */ = { + isa = PBXGroup; + children = ( + D3AA581ADA161EA91030F406 /* Pods-Example.debug.xcconfig */, + 9D43B81FBD29C3970C1AF270 /* Pods-Example.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; ED0978E31FAAA1E8008A64E0 /* Products */ = { isa = PBXGroup; children = ( @@ -75,6 +89,8 @@ EDBFF95A1FA9587E00967C52 /* Example */, EDBFF9591FA9587E00967C52 /* Products */, ED0978E21FAAA1E8008A64E0 /* Digger.xcodeproj */, + 4DB09E739D7B00A4A102C977 /* Pods */, + F4CA34347E7A9D6FF16B9A04 /* Frameworks */, ); sourceTree = ""; }; @@ -100,6 +116,14 @@ path = Example; sourceTree = ""; }; + F4CA34347E7A9D6FF16B9A04 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E7F64FE8FFA120DE9E047FE9 /* Pods_Example.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -107,10 +131,12 @@ isa = PBXNativeTarget; buildConfigurationList = EDBFF96A1FA9587E00967C52 /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( + A7FBD5BD329CEBFBA70B79C6 /* [CP] Check Pods Manifest.lock */, EDBFF9541FA9587E00967C52 /* Sources */, EDBFF9551FA9587E00967C52 /* Frameworks */, EDBFF9561FA9587E00967C52 /* Resources */, EDBFF9811FA998E800967C52 /* Embed Frameworks */, + 3120C307062E3CFC7A74CC67 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -133,6 +159,7 @@ TargetAttributes = { EDBFF9571FA9587E00967C52 = { CreatedOnToolsVersion = 9.0; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; }; @@ -184,6 +211,53 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 3120C307062E3CFC7A74CC67 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Digger/Digger.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Digger.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A7FBD5BD329CEBFBA70B79C6 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ EDBFF9541FA9587E00967C52 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -326,6 +400,7 @@ }; EDBFF96B1FA9587E00967C52 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D3AA581ADA161EA91030F406 /* Pods-Example.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -336,13 +411,14 @@ PRODUCT_BUNDLE_IDENTIFIER = github.cornerant.Digger; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; EDBFF96C1FA9587E00967C52 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9D43B81FBD29C3970C1AF270 /* Pods-Example.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -353,7 +429,7 @@ PRODUCT_BUNDLE_IDENTIFIER = github.cornerant.Digger; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift index 1a7c0d8..5bacc69 100644 --- a/Example/Example/AppDelegate.swift +++ b/Example/Example/AppDelegate.swift @@ -16,7 +16,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 } diff --git a/Example/Example/ExampleController.swift b/Example/Example/ExampleController.swift index 6767e64..4d4c3ad 100644 --- a/Example/Example/ExampleController.swift +++ b/Example/Example/ExampleController.swift @@ -137,7 +137,7 @@ class ExampleController: UITableViewController { return cell } - override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source DiggerManager.shared.cancelTask(for: exmpleArray[indexPath.row]) diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..a83cf9b --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,10 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'Example' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + + # Pods for Example + pod 'Digger' +end diff --git a/Sources/String+Digger.swift b/Sources/String+Digger.swift index 3e416d0..3993771 100755 --- a/Sources/String+Digger.swift +++ b/Sources/String+Digger.swift @@ -68,8 +68,8 @@ func arrayOfBytes(_ value: T, length: Int? = nil) -> [UInt8] { return bytes } - valuePointer.deinitialize() - valuePointer.deallocate(capacity: 1) + valuePointer.deinitialize(count: 1) + valuePointer.deallocate() return bytes }