If your Swift iOS app needs to import a picture from the user’s device, you’ve come to the right place today.
Let’s learn how to use UIImagePickerController to let the user select a photo from their device to load into your app.
[Read more…]
Exploring how to code for iOS in Swift and Objective-C
Last updated on
If your Swift iOS app needs to import a picture from the user’s device, you’ve come to the right place today.
Let’s learn how to use UIImagePickerController to let the user select a photo from their device to load into your app.
[Read more…]
Last updated on
In many apps that use a UITableView, when a UITableViewCell is tapped, the screen will segue over to another view, such as how choosing a song in the Music app goes to the Now Playing screen, and plays that song, shows the album art, and other metadata about the song. This can be done programmatically in tableView:didSelectRowAtIndexPath:, but with Storyboards, it is even easier. All we have to do is set up a segue, and treat it pretty much exactly like we did in Segue between Swift View Controllers.
To avoid an even longer setup section, and to not cover things we already covered, we’re going to start with the result of the previous post Getting Started With UITableView in Swift.
Anyway, starting from where we left off, let’s set up the storyboard.
[Read more…]
Last updated on
If you need to take text input in your Swift app, you will probably need a UITextField. It is exactly what it sounds like, just a field on the screen where the user types something in. When the user taps on it, the keyboard comes up from the bottom of the screen, and allows the user to start typing. Then, usually, when the user clicks outside of the UITextField, the keyboard is dismissed, and the cursor is no longer in that UITextField.
However, a common issue for many iOS programming beginners is that the last part of that story isn’t built in. If you just plop on a UITextField, and try tapping somewhere else…. nothing happens. That’s what we’re here to fix today.
[Read more…]
Last updated on
One of the most common Views used in iOS apps is the UITableView. In the default iPhone apps alone, the only ones that I didn’t easily find what is PROBABLY a UITableView was in Newsstand, Videos, Camera, and the Calculator. Even then, the first two of those appear to use UITableView’s close cousin UICollectionView. With the exception of the Settings app itself, I wasn’t even counting their settings pages (which probably all of them have, and show up as a UITableView either in their own app or via the Settings app).
You probably want to know how to use such an important view? There is too much to go into all of it today, but let’s start out with how to get one working and fill it with data.
[Read more…]
Last updated on
So, last time we learned how to make a simple Hello World app on a single view controller. As fancy as it was, you probably want more than one screen in your app, right?
Perhaps you want a way to segue into the next screen?
That’s what we’re going to go over today, as well as one of the simple ways to share data between view controllers.
[Read more…]