Today as I was working with Swift – updating last week’s article on generics – I learned something new. Strings aren’t objects – they’re structures. When I saw this, I thought, “wait a minute… does this mean that String doesn’t have any methods?” Well, what do you think? From The Swift Programming Language: Classes and structures are general-purpose, flexible constructs …
Working with Generics in Swift
As you may already know, Swift has support for generics, and if you’re going to use Swift effectively, you need to be able to read generics at the very least. And if you want to be really good at Swift, you should be able to write code with generics. (You should play along at home by copying the code below …
How to write unit tests in Swift 1.x with XCTest
Update: If you’re using Swift 4, check out the newer version of this article right here. If you’ve done unit testing in Objective-C, you’re probably already familiar with XCTest. What’s nice about it is that when you run your tests in Xcode, you get: pretty red or green icons next to your failing or passing tests, respectively output in the …
From Banker to Freelance iOS Developer
Note: This is a guest post by Michael Fellows, a friend of mine who went from being a banker to a freelance iOS developer. I love his story and thought you might enjoy it, too. – Josh I was depressed and absolutely hated my job. My coworkers were some of the nicest people I’ve ever met, but the job wasn’t …
How to send messages (aka call methods) in Objective-C
This is Part 3 in a three-part series on Methods in Objective-C. If you want to learn more, check out the others: How to read (and write!) method declarations in Objective-C How to implement methods in Objective-C How to send messages (aka call methods) in Objective-C OK, so you know how to declare methods and how to implement them, as …
How to implement methods in Objective-C
This is Part 2 in a three-part series on Methods in Objective-C. If you want to learn more, check out the others: How to read (and write!) method declarations in Objective-C How to implement methods in Objective-C How to send messages (aka call methods) in Objective-C OK, so you know how to declare methods in Objective-C, but do you know …
How to read (and write!) method declarations in Objective-C
Does the following code make any sense to you? – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; If you’re not very familiar with Objective-C, you may be wondering… “What am I looking at? What does that minus sign mean? Why are those parentheses there? How about the asterisks? Where’s the return type? What do the colons mean? And what’s with those spaces?” …
The problem with learning via gamification
When you’re trying to learn something, external motivation can kill your intrinsic motivation. And if your intrinsic motivation is dead, you’re far less likely to actually learn what you set out to learn. Let’s break that statement down and look at what it actually means… “external motivation” for example, getting a virtual or tangible reward “can kill” destroy, obliterate, annihilate… …
How to build a hybrid iOS app
…or, how to package your mobile web app in a native iOS app. Hybrid apps get a lot of bad press these days. Sometimes, it’s well-deserved, and other times – not so much. If you read DHH’s recent post on hybrid apps, you know that the hybrid approach worked well for Basecamp. So if you think a hybrid app might …
Everything you need to know about Xcode, Objective-C, and iOS to build iOS apps
So you know you should invest in learning Objective-C and iOS because it’s good for you – it’ll allow you to invest in your knowledge portfolio, stay relevant, build and sell apps, take your career in a different direction, and show off your work to your friends and family. But do you know what specifically you need to learn? What …