Subclassing Swift class in Obj-c [Private-API Friday #1]


Xcode checks for the attribute and macro existence and defines the new macro.



  • It’s a private API. So all of its problems are applicable here (stability, UB, etc).
  • Cycle bridging headers. You can’t use your subclass back in Swift, because Swift files should be compiled before your subclass, but they are using your class, so ¯\_(ツ)_/¯





MacOS and iOS dev. ObjC paradigm fan.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building higher-level abstractions in Kubernetes

How should beginners approach PHP?


End to end deployment of the javascript application to Kubernetes cluster- part 2

What does the Agile approach look like in an outsourcing company

Web Accessibility: Angular Web Component to toggle options between two Listbox(s)

Can email be reinvented? We’re about to find out.

A Complete Guide for Google Summer of Code(GSoC)

Create IAM Users and S3 Buckets in AWS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


MacOS and iOS dev. ObjC paradigm fan.

More from Medium

How to optimize your code by using Enum with Swift

Embed UIView in SwiftUI, define communication both ways

Creating a macOS Statusbar Application

Async/Await: Generic Network Layer With Swift 5.5