Migrates to Swift 4 via Xcode migrator
This commit is contained in:
parent
df0c307be4
commit
d709204107
@ -1 +1 @@
|
||||
Subproject commit 6e0ec5aedac746d1a5ea05d450884f1a9ad7b509
|
||||
Subproject commit 97d29d5eaaf4bd2310464ca6d4f91a85dcbf4e2e
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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<CGGlyph>, properties props: UnsafePointer<NSGlyphProperty>, characterIndexes charIndexes: UnsafePointer<Int>, font aFont: UIFont, forGlyphRange glyphRange: NSRange) -> Int
|
||||
func layoutManager(_ layoutManager: NSLayoutManager, shouldGenerateGlyphs glyphs: UnsafePointer<CGGlyph>, properties props: UnsafePointer<NSLayoutManager.GlyphProperty>, characterIndexes charIndexes: UnsafePointer<Int>, 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<CGGlyph>.allocate(capacity: bufferSize)
|
||||
let propertyBuffer = UnsafeMutablePointer<NSGlyphProperty>.allocate(capacity: bufferSize)
|
||||
let propertyBuffer = UnsafeMutablePointer<NSLayoutManager.GlyphProperty>.allocate(capacity: bufferSize)
|
||||
let characterBuffer = UnsafeMutablePointer<Int>.allocate(capacity: bufferSize)
|
||||
|
||||
var offset = 0
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 }
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user