File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -212,20 +212,14 @@ open class UserDefaults: NSObject {
212
212
//FIXME: CFURLIsFileReferenceURL is limited to OS X/iOS
213
213
#if os(OSX) || os(iOS)
214
214
//FIXME: no SwiftFoundation version of CFURLIsFileReferenceURL at time of writing!
215
- if !CFURLIsFileReferenceURL( url. _cfObject) {
216
- //FIXME: stringByAbbreviatingWithTildeInPath isn't implemented in SwiftFoundation
217
- //TODO: use stringByAbbreviatingWithTildeInPath when it is
218
- let urlPath = url. path
219
-
220
- set ( urlPath. _nsObject, forKey: defaultName)
215
+ if CFURLIsFileReferenceURL ( url. _cfObject) {
216
+ let data = NSKeyedArchiver . archivedData ( withRootObject: url. _nsObject)
217
+ set ( data. _nsObject, forKey: defaultName)
218
+ return
221
219
}
222
- #else
223
- //FIXME: stringByAbbreviatingWithTildeInPath isn't implemented in SwiftFoundation
224
- //TODO: use stringByAbbreviatingWithTildeInPath when it is
225
- setObject ( url. path. _nsObject, forKey: defaultName)
226
220
#endif
227
- let data = NSKeyedArchiver . archivedData ( withRootObject : url . _nsObject )
228
- set ( data . _nsObject, forKey: defaultName)
221
+
222
+ set ( url . path . _nsObject, forKey: defaultName)
229
223
} else {
230
224
set ( nil , forKey: defaultName)
231
225
}
You can’t perform that action at this time.
0 commit comments