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.
- 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)
- 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.)
-
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 URLCredentialComplete Incomplete URLCredentialStorageUnimplemented None NSURLError*Complete N/A URLProtectionSpaceUnimplemented None URLProtocolUnimplemented None URLProtocolClientUnimplemented None NSURLRequestComplete Incomplete NSMutableURLRequestComplete Incomplete URLResponseComplete Incomplete NSHTTPURLResponseComplete Substantial NSURLMostly Complete Substantial Resource values remain unimplemented NSURLQueryItemComplete N/A URLResourceKeyComplete N/A URLFileResourceTypeComplete N/A URLComplete Incomplete URLResourceValuesComplete N/A URLComponentsComplete Incomplete URLRequestComplete None HTTPCookieComplete Incomplete HTTPCookiePropertyKeyComplete N/A HTTPCookieStorageMostly Complete Substantial 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 cancel(),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 ISO8601DateFormatterUnimplemented None LengthFormatterComplete Substantial MassFormatterComplete Substantial Needs localization NumberFormatterMostly Complete Substantial objectValue(_:range:)remains unimplementedPersonNameComponentsFormatterUnimplemented None ByteCountFormatterMostly Complete Substantial init?(coder:)remains unimplementedDateFormatterMostly Complete Incomplete objectValue(_:range:)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:)with streams remains unimplementedNSKeyedArchiverComplete Substantial NSKeyedCoderOldStyleArrayN/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 PropertyListSerializationComplete Incomplete -
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 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 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 NSCodingremains to be implementedNSMutableIndexSetMostly Complete Incomplete NSCodingremains to be implementedIndexSetComplete 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 Incomplete 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 NSRegularExpressionComplete Substantial ScannerMostly Complete Incomplete localizedScannerWithString(_:)remains unimplementedNSTextCheckingResultMostly Complete Incomplete NSCoding,NSCopying,resultType, andrange(at:)remain unimplementedNSAttributedStringMostly Complete Incomplete NSCodingremains unimplementedNSMutableAttributedStringMostly Complete Incomplete NSCodingremains unimplementedNSCharacterSetMostly Complete Incomplete NSCodingremains unimplementedNSMutableCharacterSetMostly Complete None Decoding remains unimplemented NSCFCharacterSetN/A N/A For internal use only CharacterSetComplete Incomplete NSStringMostly Complete Substantial enumerateSubstrings(in:options:using:)remains 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 NSRangeComplete Incomplete DecimalComplete Substantial NSDecimalNumberMostly Complete Substantial NSDecimalNumberHandlerComplete None CGPointComplete Substantial CGSizeComplete Substantial CGRectComplete Substantial NSEdgeInsetsComplete Substantial NSGeometryMostly Complete Substantial NSIntegralRectWithOptions.AlignRectFlippedsupport remains unimplementedCGFloatComplete Substantial AffineTransformComplete None NSAffineTransformComplete Substantial NSNumberComplete 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 Incomplete domain support, and forced objects remain unimplemented. NSLocaleComplete Incomplete Only unit test asserts locale key constant names LocaleComplete 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, and background operations remain unimplementedPipeComplete Incomplete FileManagerIncomplete Incomplete URL searches, relationship lookups, item copying, cross-device moving, recursive linking, and others remain unimplemented ProcessMostly Complete Substantial interrupt(),terminate(),suspend(), andresume()remain unimplementedBundleMostly Complete Incomplete allBundles,init(for:),unload(),classNamed(), andprincipalClassremain unimplementedProcessInfoComplete Substantial ThreadComplete Incomplete OperationComplete Incomplete BlockOperationComplete Incomplete OperationQueueComplete Incomplete LockComplete Incomplete ConditionLockComplete None RecursiveLockComplete None ConditionComplete Incomplete -
DateTime: Classes for representing dates, timezones, and calendars.
Entity Name Status Test Coverage Notes NSCalendarComplete None autoupdatingCurrent, andenumerateDatesremain unimplementedNSDateComponentsComplete None CalendarComplete Incomplete DateComponentsComplete Incomplete NSDateComplete Incomplete NSDateIntervalComplete None DateIntervalComplete None DateComplete Incomplete NSTimeZoneMostly Complete Incomplete local,timeZoneDataVersionand settingabbreviationDictionaryremain unimplementedTimeZoneComplete Incomplete -
Notifications: Classes for loosely coupling events from a set of many observers.
Entity Name Status Test Coverage Notes NSNotificationComplete N/A NotificationCenterComplete Substantial NotificationComplete 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 NSProgressComplete Substantial NSErrorComplete None NSUUIDComplete Substantial UUIDComplete None NSPersonNameComponentsComplete Incomplete PersonNameComponentsComplete None