diff --git a/Common/Collection View/GameCollectionViewDataSource.swift b/Common/Collection View/GameCollectionViewDataSource.swift index 7d361df..b651981 100644 --- a/Common/Collection View/GameCollectionViewDataSource.swift +++ b/Common/Collection View/GameCollectionViewDataSource.swift @@ -20,7 +20,7 @@ class GameCollectionViewDataSource: NSObject var cellConfigurationHandler: ((GridCollectionViewCell, Game) -> Void)? - private(set) var fetchedResultsController: NSFetchedResultsController = NSFetchedResultsController() + private(set) var fetchedResultsController: NSFetchedResultsController = NSFetchedResultsController() private var prototypeCell = GridCollectionViewCell() diff --git a/Common/Components/LoadImageOperation.swift b/Common/Components/LoadImageOperation.swift index 7680543..33f6298 100644 --- a/Common/Components/LoadImageOperation.swift +++ b/Common/Components/LoadImageOperation.swift @@ -25,7 +25,7 @@ public class LoadImageOperation: RSTOperation } } - public var imageCache: Cache? { + public var imageCache: Cache? { didSet { // Ensures if an image is cached, it will be returned immediately, to prevent temporary flash of placeholder image self.isImmediate = self.imageCache?.object(forKey: self.URL) != nil @@ -48,7 +48,7 @@ public extension LoadImageOperation { guard !self.isCancelled else { return } - if let cachedImage = self.imageCache?.object(forKey: self.URL) as? UIImage + if let cachedImage = self.imageCache?.object(forKey: self.URL) { self.image = cachedImage return diff --git a/Common/Database/DatabaseManager.swift b/Common/Database/DatabaseManager.swift index 756c9b8..1f2b399 100644 --- a/Common/Database/DatabaseManager.swift +++ b/Common/Database/DatabaseManager.swift @@ -112,7 +112,7 @@ class DatabaseManager } let game = Game.insertIntoManagedObjectContext(managedObjectContext) - game.name = try! URL.deletingPathExtension()?.lastPathComponent ?? NSLocalizedString("Game", comment: "") + game.name = try! URL.deletingPathExtension().lastPathComponent ?? NSLocalizedString("Game", comment: "") game.identifier = identifier game.filename = filename diff --git a/Common/Database/Model/Game.swift b/Common/Database/Model/Game.swift index 817a820..79f262a 100644 --- a/Common/Database/Model/Game.swift +++ b/Common/Database/Model/Game.swift @@ -31,7 +31,7 @@ extension Game } @objc(Game) -class Game: NSManagedObject, GameType +class Game: NSManagedObject { @NSManaged var artworkURL: URL? @NSManaged var filename: String @@ -44,7 +44,7 @@ class Game: NSManagedObject, GameType var fileURL: URL { let fileURL = try! DatabaseManager.gamesDirectoryURL.appendingPathComponent(self.filename) - return fileURL! + return fileURL } var preferredFileExtension: String { @@ -58,6 +58,8 @@ class Game: NSManagedObject, GameType } } +extension Game: GameType {} + extension Game { class func supportedTypeIdentifiers() -> Set diff --git a/Common/Database/Model/SaveState.swift b/Common/Database/Model/SaveState.swift index d65479b..ee6ea6c 100644 --- a/Common/Database/Model/SaveState.swift +++ b/Common/Database/Model/SaveState.swift @@ -26,7 +26,7 @@ extension SaveState case previewGame } - @objc enum Type: Int16 + @objc enum `Type`: Int16 { case auto case general @@ -34,6 +34,8 @@ extension SaveState } } + + @objc(SaveState) class SaveState: NSManagedObject, SaveStateType { diff --git a/Common/Extensions/NSFetchedResultsController+Conveniences.h b/Common/Extensions/NSFetchedResultsController+Conveniences.h new file mode 100644 index 0000000..6e5f33e --- /dev/null +++ b/Common/Extensions/NSFetchedResultsController+Conveniences.h @@ -0,0 +1,15 @@ +// +// NSFetchedResultsController+Conveniences.h +// Delta +// +// Created by Riley Testut on 7/13/16. +// Copyright © 2016 Riley Testut. All rights reserved. +// + +@import CoreData; + +@interface NSFetchedResultsController (Conveniences) + +- (void)performFetchIfNeeded; + +@end diff --git a/Common/Extensions/NSFetchedResultsController+Conveniences.m b/Common/Extensions/NSFetchedResultsController+Conveniences.m new file mode 100644 index 0000000..d9982dd --- /dev/null +++ b/Common/Extensions/NSFetchedResultsController+Conveniences.m @@ -0,0 +1,31 @@ +// +// NSFetchedResultsController+Conveniences.m +// Delta +// +// Created by Riley Testut on 7/13/16. +// Copyright © 2016 Riley Testut. All rights reserved. +// + +#import "NSFetchedResultsController+Conveniences.h" + +@import Roxas; + +@implementation NSFetchedResultsController (Conveniences) + +// Needs to be implemented in Objective-C due to current limitation of Swift: +// Extension of a generic Objective-C class cannot access the class's generic parameters at runtime +- (void)performFetchIfNeeded +{ + if (self.fetchedObjects != nil) + { + return; + } + + NSError *error = nil; + if (![self performFetch:&error]) + { + ELog(error); + } +} + +@end diff --git a/Common/Extensions/NSFetchedResultsController+Conveniences.swift b/Common/Extensions/NSFetchedResultsController+Conveniences.swift deleted file mode 100644 index 23d6606..0000000 --- a/Common/Extensions/NSFetchedResultsController+Conveniences.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// NSFetchedResultsController+Conveniences.swift -// Delta -// -// Created by Riley Testut on 5/20/16. -// Copyright © 2016 Riley Testut. All rights reserved. -// - -import CoreData - -extension NSFetchedResultsController -{ - func performFetchIfNeeded() - { - guard self.fetchedObjects == nil else { return } - - do - { - try self.performFetch() - } - catch let error as NSError - { - print(error) - } - } -} diff --git a/Common/Extensions/NSManagedObject+Conveniences.swift b/Common/Extensions/NSManagedObject+Conveniences.swift index 9a72623..4b68559 100644 --- a/Common/Extensions/NSManagedObject+Conveniences.swift +++ b/Common/Extensions/NSManagedObject+Conveniences.swift @@ -28,12 +28,6 @@ extension NSManagedObject // MARK: - Fetches - - class func fetchRequest() -> NSFetchRequest - { - let fetchRequest = NSFetchRequest(entityName: self.entityName) - return fetchRequest - } - class func instancesInManagedObjectContext(_ managedObjectContext: NSManagedObjectContext, type: T.Type) -> [T] { return self.instancesWithPredicate(nil, inManagedObjectContext: managedObjectContext, type: type) diff --git a/Common/Importing/GamePickerController.swift b/Common/Importing/GamePickerController.swift index f49fc3b..f93d194 100644 --- a/Common/Importing/GamePickerController.swift +++ b/Common/Importing/GamePickerController.swift @@ -53,11 +53,11 @@ class GamePickerController: NSObject let importAction = UIAlertAction(title: NSLocalizedString("Import", comment: ""), style: .default) { action in - let documentsDirectoryURL = try! DatabaseManager.databaseDirectoryURL.deletingLastPathComponent + let documentsDirectoryURL = try! DatabaseManager.databaseDirectoryURL.deletingLastPathComponent() do { - let contents = try FileManager.default.contentsOfDirectory(at: documentsDirectoryURL!, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) + let contents = try FileManager.default.contentsOfDirectory(at: documentsDirectoryURL, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) let managedObjectContext = DatabaseManager.sharedManager.backgroundManagedObjectContext() managedObjectContext.perform() { diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 829ecf2..b5e08fd 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + BF02BD001D361BD1000892F2 /* NSFetchedResultsController+Conveniences.m in Sources */ = {isa = PBXBuildFile; fileRef = BF02BCFF1D361BD1000892F2 /* NSFetchedResultsController+Conveniences.m */; }; BF0418141D01E93400E85BCF /* GBADeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF0418131D01E93400E85BCF /* GBADeltaCore.framework */; }; BF0418151D01E93400E85BCF /* GBADeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BF0418131D01E93400E85BCF /* GBADeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF04A5A31CF8E61C00B4A267 /* UIViewController+PeekPop.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF04A5A21CF8E61C00B4A267 /* UIViewController+PeekPop.swift */; }; @@ -51,7 +52,6 @@ BFB141181BE46934004FBF46 /* GameCollectionViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB141171BE46934004FBF46 /* GameCollectionViewDataSource.swift */; }; BFC2731A1BE6152200D22B05 /* GameCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC273171BE6152200D22B05 /* GameCollection.swift */; }; BFC9B7391CEFCD34008629BB /* CheatsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC9B7381CEFCD34008629BB /* CheatsViewController.swift */; }; - BFC9B73B1CEFD438008629BB /* NSFetchedResultsController+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC9B73A1CEFD438008629BB /* NSFetchedResultsController+Conveniences.swift */; }; BFDB28451BC9DA7B001D0C83 /* GamePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDB28441BC9DA7B001D0C83 /* GamePickerController.swift */; }; BFDE393C1BC0CEDF003F72E8 /* Game.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDE39391BC0CEDF003F72E8 /* Game.swift */; }; BFE704F51CEA426E0058BAC8 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22506DA00971C4300AF90A35 /* Pods.framework */; }; @@ -86,6 +86,8 @@ 0340C4EC8B47535482F7F1BB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 22506DA00971C4300AF90A35 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 685E0D2F62E4246995A02970 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + BF02BCFE1D361BD1000892F2 /* NSFetchedResultsController+Conveniences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFetchedResultsController+Conveniences.h"; sourceTree = ""; }; + BF02BCFF1D361BD1000892F2 /* NSFetchedResultsController+Conveniences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFetchedResultsController+Conveniences.m"; sourceTree = ""; }; BF0418131D01E93400E85BCF /* GBADeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GBADeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BF04A5A21CF8E61C00B4A267 /* UIViewController+PeekPop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+PeekPop.swift"; sourceTree = ""; }; BF090CF11B490D8300DCAB45 /* Delta-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Delta-Bridging-Header.h"; sourceTree = ""; }; @@ -131,7 +133,6 @@ BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SNESDeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BFC273171BE6152200D22B05 /* GameCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GameCollection.swift; sourceTree = ""; }; BFC9B7381CEFCD34008629BB /* CheatsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CheatsViewController.swift; path = "Pause Menu/Cheats/CheatsViewController.swift"; sourceTree = ""; }; - BFC9B73A1CEFD438008629BB /* NSFetchedResultsController+Conveniences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFetchedResultsController+Conveniences.swift"; sourceTree = ""; }; BFDB28441BC9DA7B001D0C83 /* GamePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GamePickerController.swift; sourceTree = ""; }; BFDE39391BC0CEDF003F72E8 /* Game.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Game.swift; sourceTree = ""; }; BFEC732C1AAECC4A00650035 /* Roxas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Roxas.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -247,7 +248,8 @@ children = ( BF762EAA1BC1B076002C8866 /* NSManagedObject+Conveniences.swift */, BF172AEA1C68986300C26774 /* NSManagedObjectContext+Conveniences.swift */, - BFC9B73A1CEFD438008629BB /* NSFetchedResultsController+Conveniences.swift */, + BF02BCFE1D361BD1000892F2 /* NSFetchedResultsController+Conveniences.h */, + BF02BCFF1D361BD1000892F2 /* NSFetchedResultsController+Conveniences.m */, ); path = Extensions; sourceTree = ""; @@ -558,10 +560,10 @@ BF762EAB1BC1B076002C8866 /* NSManagedObject+Conveniences.swift in Sources */, BFC9B7391CEFCD34008629BB /* CheatsViewController.swift in Sources */, BF353FFF1C5DA3C500C1184C /* PausePresentationController.swift in Sources */, + BF02BD001D361BD1000892F2 /* NSFetchedResultsController+Conveniences.m in Sources */, BF7AE80A1C2E8C7600B1B5BC /* UIColor+Delta.swift in Sources */, BF762E9E1BC19D31002C8866 /* DatabaseManager.swift in Sources */, BF090CF41B490D8300DCAB45 /* UIDevice+Vibration.m in Sources */, - BFC9B73B1CEFD438008629BB /* NSFetchedResultsController+Conveniences.swift in Sources */, BF797A2D1C2D339F00F1A000 /* UILabel+FontSize.swift in Sources */, BF65E8631CEE5C6A00CD3247 /* Cheat.swift in Sources */, BF3540021C5DA3D500C1184C /* PauseStoryboardSegue.swift in Sources */, diff --git a/Delta/Emulation/EmulationViewController.swift b/Delta/Emulation/EmulationViewController.swift index bbf09c4..dd4bdaa 100644 --- a/Delta/Emulation/EmulationViewController.swift +++ b/Delta/Emulation/EmulationViewController.swift @@ -22,7 +22,7 @@ private struct DispatchSemaphore: Hashable init(value: Int) { - self.semaphore = DispatchSemaphore(value: value) + self.semaphore = Dispatch.DispatchSemaphore(value: value) } } @@ -97,8 +97,8 @@ class EmulationViewController: UIViewController super.init(coder: aDecoder) - NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.updateControllers), name: ExternalControllerDidConnectNotification, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.updateControllers), name: ExternalControllerDidDisconnectNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.updateControllers), name: NSNotification.Name(rawValue: ExternalControllerDidConnectNotification), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.updateControllers), name: NSNotification.Name(rawValue: ExternalControllerDidDisconnectNotification), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.willResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: UIApplication.shared()) NotificationCenter.default.addObserver(self, selector: #selector(EmulationViewController.didBecomeActive(_:)), name: NSNotification.Name.UIApplicationDidBecomeActive, object: UIApplication.shared()) @@ -250,9 +250,9 @@ class EmulationViewController: UIViewController sustainButtonsItem.selected = self.sustainedInputs[ObjectIdentifier(gameController)]?.count > 0 var fastForwardItem = PauseItem(image: UIImage(named: "FastForward")!, text: NSLocalizedString("Fast Forward", comment: ""), action: { [unowned self] item in - self.emulatorCore.rate = item.selected ? self.emulatorCore.supportedRates.end : self.emulatorCore.supportedRates.start + self.emulatorCore.rate = item.selected ? self.emulatorCore.supportedRates.upperBound : self.emulatorCore.supportedRates.lowerBound }) - fastForwardItem.selected = self.emulatorCore.rate == self.emulatorCore.supportedRates.start ? false : true + fastForwardItem.selected = self.emulatorCore.rate == self.emulatorCore.supportedRates.lowerBound ? false : true pauseViewController.items = [saveStateItem, loadStateItem, cheatCodesItem, fastForwardItem, sustainButtonsItem] @@ -512,12 +512,10 @@ extension EmulationViewController: SaveStatesViewControllerDelegate } } - if let outputImage = self.gameView.outputImage + if let outputImage = self.gameView.outputImage, let quartzImage = self.context.createCGImage(outputImage, from: outputImage.extent) { - let quartzImage = self.context.createCGImage(outputImage, from: outputImage.extent) - let image = UIImage(cgImage: quartzImage) - try? UIImagePNGRepresentation(image)?.write(to: saveState.imageFileURL, options: [.dataWritingAtomic]) + try! UIImagePNGRepresentation(image)?.write(to: saveState.imageFileURL, options: [.atomicWrite]) } saveState.modifiedDate = Date() diff --git a/Delta/Game Selection/GamesViewController.swift b/Delta/Game Selection/GamesViewController.swift index f6b93a2..dc5ae77 100644 --- a/Delta/Game Selection/GamesViewController.swift +++ b/Delta/Game Selection/GamesViewController.swift @@ -19,7 +19,7 @@ class GamesViewController: UIViewController private var backgroundView: RSTBackgroundView! private var pageControl: UIPageControl! - private let fetchedResultsController: NSFetchedResultsController + private let fetchedResultsController: NSFetchedResultsController override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { fatalError("initWithNibName: not implemented") diff --git a/Delta/Pause Menu/Cheats/CheatsViewController.swift b/Delta/Pause Menu/Cheats/CheatsViewController.swift index a2db2d1..d8dc951 100644 --- a/Delta/Pause Menu/Cheats/CheatsViewController.swift +++ b/Delta/Pause Menu/Cheats/CheatsViewController.swift @@ -30,7 +30,7 @@ class CheatsViewController: UITableViewController private var backgroundView: RSTBackgroundView! - private var fetchedResultsController: NSFetchedResultsController! + private var fetchedResultsController: NSFetchedResultsController! } extension CheatsViewController @@ -222,7 +222,7 @@ extension CheatsViewController { let cheat = self.fetchedResultsController.object(at: indexPath) as! Cheat - let deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle(), title: NSLocalizedString("Delete", comment: "")) { (action, indexPath) in + let deleteAction = UITableViewRowAction(style: .destructive, title: NSLocalizedString("Delete", comment: "")) { (action, indexPath) in self.deleteCheat(cheat) } diff --git a/Delta/Pause Menu/Save States/SaveStatesViewController.swift b/Delta/Pause Menu/Save States/SaveStatesViewController.swift index e4588d8..d8f9774 100644 --- a/Delta/Pause Menu/Save States/SaveStatesViewController.swift +++ b/Delta/Pause Menu/Save States/SaveStatesViewController.swift @@ -51,10 +51,10 @@ class SaveStatesViewController: UICollectionViewController private var prototypeCellWidthConstraint: NSLayoutConstraint! private var prototypeHeader = SaveStatesCollectionHeaderView() - private var fetchedResultsController: NSFetchedResultsController! + private var fetchedResultsController: NSFetchedResultsController! private let imageOperationQueue = RSTOperationQueue() - private let imageCache = Cache() + private let imageCache = Cache() private var currentGameState: SaveStateType? private var selectedSaveState: SaveState? diff --git a/Delta/Pause Menu/Segues/PauseStoryboardSegue.swift b/Delta/Pause Menu/Segues/PauseStoryboardSegue.swift index bc26e24..ecc64c0 100644 --- a/Delta/Pause Menu/Segues/PauseStoryboardSegue.swift +++ b/Delta/Pause Menu/Segues/PauseStoryboardSegue.swift @@ -14,7 +14,7 @@ class PauseStoryboardSegue: UIStoryboardSegue override init(identifier: String?, source: UIViewController, destination: UIViewController) { - self.presentationController = PausePresentationController(presentedViewController: destination, presentingViewController: source) + self.presentationController = PausePresentationController(presentedViewController: destination, presenting: source) super.init(identifier: identifier, source: source, destination: destination) } diff --git a/Delta/Settings/ControllersSettingsViewController.swift b/Delta/Settings/ControllersSettingsViewController.swift index 61ee19f..357f819 100644 --- a/Delta/Settings/ControllersSettingsViewController.swift +++ b/Delta/Settings/ControllersSettingsViewController.swift @@ -52,8 +52,8 @@ class ControllersSettingsViewController: UITableViewController { super.init(coder: aDecoder) - NotificationCenter.default.addObserver(self, selector: #selector(ControllersSettingsViewController.externalControllerDidConnect(_:)), name: ExternalControllerDidConnectNotification, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(ControllersSettingsViewController.externalControllerDidDisconnect(_:)), name: ExternalControllerDidDisconnectNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(ControllersSettingsViewController.externalControllerDidConnect(_:)), name: NSNotification.Name(rawValue: ExternalControllerDidConnectNotification), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(ControllersSettingsViewController.externalControllerDidDisconnect(_:)), name: NSNotification.Name(rawValue: ExternalControllerDidDisconnectNotification), object: nil) } override func viewDidLoad() diff --git a/Delta/Settings/SettingsViewController.swift b/Delta/Settings/SettingsViewController.swift index bfcdccd..5019634 100644 --- a/Delta/Settings/SettingsViewController.swift +++ b/Delta/Settings/SettingsViewController.swift @@ -25,8 +25,8 @@ class SettingsViewController: UITableViewController { super.init(coder: aDecoder) - NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.externalControllerDidConnect(_:)), name: ExternalControllerDidConnectNotification, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.externalControllerDidDisconnect(_:)), name: ExternalControllerDidDisconnectNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.externalControllerDidConnect(_:)), name: NSNotification.Name(rawValue: ExternalControllerDidConnectNotification), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.externalControllerDidDisconnect(_:)), name: NSNotification.Name(rawValue: ExternalControllerDidDisconnectNotification), object: nil) } override func viewDidLoad() diff --git a/Delta/Supporting Files/Delta-Bridging-Header.h b/Delta/Supporting Files/Delta-Bridging-Header.h index a65050d..d25ca0a 100644 --- a/Delta/Supporting Files/Delta-Bridging-Header.h +++ b/Delta/Supporting Files/Delta-Bridging-Header.h @@ -2,4 +2,5 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "UIDevice+Vibration.h" \ No newline at end of file +#import "UIDevice+Vibration.h" +#import "NSFetchedResultsController+Conveniences.h"