forked from swiftlang/swift-corelibs-foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSObjCRuntime.swift
512 lines (429 loc) · 22.6 KB
/
NSObjCRuntime.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
import CoreFoundation
#if os(macOS) || os(iOS)
internal let kCFCompareLessThan = CFComparisonResult.compareLessThan
internal let kCFCompareEqualTo = CFComparisonResult.compareEqualTo
internal let kCFCompareGreaterThan = CFComparisonResult.compareGreaterThan
#endif
internal enum _NSSimpleObjCType : UnicodeScalar {
case ID = "@"
case Class = "#"
case Sel = ":"
case Char = "c"
case UChar = "C"
case Short = "s"
case UShort = "S"
case Int = "i"
case UInt = "I"
case Long = "l"
case ULong = "L"
case LongLong = "q"
case ULongLong = "Q"
case Float = "f"
case Double = "d"
case Bitfield = "b"
case Bool = "B"
case Void = "v"
case Undef = "?"
case Ptr = "^"
case CharPtr = "*"
case Atom = "%"
case ArrayBegin = "["
case ArrayEnd = "]"
case UnionBegin = "("
case UnionEnd = ")"
case StructBegin = "{"
case StructEnd = "}"
case Vector = "!"
case Const = "r"
}
extension Int {
init(_ v: _NSSimpleObjCType) {
self.init(UInt8(ascii: v.rawValue))
}
}
extension Int8 {
init(_ v: _NSSimpleObjCType) {
self.init(Int(v))
}
}
extension String {
init(_ v: _NSSimpleObjCType) {
self.init(v.rawValue)
}
}
extension _NSSimpleObjCType {
init?(_ v: UInt8) {
self.init(rawValue: UnicodeScalar(v))
}
init?(_ v: String?) {
if let rawValue = v?.unicodeScalars.first {
self.init(rawValue: rawValue)
} else {
return nil
}
}
}
// mapping of ObjC types to sizes and alignments (note that .Int is 32-bit)
// FIXME use a generic function, unfortunately this seems to promote the size to 8
private let _NSObjCSizesAndAlignments : Dictionary<_NSSimpleObjCType, (Int, Int)> = [
.ID : ( MemoryLayout<AnyObject>.size, MemoryLayout<AnyObject>.alignment ),
.Class : ( MemoryLayout<AnyClass>.size, MemoryLayout<AnyClass>.alignment ),
.Char : ( MemoryLayout<CChar>.size, MemoryLayout<CChar>.alignment ),
.UChar : ( MemoryLayout<UInt8>.size, MemoryLayout<UInt8>.alignment ),
.Short : ( MemoryLayout<Int16>.size, MemoryLayout<Int16>.alignment ),
.UShort : ( MemoryLayout<UInt16>.size, MemoryLayout<UInt16>.alignment ),
.Int : ( MemoryLayout<Int32>.size, MemoryLayout<Int32>.alignment ),
.UInt : ( MemoryLayout<UInt32>.size, MemoryLayout<UInt32>.alignment ),
.Long : ( MemoryLayout<Int32>.size, MemoryLayout<Int32>.alignment ),
.ULong : ( MemoryLayout<UInt32>.size, MemoryLayout<UInt32>.alignment ),
.LongLong : ( MemoryLayout<Int64>.size, MemoryLayout<Int64>.alignment ),
.ULongLong : ( MemoryLayout<UInt64>.size, MemoryLayout<UInt64>.alignment ),
.Float : ( MemoryLayout<Float>.size, MemoryLayout<Float>.alignment ),
.Double : ( MemoryLayout<Double>.size, MemoryLayout<Double>.alignment ),
.Bool : ( MemoryLayout<Bool>.size, MemoryLayout<Bool>.alignment ),
.CharPtr : ( MemoryLayout<UnsafePointer<CChar>>.size, MemoryLayout<UnsafePointer<CChar>>.alignment)
]
internal func _NSGetSizeAndAlignment(_ type: _NSSimpleObjCType,
_ size : inout Int,
_ align : inout Int) -> Bool {
guard let sizeAndAlignment = _NSObjCSizesAndAlignments[type] else {
return false
}
size = sizeAndAlignment.0
align = sizeAndAlignment.1
return true
}
public func NSGetSizeAndAlignment(_ typePtr: UnsafePointer<Int8>,
_ sizep: UnsafeMutablePointer<Int>?,
_ alignp: UnsafeMutablePointer<Int>?) -> UnsafePointer<Int8> {
let type = _NSSimpleObjCType(UInt8(typePtr.pointee))!
var size : Int = 0
var align : Int = 0
if !_NSGetSizeAndAlignment(type, &size, &align) {
// FIXME: This used to return nil, but the corresponding Darwin
// implementation is defined as returning a non-optional value.
fatalError("invalid type encoding")
}
sizep?.pointee = size
alignp?.pointee = align
return typePtr.advanced(by: 1)
}
public enum ComparisonResult : Int {
case orderedAscending = -1
case orderedSame
case orderedDescending
internal static func _fromCF(_ val: CFComparisonResult) -> ComparisonResult {
if val == kCFCompareLessThan {
return .orderedAscending
} else if val == kCFCompareGreaterThan {
return .orderedDescending
} else {
return .orderedSame
}
}
}
/* Note: QualityOfService enum is available on all platforms, but it may not be implemented on all platforms. */
public enum QualityOfService : Int {
/* UserInteractive QoS is used for work directly involved in providing an interactive UI such as processing events or drawing to the screen. */
case userInteractive
/* UserInitiated QoS is used for performing work that has been explicitly requested by the user and for which results must be immediately presented in order to allow for further user interaction. For example, loading an email after a user has selected it in a message list. */
case userInitiated
/* Utility QoS is used for performing work which the user is unlikely to be immediately waiting for the results. This work may have been requested by the user or initiated automatically, does not prevent the user from further interaction, often operates at user-visible timescales and may have its progress indicated to the user by a non-modal progress indicator. This work will run in an energy-efficient manner, in deference to higher QoS work when resources are constrained. For example, periodic content updates or bulk file operations such as media import. */
case utility
/* Background QoS is used for work that is not user initiated or visible. In general, a user is unaware that this work is even happening and it will run in the most efficient manner while giving the most deference to higher QoS work. For example, pre-fetching content, search indexing, backups, and syncing of data with external systems. */
case background
/* Default QoS indicates the absence of QoS information. Whenever possible QoS information will be inferred from other sources. If such inference is not possible, a QoS between UserInitiated and Utility will be used. */
case `default`
}
public struct NSSortOptions: OptionSet {
public let rawValue : UInt
public init(rawValue: UInt) { self.rawValue = rawValue }
public static let concurrent = NSSortOptions(rawValue: UInt(1 << 0))
public static let stable = NSSortOptions(rawValue: UInt(1 << 4))
}
public struct NSEnumerationOptions: OptionSet {
public let rawValue : UInt
public init(rawValue: UInt) { self.rawValue = rawValue }
public static let concurrent = NSEnumerationOptions(rawValue: UInt(1 << 0))
public static let reverse = NSEnumerationOptions(rawValue: UInt(1 << 1))
}
public typealias Comparator = (Any, Any) -> ComparisonResult
public let NSNotFound: Int = Int.max
internal func NSRequiresConcreteImplementation(_ fn: String = #function, file: StaticString = #file, line: UInt = #line) -> Never {
fatalError("\(fn) must be overriden in subclass implementations", file: file, line: line)
}
internal func NSUnimplemented(_ fn: String = #function, file: StaticString = #file, line: UInt = #line) -> Never {
#if os(Android)
NSLog("\(fn) is not yet implemented. \(file):\(line)")
#endif
fatalError("\(fn) is not yet implemented", file: file, line: line)
}
internal func NSUnsupported(_ fn: String = #function, file: StaticString = #file, line: UInt = #line) -> Never {
#if os(Android)
NSLog("\(fn) is not supported on this platform. \(file):\(line)")
#endif
fatalError("\(fn) is not supported on this platform", file: file, line: line)
}
internal func NSInvalidArgument(_ message: String, method: String = #function, file: StaticString = #file, line: UInt = #line) -> Never {
fatalError("\(method): \(message)", file: file, line: line)
}
internal struct _CFInfo {
// This must match _CFRuntimeBase
var info: UInt32
var pad : UInt32
init(typeID: CFTypeID) {
// This matches what _CFRuntimeCreateInstance does to initialize the info value
info = UInt32((UInt32(typeID) << 8) | (UInt32(0x80)))
pad = 0
}
init(typeID: CFTypeID, extra: UInt32) {
info = UInt32((UInt32(typeID) << 8) | (UInt32(0x80)))
pad = extra
}
}
// MARK: Classes to strings
// These must remain in sync with Foundation.apinotes as shipped on Apple OSes.
// NSStringFromClass(_:) will return the ObjC name when passed one of these classes, and NSClassFromString(_:) will return the class when passed the ObjC name.
// This is important for NSCoding archives created on Apple OSes to decode with swift-corelibs-foundation and for general source and data format compatibility.
internal let _NSClassesRenamedByObjCAPINotesInNetworkingOrXML: [(swiftName: String, objCName: String)] = [
(_SwiftFoundationNetworkingModuleName + ".CachedURLResponse", "NSCachedURLResponse"),
(_SwiftFoundationNetworkingModuleName + ".HTTPCookie", "NSHTTPCookie"),
(_SwiftFoundationNetworkingModuleName + ".HTTPCookieStorage", "NSHTTPCookieStorage"),
(_SwiftFoundationNetworkingModuleName + ".HTTPURLResponse", "NSHTTPURLResponse"),
(_SwiftFoundationNetworkingModuleName + ".URLResponse", "NSURLResponse"),
(_SwiftFoundationNetworkingModuleName + ".URLSession", "NSURLSession"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionConfiguration", "NSURLSessionConfiguration"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionDataTask", "NSURLSessionDataTask"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionDownloadTask", "NSURLSessionDownloadTask"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionStreamTask", "NSURLSessionStreamTask"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionTask", "NSURLSessionTask"),
(_SwiftFoundationNetworkingModuleName + ".URLSessionUploadTask", "NSURLSessionUploadTask"),
(_SwiftFoundationNetworkingModuleName + ".URLAuthenticationChallenge", "NSURLAuthenticationChallenge"),
(_SwiftFoundationNetworkingModuleName + ".URLCache", "NSURLCache"),
(_SwiftFoundationNetworkingModuleName + ".URLCredential", "NSURLCredential"),
(_SwiftFoundationNetworkingModuleName + ".URLCredentialStorage", "NSURLCredentialStorage"),
(_SwiftFoundationNetworkingModuleName + ".URLProtectionSpace", "NSURLProtectionSpace"),
(_SwiftFoundationNetworkingModuleName + ".URLProtocol", "NSURLProtocol"),
(_SwiftFoundationXMLModuleName + ".XMLDTD", "NSXMLDTD"),
(_SwiftFoundationXMLModuleName + ".XMLDTDNode", "NSXMLDTDNode"),
(_SwiftFoundationXMLModuleName + ".XMLDocument", "NSXMLDocument"),
(_SwiftFoundationXMLModuleName + ".XMLElement", "NSXMLElement"),
(_SwiftFoundationXMLModuleName + ".XMLNode", "NSXMLNode"),
(_SwiftFoundationXMLModuleName + ".XMLParser", "NSXMLParser"),
]
internal let _NSClassesRenamedByObjCAPINotes: [(class: AnyClass, objCName: String)] = {
var map: [(AnyClass, String)] = [
(ProcessInfo.self, "NSProcessInfo"),
(Port.self, "NSPort"),
(PortMessage.self, "NSPortMessage"),
(SocketPort.self, "NSSocketPort"),
(Bundle.self, "NSBundle"),
(ByteCountFormatter.self, "NSByteCountFormatter"),
(Host.self, "NSHost"),
(DateFormatter.self, "NSDateFormatter"),
(DateIntervalFormatter.self, "NSDateIntervalFormatter"),
(EnergyFormatter.self, "NSEnergyFormatter"),
(FileHandle.self, "NSFileHandle"),
(FileManager.self, "NSFileManager"),
(Formatter.self, "NSFormatter"),
(InputStream.self, "NSInputStream"),
(ISO8601DateFormatter.self, "NSISO8601DateFormatter"),
(JSONSerialization.self, "NSJSONSerialization"),
(LengthFormatter.self, "NSLengthFormatter"),
(MassFormatter.self, "NSMassFormatter"),
(NotificationQueue.self, "NSNotificationQueue"),
(NumberFormatter.self, "NSNumberFormatter"),
(Operation.self, "NSOperation"),
(OperationQueue.self, "NSOperationQueue"),
(OutputStream.self, "NSOutputStream"),
(PersonNameComponentsFormatter.self, "NSPersonNameComponentsFormatter"),
(Pipe.self, "NSPipe"),
(Progress.self, "NSProgress"),
(PropertyListSerialization.self, "NSPropertyListSerialization"),
(RunLoop.self, "NSRunLoop"),
(Scanner.self, "NSScanner"),
(Stream.self, "NSStream"),
(Thread.self, "NSThread"),
(Timer.self, "NSTimer"),
(UserDefaults.self, "NSUserDefaults"),
(FileManager.DirectoryEnumerator.self, "NSDirectoryEnumerator"),
(Dimension.self, "NSDimension"),
(Unit.self, "NSUnit"),
(UnitAcceleration.self, "NSUnitAcceleration"),
(UnitAngle.self, "NSUnitAngle"),
(UnitArea.self, "NSUnitArea"),
(UnitConcentrationMass.self, "UnitConcentrationMass"),
(UnitConverter.self, "NSUnitConverter"),
(UnitConverterLinear.self, "NSUnitConverterLinear"),
(UnitDispersion.self, "NSUnitDispersion"),
(UnitDuration.self, "NSUnitDuration"),
(UnitElectricCharge.self, "NSUnitElectricCharge"),
(UnitElectricCurrent.self, "NSUnitElectricCurrent"),
(UnitElectricPotentialDifference.self, "NSUnitElectricPotentialDifference"),
(UnitElectricResistance.self, "NSUnitElectricResistance"),
(UnitEnergy.self, "NSUnitEnergy"),
(UnitFrequency.self, "NSUnitFrequency"),
(UnitFuelEfficiency.self, "NSUnitFuelEfficiency"),
(UnitIlluminance.self, "NSUnitIlluminance"),
(UnitLength.self, "NSUnitLength"),
(UnitMass.self, "NSUnitMass"),
(UnitPower.self, "NSUnitPower"),
(UnitPressure.self, "NSUnitPressure"),
(UnitSpeed.self, "NSUnitSpeed"),
(UnitVolume.self, "NSUnitVolume"),
(UnitTemperature.self, "NSUnitTemperature"),
]
#if !(os(iOS) || os(Android))
map.append((Process.self, "NSTask"))
#endif
return map
}()
fileprivate var mapFromObjCNameToKnownName: [String: String] = {
var map: [String: String] = [:]
for entry in _NSClassesRenamedByObjCAPINotesInNetworkingOrXML {
map[entry.objCName] = entry.swiftName
}
return map
}()
fileprivate var mapFromKnownNameToObjCName: [String: String] = {
var map: [String: String] = [:]
for entry in _NSClassesRenamedByObjCAPINotesInNetworkingOrXML {
map[entry.swiftName] = entry.objCName
}
return map
}()
fileprivate var mapFromObjCNameToClass: [String: AnyClass] = {
var map: [String: AnyClass] = [:]
for entry in _NSClassesRenamedByObjCAPINotes {
map[entry.objCName] = entry.class
}
return map
}()
fileprivate var mapFromSwiftClassNameToObjCName: [String: String] = {
var map: [String: String] = [:]
for entry in _NSClassesRenamedByObjCAPINotes {
map[String(reflecting: entry.class)] = entry.objCName
}
return map
}()
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
private let _SwiftFoundationModuleName = "SwiftFoundation"
#else
private let _SwiftFoundationModuleName = "Foundation"
#endif
internal let _SwiftFoundationNetworkingModuleName = _SwiftFoundationModuleName + "Networking"
internal let _SwiftFoundationXMLModuleName = _SwiftFoundationModuleName + "XML"
/**
Returns the class name for a class. For compatibility with Foundation on Darwin,
Foundation classes are returned as unqualified names.
Only top-level Swift classes (Foo.bar) are supported at present. There is no
canonical encoding for other types yet, except for the mangled name, which is
neither stable nor human-readable.
*/
public func NSStringFromClass(_ aClass: AnyClass) -> String {
let classNameString = String(reflecting: aClass)
if let renamed = mapFromSwiftClassNameToObjCName[classNameString] {
return renamed
}
let aClassName = classNameString._bridgeToObjectiveC()
let components = aClassName.components(separatedBy: ".")
guard components.count == 2 else {
fatalError("NSStringFromClass: \(String(reflecting: aClass)) is not a top-level class")
}
if components[0] == _SwiftFoundationModuleName {
return components[1]
} else if components[0] == _SwiftFoundationNetworkingModuleName || components[0] == _SwiftFoundationXMLModuleName, let actualName = mapFromKnownNameToObjCName[classNameString] {
return actualName
} else {
return String(describing: aClassName)
}
}
/**
Returns the class metadata given a string. For compatibility with Foundation on Darwin,
unqualified names are looked up in the Foundation module.
Only top-level Swift classes (Foo.bar) are supported at present. There is no
canonical encoding for other types yet, except for the mangled name, which is
neither stable nor human-readable.
*/
public func NSClassFromString(_ aClassName: String) -> AnyClass? {
if let renamedClass = mapFromObjCNameToClass[aClassName] {
return renamedClass
}
let aClassNameWithPrefix : String
let components = aClassName._bridgeToObjectiveC().components(separatedBy: ".")
switch components.count {
case 1:
guard !aClassName.hasPrefix("_Tt") else {
NSLog("*** NSClassFromString(\(aClassName)): cannot yet decode mangled class names")
return nil
}
if let name = mapFromObjCNameToKnownName[aClassName] {
aClassNameWithPrefix = name
} else {
aClassNameWithPrefix = _SwiftFoundationModuleName + "." + aClassName
}
case 2:
aClassNameWithPrefix = aClassName
default:
NSLog("*** NSClassFromString(\(aClassName)): nested class names not yet supported")
return nil
}
return _typeByName(aClassNameWithPrefix) as? AnyClass
}
// The following types have been moved to FoundationNetworking or FoundationXML. They exist here only to allow appropriate diagnostics to surface in the compiler.
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias CachedURLResponse = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias HTTPCookie = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias HTTPCookieStorage = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias HTTPURLResponse = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLResponse = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSession = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionConfiguration = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionDataTask = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionDownloadTask = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionStreamTask = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionTask = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLSessionUploadTask = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLAuthenticationChallenge = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLCache = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLCredential = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLCredentialStorage = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLProtectionSpace = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
public typealias URLProtocol = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLDTD = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLDTDNode = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLDocument = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLElement = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLNode = AnyObject
@available(*, unavailable, message: "This type has moved to the FoundationXML module. Import that module to use it.")
public typealias XMLParser = AnyObject