Trust in assigned default value
In particular, SwiftyUserDefaults returns the default value in case it does not find a value in the dictionary. As the default is '.all' it does not have to be set explicitly. Assigning 'nil' will result in '.all' anyway.
This commit is contained in:
parent
4b3e424bb3
commit
44870af774
2 changed files with 2 additions and 2 deletions
|
|
@ -585,7 +585,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
|
||||
func searchBar(_ searchBar: UISearchBar, selectedScopeButtonIndexDidChange selectedScope: Int) {
|
||||
// update the default search scope
|
||||
SharedDefaults[.searchDefault] = SearchBarScope(rawValue: selectedScope) ?? .all
|
||||
SharedDefaults[.searchDefault] = SearchBarScope(rawValue: selectedScope)
|
||||
updateSearchResults(for: searchController)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue