NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3994 most downloaded on crates.io
Bindings to Apple's frameworks
Last release 2 years ago
no release in 18 months
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 6 of 7 stable releases
1 version withdrawn
withdrawn after publishing
4 years old
8 releases · first in 2022
One column per quarter.
Nothing published for this version
Deprecated the icrate crate, it has been split into multiple smaller crates.
icrate crate, it has been split into multiple smaller crates.Breaking changes are noted elsewhere in this changelog entry.
MainThreadMarker From implementation for MainThreadOnly types.Send and Sync implementations for a bunch more types (same as the
ones Swift marks as @Sendable).AppKit safe.NSCopying and NSMutableCopying zone methods.Eq and Ord implementations for NSNumber, since its
handling of floating point values allows it.NS[Mutable]Dictionary::from_id_slice and
NS[Mutable]Dictionary::from_slice.NSMutableDictionary::insert and NSMutableSet::insert which can
be more efficient than the previous insertion methods.Updated SDK from Xcode 14.2 to 15.0.1.
View the release notes to learn more details:
Breaking changes are noted elsewhere in this changelog entry.
Moved the ns_string! macro to icrate::Foundation::ns_string. The old
location in the crate root is deprecated.
BREAKING: The following two methods on
MTLAccelerationStructureCommandEncoder now take a nullable scratch buffer:
refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffsetrefitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_optionsBREAKING: Marked UI-related classes as MainThreadOnly, and UI-related
protocols as IsMainThreadOnly.
This means that they can now only be constructed, retrieved and used on the
main thread, meaning you usually have to aquire a MainThreadMarker first.
// Before
let app = unsafe { NSApplication::sharedApplication() };
let view = unsafe { NSView::initWithFrame(NSView::alloc(), frame) };
// Do something with `app` and `view`
// After
let mtm = MainThreadMarker::new().unwrap();
let app = unsafe { NSApplication::sharedApplication(mtm) };
let view = unsafe { NSView::initWithFrame(mtm.alloc(), frame) };
// Do something with `app` and `view`
BREAKING: Changed the NSApp static to be a function taking MainThreadMarker.
BREAKING: Renamed NS[Mutable]Dictionary::from_keys_and_objects to
NS[Mutable]Dictionary::from_vec.
BREAKING: Renamed NSMutableDictionary::insert and
NSMutableSet::insert to insert_id.
BREAKING: CWWiFiClient::interfaceNames has been renamed to CWWiFiClient::interfaceNames_class.
BREAKING: Updated objc2 to v0.5.0.
BREAKING: Updated block2 to v0.4.0.
MainThreadMarker argument from the closure
passed to MainThreadBound::get_on_main.Foundation::CopyHelper since it is superseded by
objc2::mutability::CounterpartOrSelf.NSFileProviderDomain::volumeUUIDCLBeaconIdentityConstraint::UUIDCLBeaconIdentityConstraint::majorCLBeaconIdentityConstraint::minorASIdentifierManager::clearAdvertisingIdentifierMetricKit::_MXSignpostMetricsSnapshot function.Eq + Hash requirement on most NSDictionary and
NSSet methods, thereby making sure that the types are actually correct
to use in such hashing collections.HasStableHash requirement on NSDictionary and
NSSet creation methods, fixing a long-standing soundess issue.NSAccessibilityElementProtocol,
NSTextAttachmentCellProtocol and NSFileProviderItemProtocol.Message (although
most of their trait implementations still require that).NSCopying and
NSMutableCopying protocols not act as regular protocols (many methods used
AnyObject instead of the correct ProtocolObject<dyn NSCopying>).NSPopover and NSLayoutAnchor.CKSystemSharingUIObserver and CKLocationSortDescriptor are no longer marked thread safe.NSColor::ignoresAlpha now requires a main thread marker.BREAKING: Updated block2 to v0.3.0.
block2 to v0.3.0.Added the following frameworks:
HealthKitMediaPlayerMetricKitPhotoKitNSCopying and NSMutableCopying implementations for the classes
that implement those protocols.NSArray::get_retainedNSArray::first_retainedNSArray::last_retainedNSSet::get_retainedNSSet::to_vecNSSet::to_vec_retainedNSDictionary::get_retainedNSDictionary::keys_retainedNSDictionary::values_retainedMainThreadMarker::alloc for allocating objects that need to be so on
the main thread.new/init methods for all types.FromIterator impls for various collection types.BREAKING: Renamed the from_slice method on NSArray, NSSet,
NSMutableArray and NSMutableSet to from_id_slice, and provided a new
from_slice method that takes &[&T] instead.
BREAKING: Changed NSMutableArray::replace to return an Result in
case the index was out of bounds.
BREAKING: Changed NSMutableArray::remove to return an Option in case
the index was out of bounds.
BREAKING: Removed ownership parameter from generic types, since the
ownership/mutability information is now stored in ClassType::Mutability.
BREAKING: Renamed NSMutableCopying::mutable_copy to ::mutableCopy.
BREAKING: The default value for NSUUID was changed from a nil UUID to
a new random UUID.
BREAKING: Changed how iteration works.
Instead of the single NSFastEnumerator, we now have concrete types
array::Iter, array::IterMut, array::IterRetained and
array::IntoIter, which allows iterating over NSArray in different ways.
Combined with proper IntoIterator implementations for collection types,
you can now do:
let mut array: Id<NSMutableArray<T>> = ...;
for item in &array {
// item: &T
}
// If T: IsMutable
for item in &mut array {
// item: &mut T
}
// If T: IsIdCloneable
for item in array.iter_retained() {
// item: Id<T>
}
for item in array {
// item: Id<T>
}
(similar functionality exist for NSSet and NSDictionary).
BREAKING: Renamed NSDictionary methods:
keys -> keys_vec.values -> values_vec.values_mut -> values_vec_mut.keys_and_objects -> to_vecs.iter_keys -> keys.iter_values -> values.BREAKING: NSDictionary::keys_retained and
NSDictionary::values_retained now return an iterator instead.
BREAKING: Updated objc2 to v0.4.0.
BREAKING: Updated block2 to v0.2.0.
NSProxy methods.NSArray::to_shared_vec and NSArray::into_vec, use
NSArray::to_vec or NSArray::to_vec_retained instead.NSCopying and
NSMutableCopying, that information is now specified in
ClassType::Mutability instead.init methods on subclasses that were declared
on categories on their superclass. These should be re-added at some point.Added #[deprecated] annotations to the autogenerated output.
AccessibilityAdServicesAdSupportAutomaticAssessmentConfigurationAutomatorBackgroundAssetsBackgroundTasksBusinessChatCallKitClassKitCloudKitContactsCoreLocationDataDetectionDeviceCheckEventKitExceptionHandlingExtensionKitExternalAccessoryFileProviderFileProviderUIGameControllerGameKitIdentityLookupInputMethodKitLinkPresentationLocalAuthenticationLocalAuthenticationEmbeddedUIMailKitMapKitMetalMetalFXMetalKitOSAKitCoreAnimation (also known as QuartzCore)SoundAnalysisSpeechStoreKitUniformTypeIdentifiersUserNotificationsWebKit14.0.1 to 14.2.
Foundation::MainThreadBound helper struct for things that are only
accesible from the main thread.#[deprecated] annotations to the autogenerated output.NSThread::threadPriority
vs. NSThread::threadPriority_class).Cfg-gated static ns_string! functionality behind the
unstable-static-nsstring cargo feature.
Autogenerated method parameters are now in snake-case, for better IDE support.
BREAKING: Cfg-gate all classes, and everything that references said classes.
This means that to use e.g. Foundation::NSThread::name, you have to enable
the Foundation_NSThread and Foundation_NSString cargo features.
BREAKING: Updated objc2 to v0.3.0-beta.5.
BREAKING: Updated block2 to v0.2.0-alpha.8.
uuid integration, since one might want to use
icrate internally in that crate in the future, and that would break.NSNib::instantiateWithOwner_topLevelObjects,
NSBundle::loadNibNamed_owner_topLevelObjects and NSFreeMapTable since
they had weird memory management.*mut pointers that should've been *const.Shared.TodoProtocols.structs.NSProxy trait methods.Added NSLock class and NSLocking protocol.
NSString::write_to_file.NSLock class and NSLocking protocol.AppKitAuthenticationServicesCoreDataFoundationobjc2::foundation into icrate::Foundation.NSString
concat -> stringByAppendingStringjoin_path -> stringByAppendingPathComponenthas_prefix -> hasPrefixhas_suffix -> hasSuffixNSMutableString
from_nsstring -> stringWithStringwith_capacity -> stringWithCapacitypush_nsstring -> appendStringreplace -> setStringNSAttributedString
init_with_attributes -> unsafe initWithString_attributesinit_with_string -> initWithStringnew_with_attributes -> unsafe new_with_attributeslen_utf16 -> lengthNSMutableAttributedString
replace -> setAttributedStringNSBundle
main -> mainBundleinfo -> infoDictionaryNSDictionary
keys_array -> allKeysinto_values_array -> allValuesNSMutableDictionary
clear -> removeAllObjectsNSMutableArray
clear -> removeAllObjectsNSMutableSet
clear -> removeAllObjectsNSError
user_info -> userInfolocalized_description -> localizedDescriptionNSException
user_info -> userInfoNSMutableData
from_data -> dataWithDatawith_capacity -> dataWithCapacityset_len -> setLengthNSUUID
new_v4 -> UUIDstring -> UUIDStringNSThread
current -> currentThreadmain -> mainThreadis_main -> isMainThreadNSProcessInfo
process_info -> processInfoNSComparisonResult work like all other enums.NSDictionary to be Shared by default.NSEnumerator, NSFastEnumeration and
NSFastEnumerator until the story around them are properly figured out.NSArray::objects_in_range return an Option (it was
unsound before).NSZone not specifying a #[repr(...)].Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →