Friday, September 21, 2018

Itinerary App - Part 18 - Swipe to Edit Table View Row (iOS, Xcode 10, S...

In the last video you learned how to swipe to delete a table view row and present the user with an alert. In this video you will learn about swiping right and showing and edit action. When tapped we will present the user with our popup with the trip title and image loaded.



You're also going to learn some other things such as new Xcode 10 and Swift 4.2 features, calling a segue in code, problems with named colors and image assets, a tool to find matching colors to expand your color theme and much more!







-- CODE UPDATES --

There are some things I forgot to cover while teaching that are important.



1. We want to reset the tripIndexToEdit in our TripsViewController after the popup closes. If we don't set that variable back to nil then the popup will always thing you want to edit. We want to do this in the prepareForSegue, in the popup's doneSaving action:



override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

    if segue.identifier == "toAddTripSegue" {

        let popup = segue.destination as! AddTripViewController

        popup.tripIndexToEdit = self.tripIndexToEdit

        popup.doneSaving = { [weak self] in

            self?.tableView.reloadData()

            self?.tripIndexToEdit = nil

        }

    }

}



2. I forgot to change the popup's title (titleLabel) when we are editing a trip! Here is the code we want in the popup's viewDidLoad:



if let index = tripIndexToEdit {

    let trip = Data.tripModels[index]

    tripTextField.text = trip.title

    imageView.image = trip.image

    titleLabel.text = "Edit Trip"

}

Wednesday, September 12, 2018

Itinerary App - Part 17 - Swipe To Delete Table View Row (iOS, Xcode 9, ...

In this video you will learn the new way to swipe to delete (since iOS 11). When swiping to delete a table view row we will be presenting the user with an alert confirmation too. You will learn how to configure the button that is exposed by swiping, such as setting the text, icon and background color and the action to perform after tapping the button exposed by swiping.

In-Depth Info on configuring swipe actions:
https://youtu.be/RSxfGGdA8QE



Monday, August 27, 2018

Itinerary App - Part 16 - Access The Photo Library (iOS, Xcode 9, Swift 4)

Learn how to access the user's photo library in iOS so they can pick a photo. And if the user denies access, how do you handle that if later they change their mind? Learn how! You're going to learn a lot of other little things in this video too.

Wednesday, August 1, 2018

Itinerary App - Part 15 - Images in Text Fields for Validation (iOS, Xco...

In this video you will learn different options for customizing the UITextField to show validation failed. Including how to add an image to the actual textfield, change it's color, border or placeholder text (hint text) if validation fails. These are just some of the options to indicate if text field validation fails. Combine, choose or invent ways to validate text fields in your app!



Tuesday, July 31, 2018

Itinerary App - Part 15 - Images in Text Fields for Validation (iOS, Xco...

In this video you will learn different options for customizing the UITextField to show validation failed. Including how to add an image to the actual textfield, change it's color, border or placeholder text (hint text) if validation fails. These are just some of the options to indicate if text field validation fails. Combine, choose or invent ways to validate text fields in your app!



Friday, July 27, 2018

Itinerary App - Part 14 - Callbacks with Popups (iOS, Xcode 9, Swift 4)

We have a popup but how do we save the data entered into the modal popup? And when the popup closes, how do we know to reload the data in the table view to show the new data?

In this video you will learn how to do each of these things. You will learn what a callback is in iOS and the 2 steps to implement them. You will also learn how to define a function type in Swift and assign a value (or a function) to it.




Sunday, July 22, 2018

Itinerary App - Part 13 - Popup To Add Data (iOS, Xcode 9, Swift 4)

In this video we will create a popup in a separate view controller so users can add data. We will refactor the storyboard to move the view controller into its own storyboard file. Then you will learn how to style controls by using subclassing. And when subclassing, you will learn about a few different options of where to put the styling code.



SwiftUI Search & Filter with Combine - Part 3 (iOS, Xcode 13, SwiftUI, 2...

In part 3 of the Searchable video series, I show you how to use Combine in #SwiftUI for the search and filter logic connected to the searcha...