Implementation Status
This document lays out the structure of the Foundation project, and provides the current implementation status of each major feature.
Foundation is divided into groups of related functionality. These groups are currently laid out in the Xcode project, even though they are in a flat structure on disk.
As Foundation is a work in progress, not all methods and functionality are present. When implementations are completed, this list should be updated to reflect the current state of the library.
Table Key
Implementation Status
- N/A: This entity is internal or private and implemented ad hoc; there are no guidelines in place to suggest what completion might look like
- Unimplemented: This entity exists, but all functions and methods are
NSUnimplemented() - Incomplete: Implementation of this entity has begun, but critical sections have been left
NSUnimplemented() - Mostly Complete: All critical sections of this entity have been implemented, but some methods might remain
NSUnimplemented() - Complete: No methods are left
NSUnimplemented()(though this is not a guarantee that work is complete -- there may be methods that need overriding or extra work)
Test Coverage
- N/A: This entity is internal and public tests are inappropriate, or it is an entity for which testing does not make sense
- None: There are no unit tests specific to this entity; even if it is used indirectly in other unit tests, we should have tests targeting this entity in isolation
- Incomplete: Unit tests exist for this entity, but there are critical paths that are not being tested
- Substantial: Most, if not all, of this entity's critical paths are being tested
There is no Complete status for test coverage because there are always additional tests to be implemented. Even entities with Substantial coverage are missing tests (e.g. NSCoding conformance, NSCopying conformance, descriptions, etc.)
Entities
Runtime: The basis for interoperability. The classes and methods in this group provide an interface for interoperability between C code and Swift. They also provide common layers used throughout the framework such as the root class
NSObject.Entity Name Status Test Coverage Notes NSEnumeratorComplete None NSGetSizeAndAlignmentComplete None NSStringFromClassMostly Complete None Only top-level Swift classes are supported NSClassFromStringMostly Complete None Only top-level Swift classes are supported; mangled names are not supported NSObjectComplete None NSSwiftRuntimeN/A N/A For internal use only BoxingN/A N/A For internal use only URL: Networking primitives
The classes in this group provide functionality for manipulating URLs and paths via a common model object. The group also has classes for creating and receiving network connections.
Entity Name Status Test Coverage Notes URLAuthenticationChallengeUnimplemented None URLCacheUnimplemented None URLCredentialMostly Complete Incomplete NSCodingandNSCopyingremain unimplementedURLCredentialStorageUnimplemented None NSURLError*Complete N/A URLProtectionSpaceUnimplemented None URLProtocolUnimplemented None URLProtocolClientUnimplemented None NSURLRequestMostly Complete Incomplete NSCodingremains unimplementedNSMutableURLRequestMostly Complete Incomplete NSCodingremains unimplementedURLResponseMostly Complete Incomplete NSCodingremains unimplementedNSHTTPURLResponseMostly Complete Substantial NSCodingremains unimplementedNSURLMostly Complete Substantial NSCodingwith non-keyed-coding archivers,checkResourceIsReachable(), and resource values remain unimplementedNSURLQueryItemMostly Complete N/A NSCodingremains unimplementedURLResourceKeyComplete N/A URLFileResourceTypeComplete N/A URLComplete Incomplete URLResourceValuesComplete N/A URLComponentsComplete Incomplete URLRequestComplete None HTTPCookieComplete Incomplete HTTPCookiePropertyKeyComplete N/A HTTPCookieStorageUnimplemented None HostComplete None ConfigurationN/A N/A For internal use only EasyHandleN/A N/A For internal use only HTTPBodySourceN/A N/A For internal use only HTTPMessageN/A N/A For internal use only libcurlHelpersN/A N/A For internal use only MultiHandleN/A N/A For internal use only URLSessionMostly Complete Incomplete shared, invalidation, resetting, flushing, getting tasks, and others remain unimplementedURLSessionConfigurationMostly Complete Incomplete ephemeralandbackground(withIdentifier:)remain unimplementedURLSessionDelegateComplete N/A URLSessionTaskMostly Complete Incomplete NSCopying,cancel(),error,createTransferState(url:)with streams, and others remain unimplementedURLSessionDataTaskComplete Incomplete URLSessionUploadTaskComplete None URLSessionDownloadTaskIncomplete Incomplete cancel(byProducingResumeData:)remains unimplementedURLSessionStreamTaskUnimplemented None TaskRegistryN/A N/A For internal use only TransferStateN/A N/A For internal use only Formatters: Locale and language-correct formatted values.
This group contains the is the base
NSFormatterclass and its subclasses. These formatters can be used for dates, numbers, sizes, energy, and many other types.Entity Name Status Test Coverage Notes DateComponentFormatterUnimplemented None DateIntervalFormatterUnimplemented None EnergyFormatterUnimplemented None LengthFormatterUnimplemented None MassFormatterUnimplemented None NumberFormatterMostly Complete Substantial objectValue(_:range:)remains unimplementedPersonNameComponentsFormatterUnimplemented None ByteCountFormatterUnimplemented Incomplete DateFormatterMostly Complete Incomplete objectValue(_:range:)andsetLocalizedDateFormatFromTemplate(_:)remain unimplementedFormatterComplete N/A MeasurementFormatterUnimplemented None Predicates: Base functionality for building queries.
This is the base class and subclasses for
NSPredicateandNSExpression.Entity Name Status Test Coverage Notes NSExpressionUnimplemented N/A NSComparisonPredicateUnimplemented N/A NSCompoundPredicateComplete Substantial NSPredicateIncomplete Incomplete Only boolean and block evaluations are implemented; all else remains unimplemented Serialization: Serialization and deserialization functionality.
The classes in this group perform tasks like parsing and writing JSON, property lists and binary archives.
Entity Name Status Test Coverage Notes NSJSONSerializationMostly Complete Substantial jsonObject(with:options:)remains unimplementedNSKeyedArchiverMostly Complete Substantial init()andencodedDataremain unimplementedNSKeyedCoderOldStyleArrayN/A N/A For internal use only NSKeyedUnarchiverMostly Complete Substantial decodingFailurePolicy.setremains unimplementedNSKeyedArchiverHelpersN/A N/A For internal use only NSCoderIncomplete N/A Decoding methods which require a concrete implementation remain unimplemented PropertyListSerializationMostly Complete Incomplete propertyList(with:options:format:)remains unimplementedXML: A group of classes for parsing and representing XML documents and elements.
The classes provided in this group are responsible for parsing and validating XML. They should be an interface for representing libxml2 in a more object-oriented manner.
Entity Name Status Test Coverage Notes XMLDocumentMostly Complete Substantial init(),replacementClass(for:), andobject(byApplyingXSLT...)remain unimplementedXMLDTDMostly Complete Substantial init()remains unimplementedXMLDTDNodeComplete Incomplete XMLElementIncomplete Incomplete init(xmlString:),elements(forLocalName:uri:),attribute(forLocalName:uri:), namespace support, and others remain unimplementedXMLNodeIncomplete Incomplete localName(forName:),prefix(forName:),predefinedNamespace(forPrefix:), and others remain unimplementedXMLParserComplete Incomplete Collections: A group of classes to contain objects.
The classes provided in this group provide basic collections. The primary role for these classes is to provide an interface layer between the CoreFoundation implementations and the standard library implementations. Additionally, they have useful extras like serialization support. There are also additional collection types that the standard library does not support.
Note: See Known Issues for more information about bridging between Foundation collection types and Swift standard library collection types.
Entity Name Status Test Coverage Notes NSOrderedSetMostly Complete Substantial NSCodingwith non-keyed-coding archivers,NS[Mutable]Copying, andarray&set(and associated indexing methods) remain unimplementedNSMutableOrderedSetMostly Complete Substantial NSCodingandsortRange(_:options:, usingComparator:)with non-empty options remain unimplementedNSCFArrayN/A N/A For internal use only NSIndexSetMostly Complete Incomplete NSCoding,NSCopying, and concurrentenumerateWithOptions(_:range:paramType:returnType:block:)remain unimplementedNSMutableIndexSetMostly Complete Incomplete shiftIndexesStarting(at:by:)remains unimplementedIndexSetComplete Incomplete NSIndexPathMostly Complete None NSCoding,NSCopying,getIndexes(_:)remain unimplementedIndexPathComplete Incomplete NSArrayMostly Complete Substantial Reading/writing to files/URLs, concurrent enumerateObjects(at:options:using:), andsortedArray(from:options:usingComparator:)with options remain unimplementedNSMutableArrayMostly Complete Substantial exchangeObject(at:withObjectAt:)andreplaceObjects(in:withObjectsFromArray:)remain unimplemented for types other thanNSMutableArrayNSDictionaryMostly Complete Incomplete NSCodingwith non-keyed-coding archivers,descriptionInStringsFileFormat,sharedKeySet(forKeys:), and reading/writing to files/URLs remain unimplementedNSMutableDictionaryMostly Complete Incomplete descriptionInStringsFileFormat,sharedKeySet(forKeys:), and reading/writing to files/URLs remain unimplementedNSCFDictionaryN/A N/A For internal use only NSSetMostly Complete Incomplete description(withLocale:)andcustomMirrorremain unimplementedNSMutableSetMostly Complete Incomplete init?(coder:)remains unimplementedNSCountedSetMostly Complete Incomplete init?(coder:)remains unimplementedNSCFSetN/A N/A For internal use only NSCacheComplete None NSSortDescriptorUnimplemented None RunLoop: Timers, streams and run loops.
The classes in this group provide support for scheduling work and acting upon input from external sources.
Entity Name Status Test Coverage Notes PortUnimplemented None MessagePortUnimplemented None SocketPortUnimplemented None PortMessageUnimplemented None RunLoopMostly Complete Incomplete add(_: Port, forMode:)andremove(_: Port, forMode:)remain unimplementedNSStreamMostly Complete Substantial StreamUnimplemented Substantial Methods which require a concrete implementation remain unimplemented InputStreamMostly Complete Substantial getBuffer(_:length:)remains unimplementedNSOutputStreamComplete Substantial TimerComplete Substantial String: A set of classes for scanning, manipulating and storing string values.
The NSString implementation is present to provide an interface layer between CoreFoundation and Swift, but it also adds additional functionality on top of the Swift standard library String type. Other classes in this group provide mechanisms to scan, match regular expressions, store attributes in run arrays attached to strings, and represent sets of characters.
Note: See Known Issues for more information about bridging between the Foundation NSString types and Swift standard library String type.
Entity Name Status Test Coverage Notes RegularExpressionMostly Complete Substantial NSCodingremains unimplementedScannerMostly Complete Incomplete scanHex<T: _FloatLike>(_:locale:locationToScanFrom:to:)andlocalizedScannerWithString(_:)remain unimplementedTextCheckingResultMostly Complete Incomplete NSCoding,NSCopying,resultType, andrange(at:)remain unimplementedNSAttributedStringIncomplete Incomplete NSCoding,NS[Mutable]Copying,attributedSubstring(from:),isEqual(to:),init(NSAttributedString:), andenumerateAttributes(...)remain unimplementedNSMutableAttributedStringUnimplemented Incomplete Only addAttribute(_:value:range:)is implementedNSCharacterSetMostly Complete Incomplete NSCodingremains unimplementedNSMutableCharacterSetMostly Complete None Decoding remains unimplemented NSCFCharacterSetN/A N/A For internal use only CharacterSetComplete Incomplete NSStringMostly Complete Substantial init(contentsOf:usedEncoding:),init(contentsOfFile:usedEncoding:),enumerateSubstrings(in:options:using:)remain unimplementedNSStringEncodingsComplete N/A Contains definitions of string encodings NSCFStringN/A N/A For internal use only NSStringAPIN/A N/A Exposes NSStringAPIs onStringExtraStringAPIsComplete N/A Random access for String.UTF16View, only when Foundation is imported; decouples the Swift core from a UTF16 representation.Number: A set of classes and methods for representing numeric values and structures.
Entity Name Status Test Coverage Notes NSRangeMostly Complete Incomplete NSCodingfrom non-keyed-coding archivers remains unimplementedDecimalUnimplemented None NSDecimalNumberUnimplemented None NSDecimalNumberHandlerUnimplemented None CGPointComplete Substantial CGSizeComplete Substantial CGRectComplete Substantial NSEdgeInsetsMostly Complete None NSCodingfrom non-keyed-coding archivers remains unimplementedNSGeometryMostly Complete Substantial NSIntegralRectWithOptions.AlignRectFlippedsupport remains unimplementedCGFloatComplete Substantial AffineTransformComplete None NSAffineTransformMostly Complete Substnatial NSCodingremains unimplementedNSNumberComplete Incomplete NSConcreteValueN/A N/A For internal use only NSSpecialValueN/A N/A For internal use only NSValueComplete Substantial NSMeasurementUnimplemented None MeasurementComplete None UnitConverterComplete Incomplete UnitConverterLinearComplete Incomplete UnitComplete None DimensionComplete None UnitAccelerationComplete None UnitAngleComplete None UnitAreaComplete None UnitConcentrationMassComplete None UnitDispersionComplete None UnitDurationComplete None UnitElectricChargeComplete None UnitElectricCurrentComplete None UnitElectricPotentialDifferenceComplete None UnitElectricResistanceComplete None UnitEnergyComplete None UnitFrequencyComplete None UnitFuelEfficiencyComplete None UnitLengthComplete None UnitIlluminanceComplete None UnitMassComplete None UnitPowerComplete None UnitPressureComplete None UnitSpeedComplete None UnitTemperatureComplete None UnitVolumeComplete None UserDefaults: A mechanism for storing values to persist as user settings and local.
Entity Name Statues Test Coverage Notes UserDefaultsIncomplete None dictionaryRepresentation(), domain support, and forced objects remain unimplemented. Unit tests are currently commented outNSLocaleMostly Complete Incomplete NSCodingfrom non-keyed-coding archivers remains unimplemented. Only unit test asserts locale key constant namesLocaleComplete Incomplete Only unit test asserts value copying OS: Mechanisms for interacting with the operating system on a file system level as well as process and thread level
Entity Name Status Test Coverage Notes FileHandleMostly Complete Incomplete NSCoding,nullDevice, and background operations remain unimplementedPipeComplete Incomplete FileManagerIncomplete Incomplete URL searches, relationship lookups, item copying, cross-device moving, recursive linking, and others remain unimplemented TaskMostly Complete Substantial interrupt(),terminate(),suspend(),resume(), andterminationReasonremain unimplementedBundleMostly Complete Incomplete allBundles,init(for:),unload(),classNamed(), andprincipalClassremain unimplementedProcessInfoComplete Substantial ThreadIncomplete Incomplete isMainThread,mainThread,name,callStackReturnAddresses, andcallStackSymbolsremain unimplementedOperationComplete Incomplete BlockOperationComplete Incomplete OperationQueueComplete Incomplete LockMostly Complete None lock(before:)remains unimplementedConditionLockComplete None RecursiveLockMostly Complete None lock(before:)remains unimplementedConditionComplete None DateTime: Classes for representing dates, timezones, and calendars.
Entity Name Status Test Coverage Notes NSCalendarMostly Complete None NSCodingfrom non-keyed-coding archivers,autoupdatingCurrent, andenumerateDatesremain unimplementedNSDateComponentsMostly Complete None NSCodingfrom non-keyed-coding archivers remains unimplementedCalendarComplete Incomplete DateComponentsComplete Incomplete NSDateMostly Complete Incomplete Encoding to non-keyed-coding archivers and timeIntervalSinceReferenceDateremain unimplementedNSDateIntervalComplete None DateIntervalComplete None DateComplete Incomplete NSTimeZoneMostly Complete Incomplete localand settingabbreviationDictionaryremain unimplementedTimeZoneComplete Incomplete Notifications: Classes for loosely coupling events from a set of many observers.
Entity Name Status Test Coverage Notes NSNotificationComplete N/A NotificationCenterMostly Complete Substantial Adding observers to non- nilqueues remains unimplementedNotificationComplete N/A NotificationQueueComplete Substantial Model: Representations for abstract model elements like null, data, and errors.
Entity Name Status Test Coverage Notes NSNullComplete Substantial NSDataComplete Substantial NSMutableDataComplete Substantial DataComplete Substantial NSProgressUnimplemented None NSErrorComplete None NSUUIDComplete Substantial UUIDComplete None NSPersonNameComponentsMostly Complete None NSCopyingremains unimplementedPersonNameComponentsComplete None