Manually fixes Swift 4 migrator errors
This commit is contained in:
parent
d709204107
commit
fb5036acf8
@ -1 +1 @@
|
|||||||
Subproject commit 97d29d5eaaf4bd2310464ca6d4f91a85dcbf4e2e
|
Subproject commit 1d74f647aaeec653a3ab55d7c06a0b3c0dc95069
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 56401b9649f8abe971e3a66be1a3bb2cd984a1a0
|
Subproject commit 588e1183800e6d49950d833ddb6ac43e08e33424
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 4e678e7eac511d342aab86522eede9fdb7b29108
|
Subproject commit 2a735d63e331e54935e2d9e997ab096631d3110f
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 394627784bd0643c26e0fc95feafa5c960786a7c
|
Subproject commit cde0fe0b39d9cfc97a0152116a0f0d607a6532cd
|
||||||
@ -1098,7 +1098,7 @@
|
|||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.0;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -1120,7 +1120,7 @@
|
|||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.0;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ extension AppDelegate
|
|||||||
{
|
{
|
||||||
self.window?.tintColor = UIColor.deltaPurple
|
self.window?.tintColor = UIColor.deltaPurple
|
||||||
|
|
||||||
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes[NSAttributedStringKey.foregroundColor] = UIColor.white
|
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes[NSAttributedStringKey.foregroundColor.rawValue] = UIColor.white
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
|
|
||||||
extension UINavigationBar
|
extension UINavigationBar
|
||||||
{
|
{
|
||||||
fileprivate var defaultTitleTextAttributes: [String: Any]? {
|
fileprivate var defaultTitleTextAttributes: [NSAttributedStringKey: Any]? {
|
||||||
if let textAttributes = self._defaultTitleTextAttributes
|
if let textAttributes = self._defaultTitleTextAttributes
|
||||||
{
|
{
|
||||||
return textAttributes
|
return textAttributes
|
||||||
@ -35,7 +35,7 @@ extension UINavigationBar
|
|||||||
return textAttributes
|
return textAttributes
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate var _defaultTitleTextAttributes: [String: Any]? {
|
fileprivate var _defaultTitleTextAttributes: [NSAttributedStringKey: Any]? {
|
||||||
guard self.titleTextAttributes == nil else { return self.titleTextAttributes }
|
guard self.titleTextAttributes == nil else { return self.titleTextAttributes }
|
||||||
|
|
||||||
guard
|
guard
|
||||||
|
|||||||
@ -18,7 +18,7 @@ internal extension UILabel
|
|||||||
context.minimumScaleFactor = self.minimumScaleFactor
|
context.minimumScaleFactor = self.minimumScaleFactor
|
||||||
|
|
||||||
// Using self.attributedString returns incorrect calculations, so we create our own attributed string
|
// Using self.attributedString returns incorrect calculations, so we create our own attributed string
|
||||||
let attributedString = NSAttributedString(string: text, attributes: [NSAttributedStringKey.font: self.font])
|
let attributedString = NSAttributedString(string: text, attributes: [.font: self.font])
|
||||||
attributedString.boundingRect(with: self.bounds.size, options: [.usesLineFragmentOrigin, .usesFontLeading], context: context)
|
attributedString.boundingRect(with: self.bounds.size, options: [.usesLineFragmentOrigin, .usesFontLeading], context: context)
|
||||||
|
|
||||||
let scaleFactor = context.actualScaleFactor
|
let scaleFactor = context.actualScaleFactor
|
||||||
|
|||||||
@ -13,7 +13,10 @@ import DeltaCore
|
|||||||
|
|
||||||
import Roxas
|
import Roxas
|
||||||
|
|
||||||
private let CheatPrefixAttribute = "prefix"
|
private extension NSAttributedStringKey
|
||||||
|
{
|
||||||
|
static let cheatPrefix = NSAttributedStringKey("CheatPrefix")
|
||||||
|
}
|
||||||
|
|
||||||
class CheatTextView: UITextView
|
class CheatTextView: UITextView
|
||||||
{
|
{
|
||||||
@ -44,7 +47,7 @@ extension CheatTextView
|
|||||||
|
|
||||||
if let format = self.cheatFormat, let font = self.font
|
if let format = self.cheatFormat, let font = self.font
|
||||||
{
|
{
|
||||||
let characterWidth = ("A" as NSString).size(withAttributes: [NSAttributedStringKey.font: font]).width
|
let characterWidth = ("A" as NSString).size(withAttributes: [.font: font]).width
|
||||||
|
|
||||||
let width = characterWidth * CGFloat(format.format.characters.count)
|
let width = characterWidth * CGFloat(format.format.characters.count)
|
||||||
self.textContainer.size = CGSize(width: width, height: 0)
|
self.textContainer.size = CGSize(width: width, height: 0)
|
||||||
@ -79,7 +82,7 @@ private extension CheatTextView
|
|||||||
|
|
||||||
if let prefixString = prefixString, prefixString.length > 0
|
if let prefixString = prefixString, prefixString.length > 0
|
||||||
{
|
{
|
||||||
attributedString.addAttribute(NSAttributedStringKey(rawValue: CheatPrefixAttribute), value: prefixString, range: NSRange(location: 0, length: 1))
|
attributedString.addAttribute(.cheatPrefix, value: prefixString, range: NSRange(location: 0, length: 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
attributedFormat.append(attributedString)
|
attributedFormat.append(attributedString)
|
||||||
@ -128,7 +131,7 @@ extension CheatTextView: NSLayoutManagerDelegate
|
|||||||
// The index the actual character maps to in the cheat format
|
// The index the actual character maps to in the cheat format
|
||||||
let characterIndex = charIndexes[i] % attributedFormat.length
|
let characterIndex = charIndexes[i] % attributedFormat.length
|
||||||
|
|
||||||
if let prefix = attributedFormat.attributes(at: characterIndex, effectiveRange: nil)[CheatPrefixAttribute] as? String
|
if let prefix = attributedFormat.attributes(at: characterIndex, effectiveRange: nil)[.cheatPrefix] as? String
|
||||||
{
|
{
|
||||||
// If there is a prefix string, we insert the glyphs (and associated properties/character indexes) first
|
// If there is a prefix string, we insert the glyphs (and associated properties/character indexes) first
|
||||||
let prefixCount = prefix.characters.count
|
let prefixCount = prefix.characters.count
|
||||||
|
|||||||
@ -382,7 +382,9 @@ extension EditCheatViewController: UITextViewDelegate
|
|||||||
|
|
||||||
// We need to manually add back the attributes when manually modifying the underlying text storage
|
// We need to manually add back the attributes when manually modifying the underlying text storage
|
||||||
// Otherwise, pasting text into an empty text view will result in the wrong font being used
|
// Otherwise, pasting text into an empty text view will result in the wrong font being used
|
||||||
let attributedString = NSAttributedString(string: sanitizedText, attributes: textView.typingAttributes)
|
let attributes = Dictionary(uniqueKeysWithValues: textView.typingAttributes.map { (key, value) in (NSAttributedStringKey(key), value) })
|
||||||
|
|
||||||
|
let attributedString = NSAttributedString(string: sanitizedText, attributes: attributes)
|
||||||
textView.textStorage.replaceCharacters(in: range, with: attributedString)
|
textView.textStorage.replaceCharacters(in: range, with: attributedString)
|
||||||
|
|
||||||
// We must add attributedString.length, not range.length, in case the attributed string's length differs
|
// We must add attributedString.length, not range.length, in case the attributed string's length differs
|
||||||
|
|||||||
@ -174,7 +174,7 @@ private extension ControllersSettingsViewController
|
|||||||
|
|
||||||
private extension ControllersSettingsViewController
|
private extension ControllersSettingsViewController
|
||||||
{
|
{
|
||||||
@objc dynamic func externalGameControllerDidConnect(_ notification: Notification)
|
@objc func externalGameControllerDidConnect(_ notification: Notification)
|
||||||
{
|
{
|
||||||
guard let controller = notification.object as? GameController else { return }
|
guard let controller = notification.object as? GameController else { return }
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ private extension ControllersSettingsViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc dynamic func externalGameControllerDidDisconnect(_ notification: Notification)
|
@objc func externalGameControllerDidDisconnect(_ notification: Notification)
|
||||||
{
|
{
|
||||||
guard let controller = notification.object as? GameController else { return }
|
guard let controller = notification.object as? GameController else { return }
|
||||||
|
|
||||||
|
|||||||
@ -153,12 +153,12 @@ private extension SettingsViewController
|
|||||||
|
|
||||||
private extension SettingsViewController
|
private extension SettingsViewController
|
||||||
{
|
{
|
||||||
@objc dynamic func externalGameControllerDidConnect(_ notification: Notification)
|
@objc func externalGameControllerDidConnect(_ notification: Notification)
|
||||||
{
|
{
|
||||||
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc dynamic func externalGameControllerDidDisconnect(_ notification: Notification)
|
@objc func externalGameControllerDidDisconnect(_ notification: Notification)
|
||||||
{
|
{
|
||||||
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user