There is Objective-C++ (.mm extension), which I used extensively, where you have what is essentially a C/C++ implementation file, but you can use types and syntax from Objective-C, e.g. allowing you to call iOS APIs (UI, bluetooth, etc). Disk acccess can be done directly without objective C. Also network access. It is surprisingly unrestricted. This was a year or two ago. You need to get a path string to the app's Do…
Is it possible to write plain C iOS app in 2025?
21–30 of 74 posts
Re: Is it possible to write plain C iOS app in 2025?
#22Objective-C is designed in such a way that, generally speaking, anything you can do with Objective-C syntax can also be done with a simple C function call to one of the Objective-C runtime functions. So you can write an entire iOS app in pure C. However, the Objective-C stuff is a lot more pleasant to use if you use the syntax for it. As others have mentioned, for something like a simple game (rather than a normal GU…
Re: Is it possible to write plain C iOS app in 2025?
#23Earlier quoted context omitted.
Clang has a pretty cool flag to compile objc to c. I believe it exists for Apple to port their few apps to windows (eg iTunes), but I suspect it could be used to build a pure c environment as well.
That is very cool, I think it's `-rewrite-objc`. Presumably it still needs to be linked to the objc runtime. It says it lowers to C++ instead of C though, now I wonder what pieces cannot be implemented using pure c.
Re: Is it possible to write plain C iOS app in 2025?
#24Definitely. Just find a use case where you need the performance
Re: Is it possible to write plain C iOS app in 2025?
#25Here is the original StackOverflow question that inspired that GitHub project: https://stackoverflow.com/questions/10289890/how-to-write-io... One of the other answers also explains how to write a MacOS app using pure C.
Re: Is it possible to write plain C iOS app in 2025?
#26Re: Is it possible to write plain C iOS app in 2025?
#27There is Objective-C++ (.mm extension), which I used extensively, where you have what is essentially a C/C++ implementation file, but you can use types and syntax from Objective-C, e.g. allowing you to call iOS APIs (UI, bluetooth, etc). Disk acccess can be done directly without objective C. Also network access. It is surprisingly unrestricted. This was a year or two ago. You need to get a path string to the app's Do…
If you just need C instead of C++ then .m suffices, ojective-c is a strict superset of C.
Re: Is it possible to write plain C iOS app in 2025?
#28Earlier quoted context omitted.
That is very cool, I think it's `-rewrite-objc`. Presumably it still needs to be linked to the objc runtime. It says it lowers to C++ instead of C though, now I wonder what pieces cannot be implemented using pure c.
I don’t think it really works anymore, unfortunately.
Re: Is it possible to write plain C iOS app in 2025?
#29- https://github.com/garettbass/oc
- https://github.com/mitchellh/zig-objc
Whether that's better than writing ObjC directly is another question, think of ObjC as a convenient syntax sugar wrapper around macOS/iOS APIs which you only need in those parts of your application that talk directly to operating system APIs.
Also Apple is maintaining a C++ Metal API wrapper now (ok, technically that's not C): https://developer.apple.com/metal/cpp/
If you just want do to simple 'game-y stuff' (3D rendering, audio, low level touch input) you can also check out the Sokol headers (shameless plug): https://github.com/floooh/sokol, or I guess SDL will work too (especially with the new GPU API in SDL3) - at least the sokol header implementation code needs to be compiled as ObjC on macOS/iOS though (e.g. pass `-x objective-c` to Clang), since the macOS/iOS specific code paths are written in ObjC.
For the general case or when you need to access OS frameworks that are not wrapped by 3rd-party libraries:
If your app is mainly C code, have a thin layer of ObjC code that sits on top of the system ObjC APIs and which exposes a C API to the rest of the application.
Don't just tunnel every ObjC call through to C, instead wrap small feature blocks in ObjC and expose those features through a much simplified C API.
E.g. a hybrid C/ObjC application with only the necessary amount of ObjC code for talking to OS APIs, and all the 'business logic' in C (or another language, like C++, Zig or Rust).
Re: Is it possible to write plain C iOS app in 2025?
#30objective-c is an ugly thing. a main reason i dont develop for macos.
Not to mention you should probably opt for Swift first anyway, ObjC hasn’t been the default choice for quite some time now. ;P