Last active
October 7, 2015 14:30
-
-
Save lukeredpath/a969aa97fab9705ef77a to your computer and use it in GitHub Desktop.
Protocol defaults?
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
protocol Search: UISearchResultsUpdating { | |
func searchFor(query: String) | |
} | |
extension Search { | |
func updateSearchResultsForSearchController(searchController: UISearchController) { | |
searchFor(searchController.searchBar.text!) | |
} | |
} | |
@objc class GoogleSearch: NSObject, Search { | |
func searchFor(query: String) { | |
// do stuff | |
} | |
} | |
# Error: Type 'GoogleSearch' does not conform to protocol 'UISearchResultsUpdating' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment