Closed esreli closed 4 years ago
This PR unifies the API for storing and retrieving AGSJSONSerializing objects to/from UserDefaults using generics.
AGSJSONSerializing
Previously a user would:
UserDefaults.standard.set(newValue, forKey: visibleAreaDefaultsKey) AGSViewpoint.retrieveFromUserDefaults(forKey: visibleAreaDefaultsKey)
This feels awkward, as if you have to use two separate APIs for the storage and retrieval. Using generics and implicit types, we can modify this API such that both storing and retrieving methods are extensions on UserDefaults, unifying the API.
UserDefaults
UserDefaults.standard.setSerializable(newValue, forKey: visibleAreaDefaultsKey) UserDefaults.standard.getSerializable(forKey: visibleAreaDefaultsKey)
This PR unifies the API for storing and retrieving
AGSJSONSerializing
objects to/from UserDefaults using generics.Previously a user would:
This feels awkward, as if you have to use two separate APIs for the storage and retrieval. Using generics and implicit types, we can modify this API such that both storing and retrieving methods are extensions on
UserDefaults
, unifying the API.