Last active
July 19, 2016 01:32
-
-
Save nikolsky2/defacbc998d92538117c8f862a195e12 to your computer and use it in GitHub Desktop.
NSFetchRequest fetch properties only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let searchTermPropertyName = "term" | |
let searchFetchRequest = NSFetchRequest(entityName: SearchEntity.className) | |
searchFetchRequest.propertiesToFetch = [searchTermPropertyName] | |
searchFetchRequest.resultType = .DictionaryResultType | |
let allSearches = try! privateContext.executeFetchRequest(searchFetchRequest) as! [[String: String]] | |
let allSearchTerms = allSearches.flatMap {$0[searchTermPropertyName]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment