Skip to content

Move NotificationCenter to swift-foundation #5246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

cthielen
Copy link
Contributor

This PR moves NotificationCenter into swift-foundation.

  • NotificationCenter is now defined in swift-foundation, with some methods kept in swift-corelibs-foundation via extension. This has the result of removing the ability to override these methods, e.g. addObserver(forName:object:queue:block) cannot be open in an extension.
  • NotificationCenter no longer conforms to NSObject in swift-corelibs-foundation due to the lack of NSObject in swift-foundation, where NotificationCenter is now defined, and the inability to add that inheritance retroactively in swift-corelibs-foundation.
  • Core logic for NotificationCenter was moved to swift-foundation and is accessed via @_spi(SwiftCorelibsFoundation) public methods. This enables methods like addObserver(forName:object:queue:block) to remain in swift-corelibs-foundation.

@cthielen
Copy link
Contributor Author

@swift-ci please test

@cthielen
Copy link
Contributor Author

swiftlang/swift-foundation#1452

@swift-ci please test

1 similar comment
@cthielen
Copy link
Contributor Author

swiftlang/swift-foundation#1452

@swift-ci please test

@cthielen
Copy link
Contributor Author

@swift-ci please test

@cthielen
Copy link
Contributor Author

swiftlang/swift-foundation#1452

@swift-ci please test

1 similar comment
@cthielen
Copy link
Contributor Author

swiftlang/swift-foundation#1452

@swift-ci please test

@cthielen cthielen merged commit c2023c7 into swiftlang:main Aug 5, 2025
2 checks passed
@cthielen cthielen deleted the cthielen/notification-center-messages branch August 5, 2025 17:18
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