diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 6e0ec5a..97d29d5 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 6e0ec5aedac746d1a5ea05d450884f1a9ad7b509 +Subproject commit 97d29d5eaaf4bd2310464ca6d4f91a85dcbf4e2e diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 83a47dc..e5d16d4 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -720,7 +720,7 @@ BFFA71D61AAC406100EE9DD1 = { CreatedOnToolsVersion = 6.3; DevelopmentTeam = 6XVY5G3U44; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.iCloud = { @@ -1098,7 +1098,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1119,7 +1120,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Delta/AppDelegate.swift b/Delta/AppDelegate.swift index 99c9a35..2b4d7a7 100644 --- a/Delta/AppDelegate.swift +++ b/Delta/AppDelegate.swift @@ -79,7 +79,7 @@ extension AppDelegate { self.window?.tintColor = UIColor.deltaPurple - UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes[NSForegroundColorAttributeName] = UIColor.white + UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes[NSAttributedStringKey.foregroundColor] = UIColor.white } } diff --git a/Delta/Database/DatabaseManager.swift b/Delta/Database/DatabaseManager.swift index d4b4d98..2b36c14 100644 --- a/Delta/Database/DatabaseManager.swift +++ b/Delta/Database/DatabaseManager.swift @@ -97,7 +97,7 @@ extension DatabaseManager //MARK: - Preparation - private extension DatabaseManager { - func prepareDatabase(completion: @escaping (Void) -> Void) + func prepareDatabase(completion: @escaping () -> Void) { self.performBackgroundTask { (context) in diff --git a/Delta/Extensions/UILabel+FontSize.swift b/Delta/Extensions/UILabel+FontSize.swift index b010932..6390eb6 100644 --- a/Delta/Extensions/UILabel+FontSize.swift +++ b/Delta/Extensions/UILabel+FontSize.swift @@ -18,7 +18,7 @@ internal extension UILabel context.minimumScaleFactor = self.minimumScaleFactor // Using self.attributedString returns incorrect calculations, so we create our own attributed string - let attributedString = NSAttributedString(string: text, attributes: [NSFontAttributeName: self.font]) + let attributedString = NSAttributedString(string: text, attributes: [NSAttributedStringKey.font: self.font]) attributedString.boundingRect(with: self.bounds.size, options: [.usesLineFragmentOrigin, .usesFontLeading], context: context) let scaleFactor = context.actualScaleFactor diff --git a/Delta/Importing/ImportController.swift b/Delta/Importing/ImportController.swift index 8147092..b0fd6ea 100644 --- a/Delta/Importing/ImportController.swift +++ b/Delta/Importing/ImportController.swift @@ -61,7 +61,7 @@ class ImportController: NSObject super.init() } - fileprivate func presentImportController(from presentingViewController: UIViewController, animated: Bool, completionHandler: ((Void) -> Void)?) + fileprivate func presentImportController(from presentingViewController: UIViewController, animated: Bool, completionHandler: (() -> Void)?) { self.presentingViewController = presentingViewController @@ -241,7 +241,7 @@ extension UIViewController } } - func present(_ importController: ImportController, animated: Bool, completion: ((Void) -> Void)?) + func present(_ importController: ImportController, animated: Bool, completion: (() -> Void)?) { self.importController = importController diff --git a/Delta/Pause Menu/Cheats/CheatTextView.swift b/Delta/Pause Menu/Cheats/CheatTextView.swift index 316bcc5..177aea4 100644 --- a/Delta/Pause Menu/Cheats/CheatTextView.swift +++ b/Delta/Pause Menu/Cheats/CheatTextView.swift @@ -44,7 +44,7 @@ extension CheatTextView if let format = self.cheatFormat, let font = self.font { - let characterWidth = ("A" as NSString).size(attributes: [NSFontAttributeName: font]).width + let characterWidth = ("A" as NSString).size(withAttributes: [NSAttributedStringKey.font: font]).width let width = characterWidth * CGFloat(format.format.characters.count) self.textContainer.size = CGSize(width: width, height: 0) @@ -79,7 +79,7 @@ private extension CheatTextView if let prefixString = prefixString, prefixString.length > 0 { - attributedString.addAttribute(CheatPrefixAttribute, value: prefixString, range: NSRange(location: 0, length: 1)) + attributedString.addAttribute(NSAttributedStringKey(rawValue: CheatPrefixAttribute), value: prefixString, range: NSRange(location: 0, length: 1)) } attributedFormat.append(attributedString) @@ -105,7 +105,7 @@ private extension CheatTextView extension CheatTextView: NSLayoutManagerDelegate { - func layoutManager(_ layoutManager: NSLayoutManager, shouldGenerateGlyphs glyphs: UnsafePointer, properties props: UnsafePointer, characterIndexes charIndexes: UnsafePointer, font aFont: UIFont, forGlyphRange glyphRange: NSRange) -> Int + func layoutManager(_ layoutManager: NSLayoutManager, shouldGenerateGlyphs glyphs: UnsafePointer, properties props: UnsafePointer, characterIndexes charIndexes: UnsafePointer, font aFont: UIFont, forGlyphRange glyphRange: NSRange) -> Int { // Returning 0 = let the layoutManager do the normal logic guard let attributedFormat = self.attributedFormat else { return 0 } @@ -118,7 +118,7 @@ extension CheatTextView: NSLayoutManagerDelegate // Allocate our replacement buffers let glyphBuffer = UnsafeMutablePointer.allocate(capacity: bufferSize) - let propertyBuffer = UnsafeMutablePointer.allocate(capacity: bufferSize) + let propertyBuffer = UnsafeMutablePointer.allocate(capacity: bufferSize) let characterBuffer = UnsafeMutablePointer.allocate(capacity: bufferSize) var offset = 0 diff --git a/Delta/Pause Menu/Cheats/EditCheatViewController.swift b/Delta/Pause Menu/Cheats/EditCheatViewController.swift index db04c37..4ca62f7 100644 --- a/Delta/Pause Menu/Cheats/EditCheatViewController.swift +++ b/Delta/Pause Menu/Cheats/EditCheatViewController.swift @@ -325,7 +325,7 @@ private extension EditCheatViewController sender.resignFirstResponder() } - func presentErrorAlert(title: String, message: String, handler: ((Void) -> Void)?) + func presentErrorAlert(title: String, message: String, handler: (() -> Void)?) { DispatchQueue.main.async { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) diff --git a/Delta/Settings/Controllers/ControllersSettingsViewController.swift b/Delta/Settings/Controllers/ControllersSettingsViewController.swift index 8b6d954..f65989c 100644 --- a/Delta/Settings/Controllers/ControllersSettingsViewController.swift +++ b/Delta/Settings/Controllers/ControllersSettingsViewController.swift @@ -174,7 +174,7 @@ private extension ControllersSettingsViewController private extension ControllersSettingsViewController { - dynamic func externalGameControllerDidConnect(_ notification: Notification) + @objc dynamic func externalGameControllerDidConnect(_ notification: Notification) { guard let controller = notification.object as? GameController else { return } @@ -217,7 +217,7 @@ private extension ControllersSettingsViewController } } - dynamic func externalGameControllerDidDisconnect(_ notification: Notification) + @objc dynamic func externalGameControllerDidDisconnect(_ notification: Notification) { guard let controller = notification.object as? GameController else { return } diff --git a/Delta/Settings/SettingsViewController.swift b/Delta/Settings/SettingsViewController.swift index 3f64c4a..7bffae8 100644 --- a/Delta/Settings/SettingsViewController.swift +++ b/Delta/Settings/SettingsViewController.swift @@ -153,12 +153,12 @@ private extension SettingsViewController private extension SettingsViewController { - dynamic func externalGameControllerDidConnect(_ notification: Notification) + @objc dynamic func externalGameControllerDidConnect(_ notification: Notification) { self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none) } - dynamic func externalGameControllerDidDisconnect(_ notification: Notification) + @objc dynamic func externalGameControllerDidDisconnect(_ notification: Notification) { self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none) }