beeware / beeware/rubicon-objc

Remove use of Core Foundation?

Open
#74 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
301
Forks
70
Avg merge
1d 8h
Merged PRs (30d)
18

Description

Should we eventually remove the use of Core Foundation for operations like creating strings and collections? As far as I can tell, there are no bootstrapping issues where Core Foundation would be needed to access Foundation APIs. For example, `NSString`s can be created from bare C data using the [`+[NSString stringWithUTF8String:]`](https://developer.apple.com/documentation/foundation/nsstring/1497379-stringwithutf8string?language=objc) or [`+[NSString stringWithCharacters:length:]`](https://developer.apple.com/documentation/foundation/nsstring/1497248-stringwithcharacters?language=objc) methods.

The advantage of using only Foundation is that we don't need to interface with an additional library. It's not necessary to use Core Foundation directly even with APIs that only accept Core Foundation types, because the corresponding Foundation types can be used instead, using toll-free bridging. Foundation is also more high-level and easy to use - you don't need to declare all the functions and manually keep track of object types, the Objective-C runtime takes care of everything.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.