1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Avoid casting Any

This commit is contained in:
Daniel Barber 2019-02-20 08:34:42 -05:00
parent 863c9a7a70
commit 6d97aba32d
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -23,16 +23,12 @@ class PreferencesViewController: NSViewController {
} }
} }
@IBAction func updateMpdHost(_ sender: Any) { @IBAction func updateMpdHost(_ sender: NSTextField) {
guard let mpdHostField = sender as? NSTextField else { return } preferences.mpdHost = sender.stringValue
preferences.mpdHost = mpdHostField.stringValue
} }
@IBAction func updateMpdPort(_ sender: Any) { @IBAction func updateMpdPort(_ sender: NSTextField) {
guard let mpdPortField = sender as? NSTextField else { return } preferences.mpdPort = sender.integerValue
preferences.mpdPort = mpdPortField.integerValue
} }
@IBOutlet var mpdHostField: NSTextField! @IBOutlet var mpdHostField: NSTextField!