Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> [...] pushed me further towards UI in code.

Did you make any progress on this for macOS or iOS/iPadOS?

Out of total hatred of Xcode and Interface Builder I started experimenting with writing Apple UI stuff in C (calling Cocoa methods through libobjc), but there's precious few resources on doing so-called "Nibless/Xibless" development beyond the basics.

I'd love to find a decent-sized open-source macOS app written in [Objective-]C/C++ but with a good assortment of common UI paradigms, all done in code. I shudder whenever I see that dreaded .xcodeproj directory...



There's a fair deal of resources for writing code-only UIs in iOS apps with UIKit, but not nearly as much for Mac AppKit apps.

I suspect that this is because the average Mac window/view nib file is a great deal less complex than its counterpart view nib on iOS and still manageable to edit in Interface Builder, and so a lot of Mac devs still use nibs.

I've toyed with code-only Mac AppKit stuff but generally have found that it's not quite as clean as code only iOS UIKit. For example if I recall correctly, there's no initializer for NSWindow that sets all of the flags that make it behave like a normal window because it's assumed that you'll be using nibs. It's not difficult to write an extension to NSWindow to fix this, but it has to be done for reasonable productivity, and these papercuts are strewn throughout AppKit. In contrast, most UIKit controls can be initialized with few or no arguments and still behave as expected.


The AbiWord source has a ton of this, though a lot of it is now deprecated and broken.


AbiWord appears to use IB (there are *.nib directories and plenty of `IBAction` and `IBOutlet` annotations), but it's kinda woven into AbiSource's own cross-platform application framework, and that actually makes it more interesting/useful as a learning resource.

Thanks for the suggestion! Any others you can think of?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: