Skip to content

Make Base.ViewController Obj-c compatible #155

Open
komkovla wants to merge 6 commits intomainfrom
bug/obj-c-name
Open

Make Base.ViewController Obj-c compatible #155
komkovla wants to merge 6 commits intomainfrom
bug/obj-c-name

Conversation

@komkovla
Copy link
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
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?

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