3 ms·
I'm curious, what's wrong with a UIViewController.mm? I've been doing that for years on all sorts of apps, never had any issues.
by hellofunk 11y ago
I'm curious, what's wrong with a UIViewController.mm? I've been doing that for years on all sorts of apps, never had any issues.
- autoreleasepool 11y agoThere's nothing technically wrong with it, and there are definitely situations that may require it. But IMO, in a huge ViewController, you ideally want to avoid using Objective-C++ code directly. It's better to use wrappers. This is mostly because Objective-C++ has many surprises and is poorly documented. It can be a PITA to debug. It's a better practice, IMO, to isolate your Objective-C++ code into individual .mm files if you can. Try to keep the majority of your code in .m, or .cpp files and use wrappers. The idea is to try and work with a pure C++ or Objective-C compiler for each compilation unit, wherever possible. The saner compiler will save you a few headaches.