Migrates to Swift 4.2 via Xcode 10.1 migrator
This commit is contained in:
parent
15b23c13e7
commit
ba653037b1
@ -749,7 +749,7 @@
|
|||||||
BFFA71D61AAC406100EE9DD1 = {
|
BFFA71D61AAC406100EE9DD1 = {
|
||||||
CreatedOnToolsVersion = 6.3;
|
CreatedOnToolsVersion = 6.3;
|
||||||
DevelopmentTeam = 6XVY5G3U44;
|
DevelopmentTeam = 6XVY5G3U44;
|
||||||
LastSwiftMigration = 0900;
|
LastSwiftMigration = 1010;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
SystemCapabilities = {
|
SystemCapabilities = {
|
||||||
com.apple.iCloud = {
|
com.apple.iCloud = {
|
||||||
@ -1145,8 +1145,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 = Off;
|
SWIFT_VERSION = 4.2;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@ -1167,8 +1166,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 = Off;
|
SWIFT_VERSION = 4.2;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0910"
|
LastUpgradeVersion = "1010"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "NO"
|
parallelizeBuildables = "NO"
|
||||||
@ -96,7 +96,6 @@
|
|||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
language = ""
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
<Testables>
|
<Testables>
|
||||||
</Testables>
|
</Testables>
|
||||||
@ -116,7 +115,6 @@
|
|||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
language = ""
|
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
|||||||
8
Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Normal file
8
Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
|
|
||||||
private let deepLinkController = DeepLinkController()
|
private let deepLinkController = DeepLinkController()
|
||||||
|
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
|
||||||
{
|
{
|
||||||
Fabric.with([Crashlytics.self])
|
Fabric.with([Crashlytics.self])
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ extension AppDelegate
|
|||||||
|
|
||||||
extension AppDelegate
|
extension AppDelegate
|
||||||
{
|
{
|
||||||
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool
|
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool
|
||||||
{
|
{
|
||||||
return self.openURL(url)
|
return self.openURL(url)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ extension Action
|
|||||||
case destructive
|
case destructive
|
||||||
case selected
|
case selected
|
||||||
|
|
||||||
var alertActionStyle: UIAlertActionStyle
|
var alertActionStyle: UIAlertAction.Style
|
||||||
{
|
{
|
||||||
switch self
|
switch self
|
||||||
{
|
{
|
||||||
@ -27,7 +27,7 @@ extension Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var previewActionStyle: UIPreviewActionStyle?
|
var previewActionStyle: UIPreviewAction.Style?
|
||||||
{
|
{
|
||||||
switch self
|
switch self
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ extension RangeReplaceableCollection where Iterator.Element == Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
var previewActions: [UIPreviewAction] {
|
var previewActions: [UIPreviewAction] {
|
||||||
let actions = self.flatMap { UIPreviewAction($0) }
|
let actions = self.compactMap { UIPreviewAction($0) }
|
||||||
return actions
|
return actions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
|
|
||||||
extension UINavigationBar
|
extension UINavigationBar
|
||||||
{
|
{
|
||||||
fileprivate var defaultTitleTextAttributes: [NSAttributedStringKey: Any]? {
|
fileprivate var defaultTitleTextAttributes: [NSAttributedString.Key: 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
|
||||||
}
|
}
|
||||||
|
|
||||||
private var _defaultTitleTextAttributes: [NSAttributedStringKey: Any]? {
|
private var _defaultTitleTextAttributes: [NSAttributedString.Key: Any]? {
|
||||||
guard self.titleTextAttributes == nil else { return self.titleTextAttributes }
|
guard self.titleTextAttributes == nil else { return self.titleTextAttributes }
|
||||||
|
|
||||||
guard
|
guard
|
||||||
@ -71,7 +71,7 @@ class PopoverMenuButton: UIControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
override var intrinsicContentSize: CGSize {
|
override var intrinsicContentSize: CGSize {
|
||||||
return self.stackView.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
return self.stackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
@ -90,7 +90,7 @@ class PopoverMenuButton: UIControl
|
|||||||
self.stackView.spacing = 4.0
|
self.stackView.spacing = 4.0
|
||||||
self.stackView.isUserInteractionEnabled = false
|
self.stackView.isUserInteractionEnabled = false
|
||||||
|
|
||||||
let intrinsicContentSize = self.stackView.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
let intrinsicContentSize = self.stackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
super.init(frame: CGRect(origin: .zero, size: intrinsicContentSize))
|
super.init(frame: CGRect(origin: .zero, size: intrinsicContentSize))
|
||||||
|
|
||||||
self.addSubview(self.stackView, pinningEdgesWith: .zero)
|
self.addSubview(self.stackView, pinningEdgesWith: .zero)
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class GamesDatabaseBrowserViewController: UITableViewController
|
|||||||
|
|
||||||
private let dataSource: RSTArrayTableViewPrefetchingDataSource<GameMetadata, UIImage>
|
private let dataSource: RSTArrayTableViewPrefetchingDataSource<GameMetadata, UIImage>
|
||||||
|
|
||||||
override init(style: UITableViewStyle) {
|
override init(style: UITableView.Style) {
|
||||||
fatalError()
|
fatalError()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,11 +29,11 @@ extension UIApplicationShortcutItem
|
|||||||
{
|
{
|
||||||
convenience init(localizedTitle: String, action: DeepLink.Action)
|
convenience init(localizedTitle: String, action: DeepLink.Action)
|
||||||
{
|
{
|
||||||
var userInfo: [AnyHashable: Any]?
|
var userInfo: [String: NSSecureCoding]?
|
||||||
|
|
||||||
switch action
|
switch action
|
||||||
{
|
{
|
||||||
case .launchGame(let identifier): userInfo = [DeepLink.Key.identifier.rawValue: identifier]
|
case .launchGame(let identifier): userInfo = [DeepLink.Key.identifier.rawValue: identifier as NSString]
|
||||||
}
|
}
|
||||||
|
|
||||||
self.init(type: action.type.rawValue, localizedTitle: localizedTitle, localizedSubtitle: nil, icon: nil, userInfo: userInfo)
|
self.init(type: action.type.rawValue, localizedTitle: localizedTitle, localizedSubtitle: nil, icon: nil, userInfo: userInfo)
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class GameViewController: DeltaCore.GameViewController
|
|||||||
|
|
||||||
private var _isLoadingSaveState = false
|
private var _isLoadingSaveState = false
|
||||||
|
|
||||||
private var context = CIContext(options: [kCIContextWorkingColorSpace: NSNull()])
|
private var context = CIContext(options: convertToOptionalCIContextOptionDictionary([convertFromCIContextOption(CIContextOption.workingColorSpace): NSNull()]))
|
||||||
|
|
||||||
// Sustain Buttons
|
// Sustain Buttons
|
||||||
private var isSelectingSustainedButtons = false
|
private var isSelectingSustainedButtons = false
|
||||||
@ -140,7 +140,7 @@ class GameViewController: DeltaCore.GameViewController
|
|||||||
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.updateControllers), name: .externalGameControllerDidConnect, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.updateControllers), name: .externalGameControllerDidConnect, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.updateControllers), name: .externalGameControllerDidDisconnect, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.updateControllers), name: .externalGameControllerDidDisconnect, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.didEnterBackground(with:)), name: .UIApplicationDidEnterBackground, object: UIApplication.shared)
|
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.didEnterBackground(with:)), name: UIApplication.didEnterBackgroundNotification, object: UIApplication.shared)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.settingsDidChange(with:)), name: .settingsDidChange, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.settingsDidChange(with:)), name: .settingsDidChange, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.deepLinkControllerLaunchGame(with:)), name: .deepLinkControllerLaunchGame, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.deepLinkControllerLaunchGame(with:)), name: .deepLinkControllerLaunchGame, object: nil)
|
||||||
}
|
}
|
||||||
@ -592,7 +592,7 @@ extension GameViewController: SaveStatesViewControllerDelegate
|
|||||||
if
|
if
|
||||||
let outputImage = self.gameView.outputImage,
|
let outputImage = self.gameView.outputImage,
|
||||||
let quartzImage = self.context.createCGImage(outputImage, from: outputImage.extent),
|
let quartzImage = self.context.createCGImage(outputImage, from: outputImage.extent),
|
||||||
let data = UIImagePNGRepresentation(UIImage(cgImage: quartzImage))
|
let data = UIImage(cgImage: quartzImage).pngData()
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -939,7 +939,7 @@ private extension GameViewController
|
|||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
let navigationController = self.presentedViewController as? UINavigationController,
|
let navigationController = self.presentedViewController as? UINavigationController,
|
||||||
let pageViewController = navigationController.topViewController?.childViewControllers.first as? UIPageViewController,
|
let pageViewController = navigationController.topViewController?.children.first as? UIPageViewController,
|
||||||
let gameCollectionViewController = pageViewController.viewControllers?.first as? GameCollectionViewController
|
let gameCollectionViewController = pageViewController.viewControllers?.first as? GameCollectionViewController
|
||||||
{
|
{
|
||||||
let segue = UIStoryboardSegue(identifier: "unwindFromGames", source: gameCollectionViewController, destination: self)
|
let segue = UIStoryboardSegue(identifier: "unwindFromGames", source: gameCollectionViewController, destination: self)
|
||||||
@ -949,3 +949,14 @@ private extension GameViewController
|
|||||||
self.dismiss(animated: true, completion: nil)
|
self.dismiss(animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function inserted by Swift 4.2 migrator.
|
||||||
|
fileprivate func convertToOptionalCIContextOptionDictionary(_ input: [String: Any]?) -> [CIContextOption: Any]? {
|
||||||
|
guard let input = input else { return nil }
|
||||||
|
return Dictionary(uniqueKeysWithValues: input.map { key, value in (CIContextOption(rawValue: key), value)})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function inserted by Swift 4.2 migrator.
|
||||||
|
fileprivate func convertFromCIContextOption(_ input: CIContextOption) -> String {
|
||||||
|
return input.rawValue
|
||||||
|
}
|
||||||
|
|||||||
@ -529,7 +529,7 @@ extension GameCollectionViewController: ImportControllerDelegate
|
|||||||
if
|
if
|
||||||
let image = UIImage(data: imageData),
|
let image = UIImage(data: imageData),
|
||||||
let resizedImage = image.resizing(toFit: CGSize(width: 300, height: 300)),
|
let resizedImage = image.resizing(toFit: CGSize(width: 300, height: 300)),
|
||||||
let resizedData = UIImageJPEGRepresentation(resizedImage, 0.85)
|
let resizedData = resizedImage.jpegData(compressionQuality: 0.85)
|
||||||
{
|
{
|
||||||
let destinationURL = DatabaseManager.artworkURL(for: game)
|
let destinationURL = DatabaseManager.artworkURL(for: game)
|
||||||
try resizedData.write(to: destinationURL, options: .atomic)
|
try resizedData.write(to: destinationURL, options: .atomic)
|
||||||
@ -661,7 +661,7 @@ extension GameCollectionViewController: UICollectionViewDelegateFlowLayout
|
|||||||
|
|
||||||
self.configure(self.prototypeCell, for: indexPath)
|
self.configure(self.prototypeCell, for: indexPath)
|
||||||
|
|
||||||
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,12 @@ class PhotoLibraryImportOption: NSObject, ImportOption
|
|||||||
|
|
||||||
extension PhotoLibraryImportOption: UIImagePickerControllerDelegate, UINavigationControllerDelegate
|
extension PhotoLibraryImportOption: UIImagePickerControllerDelegate, UINavigationControllerDelegate
|
||||||
{
|
{
|
||||||
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])
|
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
|
||||||
{
|
{
|
||||||
guard let image = info[UIImagePickerControllerOriginalImage] as? UIImage, let data = UIImageJPEGRepresentation(image, 0.85) else {
|
// Local variable inserted by Swift 4.2 migrator.
|
||||||
|
let info = convertFromUIImagePickerControllerInfoKeyDictionary(info)
|
||||||
|
|
||||||
|
guard let image = info[convertFromUIImagePickerControllerInfoKey(UIImagePickerController.InfoKey.originalImage)] as? UIImage, let data = image.jpegData(compressionQuality: 0.85) else {
|
||||||
self.completionHandler?([])
|
self.completionHandler?([])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -59,3 +62,13 @@ extension PhotoLibraryImportOption: UIImagePickerControllerDelegate, UINavigatio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function inserted by Swift 4.2 migrator.
|
||||||
|
fileprivate func convertFromUIImagePickerControllerInfoKeyDictionary(_ input: [UIImagePickerController.InfoKey: Any]) -> [String: Any] {
|
||||||
|
return Dictionary(uniqueKeysWithValues: input.map {key, value in (key.rawValue, value)})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function inserted by Swift 4.2 migrator.
|
||||||
|
fileprivate func convertFromUIImagePickerControllerInfoKey(_ input: UIImagePickerController.InfoKey) -> String {
|
||||||
|
return input.rawValue
|
||||||
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class LaunchViewController: UIViewController
|
|||||||
return self.gameViewController?.prefersStatusBarHidden ?? false
|
return self.gameViewController?.prefersStatusBarHidden ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
override func childViewControllerForHomeIndicatorAutoHidden() -> UIViewController? {
|
override var childForHomeIndicatorAutoHidden: UIViewController? {
|
||||||
return self.gameViewController
|
return self.gameViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ class LaunchViewController: UIViewController
|
|||||||
|
|
||||||
func showGameViewController()
|
func showGameViewController()
|
||||||
{
|
{
|
||||||
self.view.bringSubview(toFront: self.gameViewContainerView)
|
self.view.bringSubviewToFront(self.gameViewContainerView)
|
||||||
|
|
||||||
self.setNeedsStatusBarAppearanceUpdate()
|
self.setNeedsStatusBarAppearanceUpdate()
|
||||||
|
|
||||||
|
|||||||
@ -13,9 +13,9 @@ import DeltaCore
|
|||||||
|
|
||||||
import Roxas
|
import Roxas
|
||||||
|
|
||||||
private extension NSAttributedStringKey
|
private extension NSAttributedString.Key
|
||||||
{
|
{
|
||||||
static let cheatPrefix = NSAttributedStringKey("CheatPrefix")
|
static let cheatPrefix = NSAttributedString.Key("CheatPrefix")
|
||||||
}
|
}
|
||||||
|
|
||||||
class CheatTextView: UITextView
|
class CheatTextView: UITextView
|
||||||
|
|||||||
@ -181,7 +181,7 @@ extension CheatsViewController
|
|||||||
return [deleteAction, editAction]
|
return [deleteAction, editAction]
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath)
|
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)
|
||||||
{
|
{
|
||||||
// This method intentionally left blank because someone decided it was a Good Idea™ to require this method be implemented to use UITableViewRowActions
|
// This method intentionally left blank because someone decided it was a Good Idea™ to require this method be implemented to use UITableViewRowActions
|
||||||
}
|
}
|
||||||
|
|||||||
@ -382,7 +382,7 @@ 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 attributes = Dictionary(uniqueKeysWithValues: textView.typingAttributes.map { (key, value) in (NSAttributedStringKey(key), value) })
|
let attributes = Dictionary(uniqueKeysWithValues: convertFromNSAttributedStringKeyDictionary(textView.typingAttributes).map { (key, value) in (NSAttributedString.Key(key), value) })
|
||||||
|
|
||||||
let attributedString = NSAttributedString(string: sanitizedText, attributes: attributes)
|
let attributedString = NSAttributedString(string: sanitizedText, attributes: attributes)
|
||||||
textView.textStorage.replaceCharacters(in: range, with: attributedString)
|
textView.textStorage.replaceCharacters(in: range, with: attributedString)
|
||||||
@ -393,3 +393,8 @@ extension EditCheatViewController: UITextViewDelegate
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function inserted by Swift 4.2 migrator.
|
||||||
|
fileprivate func convertFromNSAttributedStringKeyDictionary(_ input: [NSAttributedString.Key: Any]) -> [String: Any] {
|
||||||
|
return Dictionary(uniqueKeysWithValues: input.map {key, value in (key.rawValue, value)})
|
||||||
|
}
|
||||||
|
|||||||
@ -145,7 +145,7 @@ extension GridMenuViewController: UICollectionViewDelegateFlowLayout
|
|||||||
{
|
{
|
||||||
self.configure(self.prototypeCell, for: indexPath)
|
self.configure(self.prototypeCell, for: indexPath)
|
||||||
|
|
||||||
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class PauseViewController: UIViewController, PauseInfoProviding
|
|||||||
}
|
}
|
||||||
|
|
||||||
var pauseItems: [MenuItem] {
|
var pauseItems: [MenuItem] {
|
||||||
return [self.saveStateItem, self.loadStateItem, self.cheatCodesItem, self.fastForwardItem, self.sustainButtonsItem].flatMap { $0 }
|
return [self.saveStateItem, self.loadStateItem, self.cheatCodesItem, self.fastForwardItem, self.sustainButtonsItem].compactMap { $0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Pause Items
|
/// Pause Items
|
||||||
@ -115,7 +115,7 @@ extension PauseViewController
|
|||||||
|
|
||||||
extension PauseViewController: UINavigationControllerDelegate
|
extension PauseViewController: UINavigationControllerDelegate
|
||||||
{
|
{
|
||||||
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?
|
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?
|
||||||
{
|
{
|
||||||
let transitionCoordinator = PauseTransitionCoordinator(presentationController: self.presentationController!)
|
let transitionCoordinator = PauseTransitionCoordinator(presentationController: self.presentationController!)
|
||||||
transitionCoordinator.presenting = (operation == .push)
|
transitionCoordinator.presenting = (operation == .push)
|
||||||
|
|||||||
@ -677,7 +677,7 @@ extension SaveStatesViewController: UICollectionViewDelegateFlowLayout
|
|||||||
{
|
{
|
||||||
self.configure(self.prototypeCell, for: indexPath)
|
self.configure(self.prototypeCell, for: indexPath)
|
||||||
|
|
||||||
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -685,7 +685,7 @@ extension SaveStatesViewController: UICollectionViewDelegateFlowLayout
|
|||||||
{
|
{
|
||||||
self.configure(self.prototypeHeader, forSection: section)
|
self.configure(self.prototypeHeader, forSection: section)
|
||||||
|
|
||||||
let size = self.prototypeHeader.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
|
let size = self.prototypeHeader.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,7 +281,7 @@ extension AppIconShortcutsViewController
|
|||||||
self.addShortcut(for: game)
|
self.addShortcut(for: game)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath)
|
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)
|
||||||
{
|
{
|
||||||
switch editingStyle
|
switch editingStyle
|
||||||
{
|
{
|
||||||
@ -307,7 +307,7 @@ extension AppIconShortcutsViewController
|
|||||||
return NSLocalizedString("Remove", comment: "")
|
return NSLocalizedString("Remove", comment: "")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle
|
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle
|
||||||
{
|
{
|
||||||
switch indexPath.section
|
switch indexPath.section
|
||||||
{
|
{
|
||||||
|
|||||||
@ -224,7 +224,7 @@ private extension ControllerInputsViewController
|
|||||||
else { return }
|
else { return }
|
||||||
|
|
||||||
// Implicit assumption that all skins used for controller input mapping don't have multiple items with same input.
|
// Implicit assumption that all skins used for controller input mapping don't have multiple items with same input.
|
||||||
let mappedInputs = items.flatMap { $0.inputs.allInputs.flatMap(controllerViewInputMapping.input(forControllerInput:)) } + (self.supportedActionInputs as [Input])
|
let mappedInputs = items.flatMap { $0.inputs.allInputs.compactMap(controllerViewInputMapping.input(forControllerInput:)) } + (self.supportedActionInputs as [Input])
|
||||||
|
|
||||||
// Create callout view for each on-screen input.
|
// Create callout view for each on-screen input.
|
||||||
for input in mappedInputs
|
for input in mappedInputs
|
||||||
|
|||||||
@ -307,7 +307,7 @@ extension ControllersSettingsViewController
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
return UITableViewAutomaticDimension
|
return UITableView.automaticDimension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class SettingsViewController: UITableViewController
|
|||||||
{
|
{
|
||||||
// Update and temporarily re-select selected row.
|
// Update and temporarily re-select selected row.
|
||||||
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
self.tableView.reloadSections(IndexSet(integer: Section.controllers.rawValue), with: .none)
|
||||||
self.tableView.selectRow(at: indexPath, animated: false, scrollPosition: UITableViewScrollPosition.none)
|
self.tableView.selectRow(at: indexPath, animated: false, scrollPosition: UITableView.ScrollPosition.none)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.tableView.deselectRow(at: indexPath, animated: true)
|
self.tableView.deselectRow(at: indexPath, animated: true)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user