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 NameStatusTest CoverageNotes
    NSEnumeratorCompleteNone
    NSGetSizeAndAlignmentCompleteNone
    NSStringFromClassMostly CompleteNoneOnly top-level Swift classes are supported
    NSClassFromStringMostly CompleteNoneOnly top-level Swift classes are supported; mangled names are not supported
    NSObjectCompleteNone
    NSSwiftRuntimeN/AN/AFor internal use only
    BoxingN/AN/AFor 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 NameStatusTest CoverageNotes
    URLAuthenticationChallengeUnimplementedNone
    URLCacheUnimplementedNone
    URLCredentialCompleteIncomplete
    URLCredentialStorageUnimplementedNone
    NSURLError*CompleteN/A
    URLProtectionSpaceUnimplementedNone
    URLProtocolUnimplementedNone
    URLProtocolClientUnimplementedNone
    NSURLRequestMostly CompleteIncomplete
    NSMutableURLRequestMostly CompleteIncomplete
    URLResponseMostly CompleteIncomplete
    NSHTTPURLResponseMostly CompleteSubstantial
    NSURLMostly CompleteSubstantialResource values remain unimplemented
    NSURLQueryItemMostly CompleteN/A
    URLResourceKeyCompleteN/A
    URLFileResourceTypeCompleteN/A
    URLCompleteIncomplete
    URLResourceValuesCompleteN/A
    URLComponentsCompleteIncomplete
    URLRequestCompleteNone
    HTTPCookieCompleteIncomplete
    HTTPCookiePropertyKeyCompleteN/A
    HTTPCookieStorageUnimplementedNone
    HostCompleteNone
    ConfigurationN/AN/AFor internal use only
    EasyHandleN/AN/AFor internal use only
    HTTPBodySourceN/AN/AFor internal use only
    HTTPMessageN/AN/AFor internal use only
    libcurlHelpersN/AN/AFor internal use only
    MultiHandleN/AN/AFor internal use only
    URLSessionMostly CompleteIncompleteshared, invalidation, resetting, flushing, getting tasks, and others remain unimplemented
    URLSessionConfigurationMostly CompleteIncompleteephemeral and background(withIdentifier:) remain unimplemented
    URLSessionDelegateCompleteN/A
    URLSessionTaskMostly CompleteIncompletecancel(), createTransferState(url:) with streams, and others remain unimplemented
    URLSessionDataTaskCompleteIncomplete
    URLSessionUploadTaskCompleteNone
    URLSessionDownloadTaskIncompleteIncompletecancel(byProducingResumeData:) remains unimplemented
    URLSessionStreamTaskUnimplementedNone
    TaskRegistryN/AN/AFor internal use only
    TransferStateN/AN/AFor internal use only
  • Formatters: Locale and language-correct formatted values.

    This group contains the is the base NSFormatter class and its subclasses. These formatters can be used for dates, numbers, sizes, energy, and many other types.

    Entity NameStatusTest CoverageNotes
    DateComponentFormatterUnimplementedNone
    DateIntervalFormatterUnimplementedNone
    EnergyFormatterUnimplementedNone
    ISO8601DateFormatterUnimplementedNone
    LengthFormatterCompleteSubstantial
    MassFormatterCompleteSubstantialNeeds localization
    NumberFormatterMostly CompleteSubstantialobjectValue(_:range:) remains unimplemented
    PersonNameComponentsFormatterUnimplementedNone
    ByteCountFormatterMostly CompleteSubstantialinit?(coder:) remains unimplemented
    DateFormatterMostly CompleteIncompleteobjectValue(_:range:) remain unimplemented
    FormatterCompleteN/A
    MeasurementFormatterUnimplementedNone
  • Predicates: Base functionality for building queries.

    This is the base class and subclasses for NSPredicate and NSExpression.

    Entity NameStatusTest CoverageNotes
    NSExpressionUnimplementedN/A
    NSComparisonPredicateUnimplementedN/A
    NSCompoundPredicateCompleteSubstantial
    NSPredicateIncompleteIncompleteOnly 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 NameStatusTest CoverageNotes
    NSJSONSerializationMostly CompleteSubstantialjsonObject(with:options:) with streams remains unimplemented
    NSKeyedArchiverCompleteSubstantial
    NSKeyedCoderOldStyleArrayN/AN/AFor internal use only
    NSKeyedUnarchiverMostly CompleteSubstantialdecodingFailurePolicy.set remains unimplemented
    NSKeyedArchiverHelpersN/AN/AFor internal use only
    NSCoderIncompleteN/ADecoding methods which require a concrete implementation remain unimplemented
    PropertyListSerializationCompleteIncomplete
  • XML: 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 NameStatusTest CoverageNotes
    XMLDocumentMostly CompleteSubstantialinit(), replacementClass(for:), and object(byApplyingXSLT...) remain unimplemented
    XMLDTDMostly CompleteSubstantialinit() remains unimplemented
    XMLDTDNodeCompleteIncomplete
    XMLElementIncompleteIncompleteinit(xmlString:), elements(forLocalName:uri:), attribute(forLocalName:uri:), namespace support, and others remain unimplemented
    XMLNodeIncompleteIncompletelocalName(forName:), prefix(forName:), predefinedNamespace(forPrefix:), and others remain unimplemented
    XMLParserCompleteIncomplete
  • 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 NameStatusTest CoverageNotes
    NSOrderedSetMostly CompleteSubstantialNS[Mutable]Copying, and array & set (and associated indexing methods) remain unimplemented
    NSMutableOrderedSetMostly CompleteSubstantialNSCoding and sortRange(_:options:, usingComparator:) with non-empty options remain unimplemented
    NSCFArrayN/AN/AFor internal use only
    NSIndexSetMostly CompleteIncompleteNSCoding, NSCopying, and concurrent enumerateWithOptions(_:range:paramType:returnType:block:) remain unimplemented
    NSMutableIndexSetMostly CompleteIncompleteshiftIndexesStarting(at:by:) remains unimplemented
    IndexSetCompleteIncomplete
    NSIndexPathMostly CompleteNoneNSCoding, NSCopying, getIndexes(_:) remain unimplemented
    IndexPathCompleteIncomplete
    NSArrayMostly CompleteSubstantialReading/writing to files/URLs, concurrent enumerateObjects(at:options:using:), and sortedArray(from:options:usingComparator:) with options remain unimplemented
    NSMutableArrayMostly CompleteSubstantialexchangeObject(at:withObjectAt:) and replaceObjects(in:withObjectsFromArray:) remain unimplemented for types other than NSMutableArray
    NSDictionaryMostly CompleteIncompleteNSCoding with non-keyed-coding archivers, descriptionInStringsFileFormat, sharedKeySet(forKeys:), and reading/writing to files/URLs remain unimplemented
    NSMutableDictionaryMostly CompleteIncompletedescriptionInStringsFileFormat, sharedKeySet(forKeys:), and reading/writing to files/URLs remain unimplemented
    NSCFDictionaryN/AN/AFor internal use only
    NSSetMostly CompleteIncompletedescription(withLocale:) and customMirror remain unimplemented
    NSMutableSetMostly CompleteIncompleteinit?(coder:) remains unimplemented
    NSCountedSetMostly CompleteIncompleteinit?(coder:) remains unimplemented
    NSCFSetN/AN/AFor internal use only
    NSCacheCompleteIncomplete
    NSSortDescriptorUnimplementedNone
  • RunLoop: Timers, streams and run loops.

    The classes in this group provide support for scheduling work and acting upon input from external sources.

    Entity NameStatusTest CoverageNotes
    PortUnimplementedNone
    MessagePortUnimplementedNone
    SocketPortUnimplementedNone
    PortMessageUnimplementedNone
    RunLoopMostly CompleteIncompleteadd(_: Port, forMode:) and remove(_: Port, forMode:) remain unimplemented
    NSStreamMostly CompleteSubstantial
    StreamUnimplementedSubstantialMethods which require a concrete implementation remain unimplemented
    InputStreamMostly CompleteSubstantialgetBuffer(_:length:) remains unimplemented
    NSOutputStreamCompleteSubstantial
    TimerCompleteSubstantial
  • 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 NameStatusTest CoverageNotes
    NSRegularExpressionCompleteSubstantial
    ScannerMostly CompleteIncompletescanHex<T: _FloatLike>(_:locale:locationToScanFrom:to:) and localizedScannerWithString(_:) remain unimplemented
    NSTextCheckingResultMostly CompleteIncompleteNSCoding, NSCopying, resultType, and range(at:) remain unimplemented
    NSAttributedStringIncompleteIncompleteNSCoding, NS[Mutable]Copying, attributedSubstring(from:), isEqual(to:), init(NSAttributedString:) remain unimplemented
    NSMutableAttributedStringUnimplementedIncompleteOnly addAttribute(_:value:range:) is implemented
    NSCharacterSetMostly CompleteIncompleteNSCoding remains unimplemented
    NSMutableCharacterSetMostly CompleteNoneDecoding remains unimplemented
    NSCFCharacterSetN/AN/AFor internal use only
    CharacterSetCompleteIncomplete
    NSStringMostly CompleteSubstantialinit(contentsOf:usedEncoding:), init(contentsOfFile:usedEncoding:), enumerateSubstrings(in:options:using:) remain unimplemented
    NSStringEncodingsCompleteN/AContains definitions of string encodings
    NSCFStringN/AN/AFor internal use only
    NSStringAPIN/AN/AExposes NSString APIs on String
    ExtraStringAPIsCompleteN/ARandom 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 NameStatusTest CoverageNotes
    NSRangeCompleteIncomplete
    DecimalUnimplementedNone
    NSDecimalNumberUnimplementedNone
    NSDecimalNumberHandlerUnimplementedNone
    CGPointCompleteSubstantial
    CGSizeCompleteSubstantial
    CGRectCompleteSubstantial
    NSEdgeInsetsMostly CompleteNone
    NSGeometryMostly CompleteSubstantialNSIntegralRectWithOptions .AlignRectFlipped support remains unimplemented
    CGFloatCompleteSubstantial
    AffineTransformCompleteNone
    NSAffineTransformCompleteSubstnatial
    NSNumberCompleteIncomplete
    NSConcreteValueN/AN/AFor internal use only
    NSSpecialValueN/AN/AFor internal use only
    NSValueCompleteSubstantial
    NSMeasurementUnimplementedNone
    MeasurementCompleteNone
    UnitConverterCompleteIncomplete
    UnitConverterLinearCompleteIncomplete
    UnitCompleteNone
    DimensionCompleteNone
    UnitAccelerationCompleteNone
    UnitAngleCompleteNone
    UnitAreaCompleteNone
    UnitConcentrationMassCompleteNone
    UnitDispersionCompleteNone
    UnitDurationCompleteNone
    UnitElectricChargeCompleteNone
    UnitElectricCurrentCompleteNone
    UnitElectricPotentialDifferenceCompleteNone
    UnitElectricResistanceCompleteNone
    UnitEnergyCompleteNone
    UnitFrequencyCompleteNone
    UnitFuelEfficiencyCompleteNone
    UnitLengthCompleteNone
    UnitIlluminanceCompleteNone
    UnitMassCompleteNone
    UnitPowerCompleteNone
    UnitPressureCompleteNone
    UnitSpeedCompleteNone
    UnitTemperatureCompleteNone
    UnitVolumeCompleteNone
  • UserDefaults: A mechanism for storing values to persist as user settings and local.

    Entity NameStatuesTest CoverageNotes
    UserDefaultsIncompleteNonedictionaryRepresentation(), domain support, and forced objects remain unimplemented. Unit tests are currently commented out
    NSLocaleCompleteIncompleteOnly unit test asserts locale key constant names
    LocaleCompleteIncompleteOnly 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 NameStatusTest CoverageNotes
    FileHandleMostly CompleteIncompleteNSCoding, and background operations remain unimplemented
    PipeCompleteIncomplete
    FileManagerIncompleteIncompleteURL searches, relationship lookups, item copying, cross-device moving, recursive linking, and others remain unimplemented
    ProcessMostly CompleteSubstantialinterrupt(), terminate(), suspend(), and resume() remain unimplemented
    BundleMostly CompleteIncompleteallBundles, init(for:), unload(), classNamed(), and principalClass remain unimplemented
    ProcessInfoCompleteSubstantial
    ThreadCompleteIncomplete
    OperationCompleteIncomplete
    BlockOperationCompleteIncomplete
    OperationQueueCompleteIncomplete
    LockCompleteIncomplete
    ConditionLockCompleteNone
    RecursiveLockCompleteNone
    ConditionCompleteIncomplete
  • DateTime: Classes for representing dates, timezones, and calendars.

    Entity NameStatusTest CoverageNotes
    NSCalendarCompleteNoneautoupdatingCurrent, and enumerateDates remain unimplemented
    NSDateComponentsCompleteNone
    CalendarCompleteIncomplete
    DateComponentsCompleteIncomplete
    NSDateCompleteIncomplete
    NSDateIntervalCompleteNone
    DateIntervalCompleteNone
    DateCompleteIncomplete
    NSTimeZoneMostly CompleteIncompletelocal, timeZoneDataVersion and setting abbreviationDictionary remain unimplemented
    TimeZoneCompleteIncomplete
  • Notifications: Classes for loosely coupling events from a set of many observers.

    Entity NameStatusTest CoverageNotes
    NSNotificationCompleteN/A
    NotificationCenterMostly CompleteSubstantialAdding observers to non-nil queues remains unimplemented
    NotificationCompleteN/A
    NotificationQueueCompleteSubstantial
  • Model: Representations for abstract model elements like null, data, and errors.

    Entity NameStatusTest CoverageNotes
    NSNullCompleteSubstantial
    NSDataCompleteSubstantial
    NSMutableDataCompleteSubstantial
    DataCompleteSubstantial
    NSProgressCompleteSubstantial
    NSErrorCompleteNone
    NSUUIDCompleteSubstantial
    UUIDCompleteNone
    NSPersonNameComponentsCompleteIncomplete
    PersonNameComponentsCompleteNone