From ba653037b1a43c25d29a006794117ff09033f58b Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 12 Nov 2018 11:45:55 -0800 Subject: [PATCH] Migrates to Swift 4.2 via Xcode 10.1 migrator --- Delta.xcodeproj/project.pbxproj | 8 +++----- .../xcshareddata/xcschemes/Delta.xcscheme | 4 +--- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ Delta/AppDelegate.swift | 4 ++-- Delta/Components/Action.swift | 6 +++--- .../Popover Menu/PopoverMenuButton.swift | 8 ++++---- .../GamesDatabaseBrowserViewController.swift | 2 +- Delta/Deep Linking/DeepLink.swift | 4 ++-- Delta/Emulation/GameViewController.swift | 19 +++++++++++++++---- .../GameCollectionViewController.swift | 4 ++-- .../PhotoLibraryImportOption.swift | 17 +++++++++++++++-- Delta/Launch/LaunchViewController.swift | 4 ++-- Delta/Pause Menu/Cheats/CheatTextView.swift | 4 ++-- .../Cheats/CheatsViewController.swift | 2 +- .../Cheats/EditCheatViewController.swift | 7 ++++++- Delta/Pause Menu/GridMenuViewController.swift | 2 +- Delta/Pause Menu/PauseViewController.swift | 4 ++-- .../SaveStatesViewController.swift | 4 ++-- .../AppIconShortcutsViewController.swift | 4 ++-- .../ControllerInputsViewController.swift | 2 +- .../ControllersSettingsViewController.swift | 2 +- Delta/Settings/SettingsViewController.swift | 2 +- 22 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 1fda36a..b7923a2 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -749,7 +749,7 @@ BFFA71D61AAC406100EE9DD1 = { CreatedOnToolsVersion = 6.3; DevelopmentTeam = 6XVY5G3U44; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.iCloud = { @@ -1145,8 +1145,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1167,8 +1166,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Delta/Supporting Files/Delta-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme index 0bf5efc..adb55e4 100644 --- a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme +++ b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme @@ -1,6 +1,6 @@ @@ -116,7 +115,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Delta.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Delta/AppDelegate.swift b/Delta/AppDelegate.swift index 73d209d..3cd0d61 100644 --- a/Delta/AppDelegate.swift +++ b/Delta/AppDelegate.swift @@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate 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]) @@ -93,7 +93,7 @@ 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) } diff --git a/Delta/Components/Action.swift b/Delta/Components/Action.swift index 34cf937..8385988 100644 --- a/Delta/Components/Action.swift +++ b/Delta/Components/Action.swift @@ -17,7 +17,7 @@ extension Action case destructive case selected - var alertActionStyle: UIAlertActionStyle + var alertActionStyle: UIAlertAction.Style { switch self { @@ -27,7 +27,7 @@ extension Action } } - var previewActionStyle: UIPreviewActionStyle? + var previewActionStyle: UIPreviewAction.Style? { switch self { @@ -90,7 +90,7 @@ extension RangeReplaceableCollection where Iterator.Element == Action } var previewActions: [UIPreviewAction] { - let actions = self.flatMap { UIPreviewAction($0) } + let actions = self.compactMap { UIPreviewAction($0) } return actions } } diff --git a/Delta/Components/Popover Menu/PopoverMenuButton.swift b/Delta/Components/Popover Menu/PopoverMenuButton.swift index e242765..731924a 100644 --- a/Delta/Components/Popover Menu/PopoverMenuButton.swift +++ b/Delta/Components/Popover Menu/PopoverMenuButton.swift @@ -10,7 +10,7 @@ import UIKit extension UINavigationBar { - fileprivate var defaultTitleTextAttributes: [NSAttributedStringKey: Any]? { + fileprivate var defaultTitleTextAttributes: [NSAttributedString.Key: Any]? { if let textAttributes = self._defaultTitleTextAttributes { return textAttributes @@ -35,7 +35,7 @@ extension UINavigationBar return textAttributes } - private var _defaultTitleTextAttributes: [NSAttributedStringKey: Any]? { + private var _defaultTitleTextAttributes: [NSAttributedString.Key: Any]? { guard self.titleTextAttributes == nil else { return self.titleTextAttributes } guard @@ -71,7 +71,7 @@ class PopoverMenuButton: UIControl } override var intrinsicContentSize: CGSize { - return self.stackView.systemLayoutSizeFitting(UILayoutFittingCompressedSize) + return self.stackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) } init() @@ -90,7 +90,7 @@ class PopoverMenuButton: UIControl self.stackView.spacing = 4.0 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)) self.addSubview(self.stackView, pinningEdgesWith: .zero) diff --git a/Delta/Database/OpenVGDB/GamesDatabaseBrowserViewController.swift b/Delta/Database/OpenVGDB/GamesDatabaseBrowserViewController.swift index ef98057..3f9c87f 100644 --- a/Delta/Database/OpenVGDB/GamesDatabaseBrowserViewController.swift +++ b/Delta/Database/OpenVGDB/GamesDatabaseBrowserViewController.swift @@ -19,7 +19,7 @@ class GamesDatabaseBrowserViewController: UITableViewController private let dataSource: RSTArrayTableViewPrefetchingDataSource - override init(style: UITableViewStyle) { + override init(style: UITableView.Style) { fatalError() } diff --git a/Delta/Deep Linking/DeepLink.swift b/Delta/Deep Linking/DeepLink.swift index 0f02379..cb617e3 100644 --- a/Delta/Deep Linking/DeepLink.swift +++ b/Delta/Deep Linking/DeepLink.swift @@ -29,11 +29,11 @@ extension UIApplicationShortcutItem { convenience init(localizedTitle: String, action: DeepLink.Action) { - var userInfo: [AnyHashable: Any]? + var userInfo: [String: NSSecureCoding]? 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) diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index 908eed6..44786dd 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -110,7 +110,7 @@ class GameViewController: DeltaCore.GameViewController private var _isLoadingSaveState = false - private var context = CIContext(options: [kCIContextWorkingColorSpace: NSNull()]) + private var context = CIContext(options: convertToOptionalCIContextOptionDictionary([convertFromCIContextOption(CIContextOption.workingColorSpace): NSNull()])) // Sustain Buttons 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: .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.deepLinkControllerLaunchGame(with:)), name: .deepLinkControllerLaunchGame, object: nil) } @@ -592,7 +592,7 @@ extension GameViewController: SaveStatesViewControllerDelegate if let outputImage = self.gameView.outputImage, let quartzImage = self.context.createCGImage(outputImage, from: outputImage.extent), - let data = UIImagePNGRepresentation(UIImage(cgImage: quartzImage)) + let data = UIImage(cgImage: quartzImage).pngData() { do { @@ -939,7 +939,7 @@ private extension GameViewController } else if 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 segue = UIStoryboardSegue(identifier: "unwindFromGames", source: gameCollectionViewController, destination: self) @@ -949,3 +949,14 @@ private extension GameViewController 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 +} diff --git a/Delta/Game Selection/GameCollectionViewController.swift b/Delta/Game Selection/GameCollectionViewController.swift index f7e53c5..82d275e 100644 --- a/Delta/Game Selection/GameCollectionViewController.swift +++ b/Delta/Game Selection/GameCollectionViewController.swift @@ -529,7 +529,7 @@ extension GameCollectionViewController: ImportControllerDelegate if let image = UIImage(data: imageData), 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) try resizedData.write(to: destinationURL, options: .atomic) @@ -661,7 +661,7 @@ extension GameCollectionViewController: UICollectionViewDelegateFlowLayout self.configure(self.prototypeCell, for: indexPath) - let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize) + let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) return size } } diff --git a/Delta/Importing/Import Options/PhotoLibraryImportOption.swift b/Delta/Importing/Import Options/PhotoLibraryImportOption.swift index 4d5d558..50f8f09 100644 --- a/Delta/Importing/Import Options/PhotoLibraryImportOption.swift +++ b/Delta/Importing/Import Options/PhotoLibraryImportOption.swift @@ -39,9 +39,12 @@ class PhotoLibraryImportOption: NSObject, ImportOption 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?([]) 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 +} diff --git a/Delta/Launch/LaunchViewController.swift b/Delta/Launch/LaunchViewController.swift index 4ea2511..196bbf5 100644 --- a/Delta/Launch/LaunchViewController.swift +++ b/Delta/Launch/LaunchViewController.swift @@ -26,7 +26,7 @@ class LaunchViewController: UIViewController return self.gameViewController?.prefersStatusBarHidden ?? false } - override func childViewControllerForHomeIndicatorAutoHidden() -> UIViewController? { + override var childForHomeIndicatorAutoHidden: UIViewController? { return self.gameViewController } @@ -47,7 +47,7 @@ class LaunchViewController: UIViewController func showGameViewController() { - self.view.bringSubview(toFront: self.gameViewContainerView) + self.view.bringSubviewToFront(self.gameViewContainerView) self.setNeedsStatusBarAppearanceUpdate() diff --git a/Delta/Pause Menu/Cheats/CheatTextView.swift b/Delta/Pause Menu/Cheats/CheatTextView.swift index cafcb6c..970aad4 100644 --- a/Delta/Pause Menu/Cheats/CheatTextView.swift +++ b/Delta/Pause Menu/Cheats/CheatTextView.swift @@ -13,9 +13,9 @@ import DeltaCore import Roxas -private extension NSAttributedStringKey +private extension NSAttributedString.Key { - static let cheatPrefix = NSAttributedStringKey("CheatPrefix") + static let cheatPrefix = NSAttributedString.Key("CheatPrefix") } class CheatTextView: UITextView diff --git a/Delta/Pause Menu/Cheats/CheatsViewController.swift b/Delta/Pause Menu/Cheats/CheatsViewController.swift index db9cf70..2a76541 100644 --- a/Delta/Pause Menu/Cheats/CheatsViewController.swift +++ b/Delta/Pause Menu/Cheats/CheatsViewController.swift @@ -181,7 +181,7 @@ extension CheatsViewController 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 } diff --git a/Delta/Pause Menu/Cheats/EditCheatViewController.swift b/Delta/Pause Menu/Cheats/EditCheatViewController.swift index e36d29e..3f80ba2 100644 --- a/Delta/Pause Menu/Cheats/EditCheatViewController.swift +++ b/Delta/Pause Menu/Cheats/EditCheatViewController.swift @@ -382,7 +382,7 @@ extension EditCheatViewController: UITextViewDelegate // 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 - 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) textView.textStorage.replaceCharacters(in: range, with: attributedString) @@ -393,3 +393,8 @@ extension EditCheatViewController: UITextViewDelegate 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)}) +} diff --git a/Delta/Pause Menu/GridMenuViewController.swift b/Delta/Pause Menu/GridMenuViewController.swift index a92fad3..e1402d6 100644 --- a/Delta/Pause Menu/GridMenuViewController.swift +++ b/Delta/Pause Menu/GridMenuViewController.swift @@ -145,7 +145,7 @@ extension GridMenuViewController: UICollectionViewDelegateFlowLayout { self.configure(self.prototypeCell, for: indexPath) - let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize) + let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) return size } } diff --git a/Delta/Pause Menu/PauseViewController.swift b/Delta/Pause Menu/PauseViewController.swift index 68f6e09..607ca0a 100644 --- a/Delta/Pause Menu/PauseViewController.swift +++ b/Delta/Pause Menu/PauseViewController.swift @@ -19,7 +19,7 @@ class PauseViewController: UIViewController, PauseInfoProviding } 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 @@ -115,7 +115,7 @@ extension PauseViewController 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!) transitionCoordinator.presenting = (operation == .push) diff --git a/Delta/Pause Menu/Save States/SaveStatesViewController.swift b/Delta/Pause Menu/Save States/SaveStatesViewController.swift index f9ab2c0..d2ffda9 100644 --- a/Delta/Pause Menu/Save States/SaveStatesViewController.swift +++ b/Delta/Pause Menu/Save States/SaveStatesViewController.swift @@ -677,7 +677,7 @@ extension SaveStatesViewController: UICollectionViewDelegateFlowLayout { self.configure(self.prototypeCell, for: indexPath) - let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UILayoutFittingCompressedSize) + let size = self.prototypeCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) return size } @@ -685,7 +685,7 @@ extension SaveStatesViewController: UICollectionViewDelegateFlowLayout { self.configure(self.prototypeHeader, forSection: section) - let size = self.prototypeHeader.systemLayoutSizeFitting(UILayoutFittingCompressedSize) + let size = self.prototypeHeader.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) return size } } diff --git a/Delta/Settings/App Icon Shortcuts/AppIconShortcutsViewController.swift b/Delta/Settings/App Icon Shortcuts/AppIconShortcutsViewController.swift index 3ea35a2..b6ba567 100644 --- a/Delta/Settings/App Icon Shortcuts/AppIconShortcutsViewController.swift +++ b/Delta/Settings/App Icon Shortcuts/AppIconShortcutsViewController.swift @@ -281,7 +281,7 @@ extension AppIconShortcutsViewController 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 { @@ -307,7 +307,7 @@ extension AppIconShortcutsViewController 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 { diff --git a/Delta/Settings/Controllers/ControllerInputsViewController.swift b/Delta/Settings/Controllers/ControllerInputsViewController.swift index 228b81f..888c51a 100644 --- a/Delta/Settings/Controllers/ControllerInputsViewController.swift +++ b/Delta/Settings/Controllers/ControllerInputsViewController.swift @@ -224,7 +224,7 @@ private extension ControllerInputsViewController else { return } // 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. for input in mappedInputs diff --git a/Delta/Settings/Controllers/ControllersSettingsViewController.swift b/Delta/Settings/Controllers/ControllersSettingsViewController.swift index 9d20b3d..031cd93 100644 --- a/Delta/Settings/Controllers/ControllersSettingsViewController.swift +++ b/Delta/Settings/Controllers/ControllersSettingsViewController.swift @@ -307,7 +307,7 @@ extension ControllersSettingsViewController return 1 } - return UITableViewAutomaticDimension + return UITableView.automaticDimension } } diff --git a/Delta/Settings/SettingsViewController.swift b/Delta/Settings/SettingsViewController.swift index 12377ca..34c3a36 100644 --- a/Delta/Settings/SettingsViewController.swift +++ b/Delta/Settings/SettingsViewController.swift @@ -81,7 +81,7 @@ class SettingsViewController: UITableViewController { // Update and temporarily re-select selected row. 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)