Skip to content

macOS: move from objc and cocoa crates to the objc2 crates#240

Open
prokopyl wants to merge 11 commits intomasterfrom
obcj2
Open

macOS: move from objc and cocoa crates to the objc2 crates#240
prokopyl wants to merge 11 commits intomasterfrom
obcj2

Conversation

@prokopyl
Copy link
Copy Markdown
Member

@prokopyl prokopyl commented May 4, 2026

This PR removes the cocoa, core_foundation and objc crates as dependencies, and replaces them with the objc2 family of crates.

On top of removing outdated dependencies and bringing us closer to the rest of the ecosystem, objc2 brings a couple benefits:

  • Proper types throughout the codebase. objc exposed a lot of things as just id, and didn't manage null nor proper object retention at all.
  • Way fewer instances of unsafe. objc2 provides simple safe wrappers for a lot of the simple operations.

The goal of this PR is to update the invocations while changing as little logic as possible. Further refactorings and code cleanups are needed, but will come in later releases.

I have tested those changes successfully on macOS 26.2. More testing is always welcome however. 🙂

Comment thread src/macos/window.rs Outdated
Comment thread src/macos/window.rs Outdated
Comment thread src/macos/view.rs Outdated
@prokopyl prokopyl marked this pull request as draft May 4, 2026 20:21
@prokopyl prokopyl marked this pull request as ready for review May 5, 2026 10:30
@prokopyl prokopyl requested a review from micahrj May 5, 2026 10:30
@prokopyl prokopyl added this to the v0.1.1 - Updated foundations milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants