@@ -61,9 +61,9 @@ open class PropertyListSerialization : NSObject {
61
61
open class func propertyList( from data: Data , options opt: ReadOptions = [ ] , format: UnsafeMutablePointer < PropertyListFormat > ? ) throws -> Any {
62
62
var fmt = kCFPropertyListBinaryFormat_v1_0
63
63
var error : Unmanaged < CFError > ? = nil
64
- let decoded = withUnsafeMutablePointer ( to: & fmt) { ( outFmt: UnsafeMutablePointer < CFPropertyListFormat > ) -> NSObject ? in
65
- withUnsafeMutablePointer ( to: & error) { ( outErr: UnsafeMutablePointer < Unmanaged < CFError > ? > ) -> NSObject ? in
66
- return unsafeBitCast ( CFPropertyListCreateWithData ( kCFAllocatorSystemDefault, data. _cfObject, CFOptionFlags ( CFIndex ( opt. rawValue) ) , outFmt, outErr) , to : NSObject . self )
64
+ let decoded = withUnsafeMutablePointer ( to: & fmt) { ( outFmt: UnsafeMutablePointer < CFPropertyListFormat > ) -> AnyObject ? in
65
+ withUnsafeMutablePointer ( to: & error) { ( outErr: UnsafeMutablePointer < Unmanaged < CFError > ? > ) -> AnyObject ? in
66
+ return CFPropertyListCreateWithData ( kCFAllocatorSystemDefault, data. _cfObject, CFOptionFlags ( CFIndex ( opt. rawValue) ) , outFmt, outErr) . takeRetainedValue ( )
67
67
}
68
68
}
69
69
format? . pointee = PropertyListFormat ( rawValue: UInt ( fmt. rawValue) ) !
@@ -77,9 +77,9 @@ open class PropertyListSerialization : NSObject {
77
77
internal class func propertyList( with stream: CFReadStream , options opt: ReadOptions , format: UnsafeMutablePointer < PropertyListFormat > ? ) throws -> Any {
78
78
var fmt = kCFPropertyListBinaryFormat_v1_0
79
79
var error : Unmanaged < CFError > ? = nil
80
- let decoded = withUnsafeMutablePointer ( to: & fmt) { ( outFmt: UnsafeMutablePointer < CFPropertyListFormat > ) -> NSObject ? in
81
- withUnsafeMutablePointer ( to: & error) { ( outErr: UnsafeMutablePointer < Unmanaged < CFError > ? > ) -> NSObject ? in
82
- return unsafeBitCast ( CFPropertyListCreateWithStream ( kCFAllocatorSystemDefault, stream, 0 , CFOptionFlags ( CFIndex ( opt. rawValue) ) , outFmt, outErr) , to : NSObject . self )
80
+ let decoded = withUnsafeMutablePointer ( to: & fmt) { ( outFmt: UnsafeMutablePointer < CFPropertyListFormat > ) -> AnyObject ? in
81
+ withUnsafeMutablePointer ( to: & error) { ( outErr: UnsafeMutablePointer < Unmanaged < CFError > ? > ) -> AnyObject ? in
82
+ return CFPropertyListCreateWithStream ( kCFAllocatorSystemDefault, stream, 0 , CFOptionFlags ( CFIndex ( opt. rawValue) ) , outFmt, outErr) . takeRetainedValue ( )
83
83
}
84
84
}
85
85
format? . pointee = PropertyListFormat ( rawValue: UInt ( fmt. rawValue) ) !
0 commit comments