From 91dd4b6cb37222dfffde86e427941aa07e239ff2 Mon Sep 17 00:00:00 2001 From: John Rommel Estropia Date: Thu, 25 Feb 2016 07:14:15 +0900 Subject: [PATCH] tidy up --- CoreStore/Setting Up/DataStack.swift | 1 - .../QueryingResultsViewController.swift | 4 ++-- .../ListObserverDemoViewController.swift | 6 +++--- .../Transactions Demo/TransactionsDemoViewController.swift | 7 +++++-- CoreStoreTests/CoreStoreTests.swift | 4 +--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CoreStore/Setting Up/DataStack.swift b/CoreStore/Setting Up/DataStack.swift index b68f643..d67534b 100644 --- a/CoreStore/Setting Up/DataStack.swift +++ b/CoreStore/Setting Up/DataStack.swift @@ -129,7 +129,6 @@ public final class DataStack { - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`. - returns: the `NSPersistentStore` added to the stack. */ - @available(*, deprecated=2.0.0, renamed="beginUnsafe") public func addInMemoryStoreAndWait(configuration configuration: String? = nil) throws -> NSPersistentStore { do { diff --git a/CoreStoreDemo/CoreStoreDemo/Fetching and Querying Demo/QueryingResultsViewController.swift b/CoreStoreDemo/CoreStoreDemo/Fetching and Querying Demo/QueryingResultsViewController.swift index c7eedeb..a1d0b31 100644 --- a/CoreStoreDemo/CoreStoreDemo/Fetching and Querying Demo/QueryingResultsViewController.swift +++ b/CoreStoreDemo/CoreStoreDemo/Fetching and Querying Demo/QueryingResultsViewController.swift @@ -20,7 +20,7 @@ class QueryingResultsViewController: UITableViewController { self.values = array.map { (item: AnyObject) -> (title: String, detail: String) in ( title: item.description, - detail: _stdlib_getDemangledTypeName(item) + detail: String(reflecting: item.dynamicType) ) } @@ -28,7 +28,7 @@ class QueryingResultsViewController: UITableViewController { self.values = [ ( title: item.description, - detail: _stdlib_getDemangledTypeName(item) + detail: String(reflecting: item.dynamicType) ) ] diff --git a/CoreStoreDemo/CoreStoreDemo/List and Object Observers Demo/ListObserverDemoViewController.swift b/CoreStoreDemo/CoreStoreDemo/List and Object Observers Demo/ListObserverDemoViewController.swift index 6eff5b7..cb78ea8 100644 --- a/CoreStoreDemo/CoreStoreDemo/List and Object Observers Demo/ListObserverDemoViewController.swift +++ b/CoreStoreDemo/CoreStoreDemo/List and Object Observers Demo/ListObserverDemoViewController.swift @@ -88,7 +88,7 @@ class ListObserverDemoViewController: UITableViewController, ListSectionObserver UIBarButtonItem( barButtonSystemItem: .Trash, target: self, - action: "resetBarButtonItemTouched:" + action: #selector(self.resetBarButtonItemTouched(_:)) ) ] @@ -96,13 +96,13 @@ class ListObserverDemoViewController: UITableViewController, ListSectionObserver title: Static.filter.rawValue, style: .Plain, target: self, - action: "filterBarButtonItemTouched:" + action: #selector(self.filterBarButtonItemTouched(_:)) ) navigationItem.rightBarButtonItems = [ UIBarButtonItem( barButtonSystemItem: .Add, target: self, - action: "addBarButtonItemTouched:" + action: #selector(self.addBarButtonItemTouched(_:)) ), filterBarButton ] diff --git a/CoreStoreDemo/CoreStoreDemo/Transactions Demo/TransactionsDemoViewController.swift b/CoreStoreDemo/CoreStoreDemo/Transactions Demo/TransactionsDemoViewController.swift index 5c2f68d..5e8fdce 100644 --- a/CoreStoreDemo/CoreStoreDemo/Transactions Demo/TransactionsDemoViewController.swift +++ b/CoreStoreDemo/CoreStoreDemo/Transactions Demo/TransactionsDemoViewController.swift @@ -60,7 +60,10 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Objec super.viewDidLoad() - let longPressGesture = UILongPressGestureRecognizer(target: self, action: "longPressGestureRecognized:") + let longPressGesture = UILongPressGestureRecognizer( + target: self, + action: #selector(self.longPressGestureRecognized(_:)) + ) self.mapView?.addGestureRecognizer(longPressGesture) Static.placeController.addObserver(self) @@ -68,7 +71,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Objec self.navigationItem.rightBarButtonItem = UIBarButtonItem( barButtonSystemItem: .Refresh, target: self, - action: "refreshButtonTapped:" + action: #selector(self.refreshButtonTapped(_:)) ) } diff --git a/CoreStoreTests/CoreStoreTests.swift b/CoreStoreTests/CoreStoreTests.swift index 6c83a2d..61c3e42 100644 --- a/CoreStoreTests/CoreStoreTests.swift +++ b/CoreStoreTests/CoreStoreTests.swift @@ -380,9 +380,7 @@ class CoreStoreTests: XCTestCase { do { let fileManager = NSFileManager.defaultManager() - try fileManager.removeItemAtURL( - fileManager.URLsForDirectory(deviceDirectorySearchPath, inDomains: .UserDomainMask).first! - ) + try fileManager.removeItemAtURL(defaultRootDirectory) } catch _ { } }