11 KiB
Changelog
Changes to the objc2::foundation module will be documented in this file.
This previously existed as a separate crate objc2_foundation, hence the
separation.
The format is based on Keep a Changelog.
Unreleased - YYYY-MM-DD
objc2 0.3.0-beta.3 - 2022-09-01
Added
- Added
NSSet. - Added
NSMutableSet. - Added
NSMutableDictionary. - Added
NSNotFound. - Added
NSBundle. - Added
NSTimeInterval. - Added
NSString::len_utf16andNSAttributedString::len_utf16. - Added
NSString::concatandNSString::join_path. - Added
CGSize,CGPointandCGRect(just aliases to equivalentNS-types, but helps readability).
Changed
- BREAKING:
NSSize::newno longer requires it's arguments to be non-negative. UseNSSize::absorNSRect::standardizeif the API you're binding to requires a non-negative size.
objc2 0.3.0-beta.2 - 2022-08-28
Added
- Added
NSNumber. - Added
NSError. - Implement
UnwindSafeandRefUnwindSafefor all objects. - Implemented
IntoIteratorfor references toNSArray,NSMutableArray,NSDataandNSMutableData. - Implemented
ExtendforNSMutableArray. - Add extra
Extend<&u8>impl forNSMutableData. - Added function
NSValue::contains_encodingfor determining if the encoding of theNSValuematches the encoding of the given type. - Added functions
get_range,get_point,get_sizeandget_recttoNSValueto help safely returning various types it will commonly contain. NSArrayandNSMutableArraynow have sensible defaults for the ownership of the objects they contain.
Changed
- BREAKING: Moved from external crate
objc2_foundationintoobjc2::foundation. - BREAKING: Made
NSValuenot generic any more. While we loose some type-safety from this, it makesNSValuemuch more useful in the real world! - BREAKING: Made
NSArray::newgeneric over ownership. - BREAKING: Made
NSObject::is_kind_oftake a genericT: ClassTypeinstead of aruntime::Class.
Fixed
- Made
Debugimpls for all objects print something useful.
Removed
NSObject::hash_code,NSObject::is_equalandNSObject::descriptionin favour of just having the trait implementationsHash,PartiqalEqandDebug.
objc2-foundation 0.2.0-alpha.6 - 2022-07-19
Added
- Added
MainThreadMarkerto help with designing APIs where a method is only safe to call on the main thread. - Added
NSExceptionobject. - Added
extern_class!macro to help with defining interfaces to classes. Further changelog for this can be found inCHANGELOG.md. - Added
declare_class!macro to help with declaring custom classes. Further changelog for this can be found inCHANGELOG.md. - Expose the
objc2version that this uses in the crate root. - Added
NSZone.
Changed
- Changed a few
Debugimpls.
objc2-foundation 0.2.0-alpha.5 - 2022-06-13
Added
-
Objects now
Derefto their superclasses. E.g.NSMutableArrayderefs toNSArray, which derefs toNSObject, which derefs toObject.This allows more ergonomic usage.
-
Implement
PartialOrdandOrdforNSStringandNSRange. -
Added
NSString::has_prefixandNSString::has_suffix. -
Added
NSRangemethodsnew,is_empty,containsandend. -
Added
NSThreadobject. -
Added
is_multi_threadedandis_main_threadhelper functions. -
Added
NSProcessInfoobject. -
Added
NSMutableDatamethodsfrom_data,with_capacityandpush. -
Added
io::Writeanditer::Extendimplementation forNSMutableData. -
Added
NSUUIDobject. -
Added
NSMutableStringobject. -
Added basic
NSAttributedStringobject. -
Added basic
NSMutableAttributedStringobject. -
Added
NSIntegerandNSUInteger(type aliases toisizeandusize). -
Added
CGFloat. -
Added
NSPoint. -
Added
NSSize. -
Added
NSRect. -
Implement
BorrowandBorrowMutfor all objects. -
Implement
ToOwnedfor copyable types.
Changed
-
BREAKING: Removed the following helper traits in favor of inherent methods on the objects themselves:
INSMutableArrayINSArrayINSMutableDataINSDataINSDictionaryINSStringINSValueINSObject
This changed because objects now deref to their superclasses.
-
BREAKING: Relaxed a lot of bounds from
INSObjecttoMessage. At some point in the future a new trait will be introduced which remedies this change. -
BREAKING: Removed the
Iprefix from:INSCopying(nowNSCopying)INSMutableCopying(nowNSMutableCopying)INSFastEnumeration(nowNSFastEnumeration)
-
BREAKING: Renamed
NSMutableData::appendtoextend_from_slice.
0.2.0-alpha.4 - 2022-01-03
Added
- Implement
PartialOrdandOrdforNSComparisonResultandNSValue. - Implement
fmt::DisplayforNSValue. - Implement
DefaultIdfor relevant objects. - Implement
AsRefandIndexforNSDataandNSMutableData. - Implement
AsMutandIndexMutforNSMutableData.
Changed
- BREAKING: Renamed
INSFastEnumeration::enumeratortoINSFastEnumeration::iter_fast.
Removed
- BREAKING: Removed
DerefandDerefMutfromNSDataandNSMutableData, since these invoke a non-trivial amount of code, and could easily lead to hard-to-diagnose performance issues.
objc2-foundation 0.2.0-alpha.3 - 2021-12-22
Added
- BREAKING: Added associated
Ownershiptype toNSCopying. - BREAKING: Added associated
Ownershiptype toINSData. - BREAKING: Added associated
Ownershiptype toINSArray. - Added common trait impls (
PartialEq,Eq,HashandDebug) toNSValue,NSDictionary,NSArrayandNSMutableArray.
Changed
- BREAKING: Made some creation methods a bit less generic (e.g.
INSDictionary::from_keys_and_objectsnow always returnsId<_, Shared>). - Relax bounds on generic
INSObjectimpls.
Removed
- BREAKING: Removed associated
Ownershiptype fromINSObject; instead, it is present on the types that actually need it (for exampleNSCopying). - BREAKING: Removed
Sizedbound onINSObject.
Fixed
- Soundness issue with
NSValue,NSDictionary,NSArrayandNSMutableArraynot being#[repr(C)]. - BREAKING:
NSObjectis no longerSendandSync(because its subclasses may not be).
objc2-foundation 0.2.0-alpha.2 - 2021-11-22
Added
- BREAKING: Added associated
Ownershiptype toINSObjectto specify whether the type can be mutated or not.NSStringis a prime example of a type that you may never get aOwned/&mutreference to, since it is very easy to create twoNSStrings with the same underlying allocation. - Added helper
is_emptymethods. - Added
INSArray::first_mutandINSArray::last_mut.
Changed
- BREAKING: Renamed a lot of methods to better match Rusts naming scheme:
INSArraycount->lenobject_at->getmut_object_at->get_mutshared_object_at->get_retainedfirst_object->firstlast_object->lastobject_enumerator->iter
INSMutableArrayadd_object->pushinsert_object_at->insertreplace_object_at->replaceremove_object_at->removeremove_last_object->popremove_all_objects->clear
INSDictionarycount->lenobject_for->getkey_enumerator->iter_keysobject_enumerator->iter_values
INSValuevalue->getfrom_value->new
NSComparisonResultfrom_ordering->fromas_ordering->into
NSRangefrom_range->fromas_range->into
- Use
SliceIdfor better performance when creating arrays and dictionaries.
Removed
- BREAKING: Removed the
object_struct!macro. It may be re-added in another form in the future. - BREAKING: Removed
NSMutableSharedArray<T>andNSSharedArray<T>type aliases. UseNSMutableArray<T, Shared>andNSArray<T, Shared>instead. - BREAKING: Removed
Any / 'staticbound onINSObject. This allows implementing it for objects that contain lifetimes from the outer scope.
Fixed
- BREAKING: Marked
INS...traits asunsafeto implement. - BREAKING: Removed
newmethod fromINSObjectsince some classes don't want this called. It has been re-added to otherINS...traits on a case by case basis (in particular notNSValue). - BREAKING:
INSString::as_strnow takes an a reference toobjc2::rc::AutoreleasePool. This ensure that the returned&stris only used while the current autorelease pool is valid. - Fixed
NSData::from_vecon GNUStep.
objc2-foundation 0.2.0-alpha.1 - 2021-10-28
Added
- Implement new
RefEncodetrait for objects. - Implement
EncodeforNSComparisonResultandNSFastEnumerationState. - Implement
RefEncodefor objects andNSFastEnumerationState.
Changed
- BREAKING: Uses
Idfromobjc2::rcmodule instead ofobjc_idcrate. - BREAKING:
INSValue::encodingnow returns&strinstead ofEncoding.
Fixed
- Use proper
#[repr(C)]structs to represent Objective-C objects. INSString::from_stron GNUStep (UTF8_ENCODINGwas the wrong type).
objc2-foundation 0.2.0-alpha.0 - 2021-08-29
Note: This is the version that is, as of this writing, available on the
master branch in the original objc-foundation project.
Added
- Implement
DisplayforNSString. - Make
INSObject::classfaster using theobjc::class!macro.
Changed
- BREAKING: Forked the project, the crate name is now
objc2-foundation.
Fixed
- Fixed types in various calls to
objc::msg_send!for better verification.
objc-foundation 0.1.1 - 2016-06-19
Fixed
- An issue with passing functions (instead of function pointers) in
INSMutableArray::sort_by.
objc-foundation 0.1.0 - 2016-03-20
Changed
- Update
objctov0.2. - Update
objc_idtov0.1.
objc-foundation 0.0.4 - 2015-12-09
Removed
libcdependency.
objc-foundation 0.0.3 - 2015-11-07
Added
object_struct!macro.
Changed
libcversion can both be0.1and0.2.
objc-foundation 0.0.2 - 2015-09-03
Added
Anybound onINSObject, because of a change inobjcv0.1.6.
objc-foundation 0.0.1 - 2015-06-13
Initial release.