Building Apps In Swift With Storyboards
Nerval's Lobster writes Apple touts the Swift programming language as easy to use, thanks in large part to features such as Interface Builder, a visual designer provided in Xcode that allows a developer to visually design storyboards. In theory, this simplifies the process of designing both screens and the connections between screens, as it needs no code and offers an easy-to-read visual map of an app's navigation. But is Swift really so easy (or at least as easy as anything else in a developer's workflow)? This new walkthrough of Interface Builder (via Dice) shows that it's indeed simple to build an app with these custom tools... so long as the app itself is simple. Development novices who were hoping that Apple had created a way to build complex apps with a limited amount of actual coding might have to spend a bit more time learning the basics before embarking on the big project of their dreams.
Where in TFA is Swift actually used? All I see is a simple Interface Builder example which has nothing do with Swift.
Are we going to be continually with crappy iOS articles repeating the basics of UI development just because they have the word "Swift" in them or that they are Dice based??
And another crappy article .. with Swift
Crappy articles are crappy articles and articles like these are the reason that Netcraft confirms that /. is dying.
I am Slashdot. Are you Slashdot as well?
I want to be able to code this to make a game:
int main(int argc, const char* argv[])
{
CreateGameThatIsSortOfLikeAngryBirdsAndMakeMeMillionsOfDollarsOvernight();
}
Anything else is too hard.
All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
Building complex apps without coding doesn't seem like a useful goal. At some point you have to express the program logic and coding has always proven to be the best way.
The dividing line between graphical tool and actual code seems to have been a shifting one over the years. So when you go to a new environment or language where there's a substantial GUI component to building an app, the desire to see it all in code is strong. What actually happens when you add that button? I expect to be able to do it either through code of GUI and if they can't tell me what the GUI did in code, then I'm left clueless as to the underpinnings and so it becomes hard to think through the implications of design decisions.
I tried Swift recently. Swift was easy enough. But Swift+Xcode was impenetrable.
I should use this sig to advertise my book ISBN-13 : 978-1501515132.
That would be cool.
The simple truth is that interstellar distances will not fit into the human imagination
- Douglas Adams
When I took Introduction to Computers in the early 1990's, the class had to draw flowchart diagrams to demonstrate our logic before we could program a DOS batch file. When I went back to school to learn computer programming in mid 2000's, all we needed was a napkin to write pseudocode before programming a web app. Kids today have it too easy.
The dream of some fancy tool that builds a complex app for you (since you're an "ideas person", not a programmer) is always going to be a fantasy. The more work a tool does for you, the more specialized it has to be because there is only so much complexity a person can put into a project per hour they work on it. Either you supply that complexity, or the tool builder does, and there's an upper limit to how complex a tool can be before learning it harder than just learning a programming language and solving the problem yourself.
Someone has to do the work, and if you have grand visions the work will be hard.
I read the internet for the articles.
When I started writing iOS Apps it was at the same time as Interface Builder was released.
As a beginner being able to visualise what was going on made the learning curve a walk up a hill instead of mountaineering.
Even though I've been doing it a while now I still use Storyboards but 50% of the time I find myself removing a view and codifying it.
As a design tool it is wonderful for prototyping.
There was a lot of resistance from the established iOS developers to IB when it first appeared.
I remember being scolded on stockoverflow for using IB and told that I should learn the hard way like they had done.
With Swift I see some parallels, I don't want to have to learn a new language even though it might be simpler and compiles faster code (allegedly).
It raise my hackles because of the time and knowledge I have invested in the status quo to date (ObjC).
In addition to the prospect of Apple ceasing support for ObjC in future Xcode releases forcing me to re-write my Apps in Swift.
I'm sure Swift will make the learning curve easier as IB did for me when I started.
There's a much bigger problem with all this which goes beyond Apple, Xcode & Swift.
As App development and programming becomes simpler and more dumbed down it has the effect of increasing the number of people who are capable of producing a non-complex App.
That drives down the value of an App developer.
It's hard enough making anything from App's without lowering the value in them further.
"Storyboards" are Apple's name for a user interface layout tool, its not a logic flow tool so it is not really like flowcharts. A storyboard is basically a view pane where you layout the visual elements and controls, and define some constraints involved in repositioning and resizing for different resolutions. There is very limited flow control. Things like clicking on this button brings up a different storyboard.
In short storyboards let you mock up a user interface, including one view launching a different view. If you are nostalgic for the 90s think back to Microsoft's Visual Studio GUI layout and glue code generation tools. Its pretty much the same sort of stuff.
Flowcharts are documentation. And they can be pretty concise and more importantly visual.
The visualization aspect is sometimes important. It can literally be the big picture that helps one understand a process. Also visualization can help with debugging something missing at the design level.
Now I haven't used my plastic templates or some software package to generate flowcharts since undergrad days decades ago, but I still on occasion grab a yellow pad of paper and a pencil to informally (ok that was generous, crudely would be more accurate) sketch out some algorithm, data flow, logic, etc. To me its helpful when thinking about some things, planning some things, etc.
It's simple to build an app as long as the app is simple?
Well holy **** what a revelation!
This sounds a lot like building apps with LabView using flowcharts. Or perhaps building apps in Visual Basic using widgets. Was there something revolutionary about SWIFT in this regard?
"A person is smart. People are dumb, panicky dangerous animals and you know it." - K
As someone who is a programmer, but had never had an Apple Desktop or Laptop until my wife and son got me one for Christmas this pas year I have to say X-Code needs more polish.
I say this because I was / Am a heavy user of Delphi ( Yup Object Pascal ). You might think OP is a toy but you could not be more wrong, but that is another argument. What I can say definitively is that Borland and now Embarcadero know how to do an IDE better then just about anything I have ever seen.
Apple needs to take a page out of their playbook. In Delphi when you add a component to a form, it adds ALL the code that you need to the unit that is handling the form. A simple double click on the element adds the code shell for that particular action, either from the object browser or from the form. You simply write the code that makes that action do what it needs to do, nothing else.
Now contrast this with X-Code... It will let you drag a component onto a form, in iOS Mavericks or whatever, but after that you have to and start screwing around in .h files, adding this adding that just so that element will be recognized and will compile. Couple that with the syntax of Objective C and you have a program that can only be written by someone who fairly in-depth knowledge of Objective C. I mean not they should not have to have that knowledge but it should not be a requirement to do basic forms and the like.
As it is mentioned, using the "Story Board" concept you can only write very simple apps that don't accomplish a whole lot. So while Apple is getting there they have a lot of ground to cover.
Hey KID! Yeah you, get the fuck off my lawn!
... at least IMO.
Background: I have been using XCode 6.6 (I think) for about a month now, as swift sounded intriguing. I wasn't a huge fan of obj-c, but I worked with it for a mobile app, so swift sounded like a potentially nice evolution...
One of the plus's of the IDE with Mac OS X is the ability to quickly assemble a UI. I would much prefer being able to work under the hood with the code for the rest of the app... it helps me understand the language, and how everything works together... as well as a sense of control, knowing it does what I intended for it to do.
If you want to create a complex app, it seems that one should know what they're doing... especially if it is to be used for more than personal use... for so, so many reasons.
What took the devs this long? I've been waiting for decades!!
"But is Swift really so easy (or at least as easy as anything else in a developer's workflow)? This new walkthrough of Interface Builder (via Dice) shows that it's indeed simple to build an app with these custom tools... so long as the app itself is simple."
What? Seriously Slashdot, if you're going to have Apple articles, at least have submitters that have half a clue what they're talking about. "How good is Swift? Let's find out by using Interface Builder which is not Swift at all!"
Swift and Interface Builder can be used together, but they're not strongly related components. They're related like a WYSIWYG web tool, like Dreamweaver, and JavaScript. They're both helpful to get what you need done, but they don't replace each other. To give you an idea of how true that is, Interface Builder first shipped in 1986. Now, it's advanced a lot since then, but it's almost 20 years older than Swift, so obviously it's had a long life away from Swift.
Duh you can't create a big complicated app with only Interface Builder like you can't create a big fancy web app with just the visual components of Dreamweaver. You've got get down and actually write some code, which you know, is what Swift is, Swift being a coding language and all. So I find it really odd that this post is talking about reviewing a programming language in the context of trying to use a completely different tool that is not that programming language.
Interface Builder has not changed in any fundamental ways since it debuted in 1988 with NeXTstep.
Unlike crappy Microsoft tools for the 90's, it is NOT a screen drawing tool. It is an object instantiation and configuration tool. You set the properties and relationships between live objects graphically. The objects are then archived (serialized) and later unarchived (deserialized) into your running iOS app.
Watch this from 1992 http://www.youtube.com/watch?v...
Steve Jobs demonstrates Interface Builder starting 23 minutes into the video. Also note that Windows 3.1 shipped in 1992.
Just for fun, here is NeXTstep from 1988 http://www.youtube.com/watch?v...
Another Steve Jobs Interface Builder demo from 1990 http://www.youtube.com/watch?v...
I'd say storyboards and auto layout are pretty big changes. Before storyboards, nibs were basically just view hierarchies and whichever other objects you threw in there. With storyboards, they can contain an entire application's user interface, including the transitions between different screens.
It's both. It's a screen drawing tool that uses object instantiation and configuration to accomplish that.
Bogtha Bogtha Bogtha
When we become Swift developers, do we get a free packet of crayons to write our code in addition to the storyboards? Also, does it come with a snack and naptime?
SlashDice manager here. I'd like to apologize for this shitty article. I thought we fired Nerval's Lobster but it turns he's the CEO's retarded kid or something. Apparently, he didn't use to hire him! Lesson learned! Dice: slightly better than hiring the CEO's retarded kid.
Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
YES!! I coded in those days and I really miss the auto boiler plate code generation for UI so you can just double click, or click the appropriate action and begin coding what the action does. Even though it's easy to connect a button's action to the method, this is done very often I don't know why such code is no longer auto generated in new tools. Also the whole Sensors/Actuators paradigm for UI seems to be entirely forgotten. There is new good stuff being introduced, and strangely some old good stuff that would still be good is being forgot.