From the course: iOS Development: Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display the message, part 1

Display the message, part 1

From the course: iOS Development: Architecture

Start my 1-month free trial

Display the message, part 1

- [Instructor] Now, I'll make some changes in the delegate method. First, I create a dictionary for the parameter keys and values. Both the key and the value is a string. If there is a queryString, I extract the key/value pairs by using the string's components(separatedBy:) method. And the separator is the ampersand sign. Next, we iterate through the items and extract the key and the item using a similar approach. Again, I'll be using the components(separatedBy:) method, but in this case, the separator is the equals sign. If there is a key and a value items would have two elements, so I'm going to check it and we'll insert the key and the value in our parameters dictionary. Finally, we'll have a dictionary that contains all the keys and the values from the queryString. I'll extract the value for the message key and, if found, we fire a notification with the name "MessageReceived" and the message as the object parameter. And I fire the notification using…

Contents