Created
July 19, 2020 04:27
-
-
Save olivaresf/a3e9d68bca665941b5fd8e3eb27c6db8 to your computer and use it in GitHub Desktop.
A few actions...
This file contains 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
// Behavior 1: Save to preferences. | |
class CurrencyPickerSettingsResponsible { } | |
extension CurrencyPickerSettingsResponsible : CurrencyPickerProtocol { | |
func selected(currency: String, from: CurrencyPickerTableViewController) { | |
let preferences = BTCPreferences.sharedPreferences() | |
preferences.setObject(key, forKey: kBTCSelectedCurrencyKey) | |
preferences.synchronize() | |
NSNotificationCenter.defaultCenter().postNotificationName(kBTCCurrencyDidChangeNotificationName, object: key) | |
from.navigationController?.popViewControllerAnimated(true) | |
} | |
} | |
// Behavior 2: No action. | |
class CurrencyPickerNoAction { } | |
extension CurrencyPickerSettingsResponsible : CurrencyPickerProtocol { | |
func selected(currency: String, from: CurrencyPickerTableViewController) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment