Skip to content

Make Base.ViewController Obj-c compatible #155

Merged
olejnjak merged 8 commits intomainfrom
bug/obj-c-name
Mar 30, 2026
Merged

Make Base.ViewController Obj-c compatible #155
olejnjak merged 8 commits intomainfrom
bug/obj-c-name

Conversation

@komkovla
Copy link
Copy Markdown
Contributor

Refactor Base ViewController to be Obj-C compatible (backward compatible)

Problem

Base.ViewController was defined as a nested class inside public enum Base {}.
While this works in pure Swift, it breaks Objective-C interoperability and causes build failures when subclassed across modules (e.g. missing superclass in Module-Swift.h).

This affects:

  • Build for module with ENABLE_MODULE_VERIFIER set to true
  • UIKit subclassing
  • Obj-C header generation
  • Cross-module inheritance
  • Storyboards / runtime reflection

Solution

  • Introduced a top-level BaseViewController : UIViewController
  • Moved Base.ViewController to the top level BaseViewController
  • Kept Base as a namespace only for constants / configuration
  • Preserved backward compatibility using a deprecated typealias
  • Might be breaking change for users that used class BaseViewController: Base.ViewController because of naming clash

Checklist

  • Added tests (if applicable) - no tests needed

@komkovla komkovla requested a review from olejnjak January 20, 2026 16:08
@olejnjak olejnjak self-requested a review January 22, 2026 13:13
Copy link
Copy Markdown
Member

@olejnjak olejnjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking if we are doing "something to improve Obj-C interoperability" we should probably go through the rest of the code that is visible in Obj-C - basically all classes that we declare and add the ACK prefix to their Obj-C representation. What do you think? Would you mind?

olejnjak
olejnjak previously approved these changes Mar 26, 2026
@komkovla
Copy link
Copy Markdown
Contributor Author

@olejnjak Thanks for the review! Can you please approve merge to main only adding changelog item. And we can merge this!

@olejnjak olejnjak merged commit dfc4ec7 into main Mar 30, 2026
6 checks passed
@olejnjak olejnjak deleted the bug/obj-c-name branch March 30, 2026 12:27
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