I'll put my hat in for 'use IB where possible'. I've used old IB, current IB, and programmatic for building Cocoa UIs and honestly it comes down to what you're doing with that project. Often IB gives you a nice productivity boost out the gate. It's worth building with it and banging heads with it so you know when to switch to putting on your coding tool belt.
Your First iOS App – 100% Programmatically
31–40 of 111 posts
Re: Your First iOS App – 100% Programmatically
#32So, a word of advice to new folks trying out iOS land: Interface Builder is most emphatically your friend. The compile/debug cycle in iOS is sufficiently lengthy that laying out views programmatically gets very tedious very fast. Besides realtime previewing of exactly how your view is going to look , IB also helps you understand how your layout is affected by rotations to landscape and differences in view height betw…
I've been a Cocoa developer for close to a decade now, and I've gone back and forth on this many times, but by now I've settled 100% in the nibs-are-evil camps. There are several reasons for that: - Nibs are a nightmare when working with version control and merge tools. Now, at least, they are XML instead of a proprietary binary format, but it's still a joke… - Auto-layout in IB is provably the worst GUI I have ever…
Re: Your First iOS App – 100% Programmatically
#33Earlier quoted context omitted.
I agree with pretty much everything you say (especially now Apple will be pushing auto-layout for newcomers to the platform), but the one thing that's really bothered me with the "Your First iOS App" tutorial is that as some point it switched from NIBs over to a full Storyboard. And Storyboards are certainly in principle a cool idea, but I've never seen a production app that has actually used them (please do correct…
Our app has ~15 view controllers laid out in a single storyboard, and we haven't had any issues with them. We only have one iOS developer, so I don't know if that makes a difference. We don't really use segues, though, since they seem to add complexity if you want to pass data around between the view controllers.
Re: Your First iOS App – 100% Programmatically
#34I made a fake account to ask this question b/c I'm too ashamed not to know this: Is there an equivalent Visual Basic-style editor for making iOS apps? You just place the button, double click on it, add functionality, drop in elements and you're off the races? Just looking at this tutorial, it is astonishing how much knowledge you need to have to get up & running and create something so simple like a HelloWorld exampl…
People will say that Interface Builder is the equivalent and to some degree that's true - you use both to drag/drop UI elements on the page.
However, the main feature I think you are looking for from VB (and any Visual Studio language for that matter) is the ability to double-click on a something like a Button control and have it create a new click event all wired up ready to go for you to add your code (or take you to an existing click-event if you've already done this). So Visual Studio adds the delegates/wiring necessary for the control to fire properly when clicked on.
Unfortunately this is where Interface Builder gets crazy and confusing. Double-clicking a Button control in Interface Builder does not do this for you; Instead you have to use Actions for something like a click event and Outlets if you wanted to wire up a Label and then be able to programmatically change it from code-behind. You'll actually need to drag a special Outlet or Action connector in Interface Builder to make that crucial relation between Interface Builder and Xcode.
So while Interface Builder serves a very similar purpose to Visual Studios UI builder there is a pretty significant disconnect between it and the code-behind that makes it much less intuitive to use.
Re: Your First iOS App – 100% Programmatically
#35Earlier quoted context omitted.
I agree with pretty much everything you say (especially now Apple will be pushing auto-layout for newcomers to the platform), but the one thing that's really bothered me with the "Your First iOS App" tutorial is that as some point it switched from NIBs over to a full Storyboard. And Storyboards are certainly in principle a cool idea, but I've never seen a production app that has actually used them (please do correct…
Our app has ~15 view controllers laid out in a single storyboard, and we haven't had any issues with them. We only have one iOS developer, so I don't know if that makes a difference. We don't really use segues, though, since they seem to add complexity if you want to pass data around between the view controllers.
Re: Your First iOS App – 100% Programmatically
#36Earlier quoted context omitted.
I've been a Cocoa developer for close to a decade now, and I've gone back and forth on this many times, but by now I've settled 100% in the nibs-are-evil camps. There are several reasons for that: - Nibs are a nightmare when working with version control and merge tools. Now, at least, they are XML instead of a proprietary binary format, but it's still a joke… - Auto-layout in IB is provably the worst GUI I have ever…
If you say "provably" you really do need to... prove it. What studies are you citing when you say IB auto-layout is "provably the worst GUI?"
Re: Your First iOS App – 100% Programmatically
#37I made a fake account to ask this question b/c I'm too ashamed not to know this: Is there an equivalent Visual Basic-style editor for making iOS apps? You just place the button, double click on it, add functionality, drop in elements and you're off the races? Just looking at this tutorial, it is astonishing how much knowledge you need to have to get up & running and create something so simple like a HelloWorld exampl…
Starting in iOS is just like starting in anything else for the first time, it is all new so very little makes sense. As far as your example, the problem with the label pre-ios 6 was that it wasn't easily styleable beyond simple styles. For anything complicated it was generally easier to put the text in a web view and present it that way. With iOS6 Apple finally added an attributed text field with a lot more style options.
I have written native apps in both Android and iOS and each have their strengths and weaknesses.
Re: Your First iOS App – 100% Programmatically
#38Re: Your First iOS App – 100% Programmatically
#39So, a word of advice to new folks trying out iOS land: Interface Builder is most emphatically your friend. The compile/debug cycle in iOS is sufficiently lengthy that laying out views programmatically gets very tedious very fast. Besides realtime previewing of exactly how your view is going to look , IB also helps you understand how your layout is affected by rotations to landscape and differences in view height betw…
I can write UI code faster than any developer I've ever met who uses IB, and that's doubly true for class hierarchies I have subclassed for multiple apps, and triply true when it comes time to change those subclassed hierarchies. You note that IB is for simple UI layouts, but I would argue that for layouts that simple, the code is simple too.
Maybe it's a matter of how you think, but I can "see" the changes when I adjust the frames, colors, padding, resizing masks, and that's basically all IB will do for you.
IB will also happily confuse your localization effort, and introduce bugs when you ship apps with unreferenced XIBs.
Re: Your First iOS App – 100% Programmatically
#40Using Interface Builder will make you a permanent novice.