In this video, Mohammad Azam demonstrates how to extract the secret message out of the URL and place it in a variable. Azam utilize the power of the guard statement to unwrap multiple fields into their corresponding variables.
- [Instructor] At this point,…our secret message is added as a query item to the url,…but we still want to retrieve it…so that we can display this secret message to the user.…Inside the present view controller method,…we are going to extract the secret message…out of the query string.…Since the secret message is only displayed…in the expanded mode,…we are going to type our code…when the presentation style is expanded.…
First, let's check that if the conversation…had any selected message.…If it is not "nil,"…then we can do something about it.…I'm going to use a "guard" statement…to get the query item out of the message.…But the first step is to actually get the message,…which is part of the conversation.…You can add multiple un-wrappings…in the "guard" statement.…So let's go ahead and do that.…The next step is to get the url,…which is stored in "message.url" property.…
Once we have the url,…the next step is to get the components.…The next step is to use the url…to build the components.…Once again we can use the "url.components" class,…
Released
6/26/2017- Understanding iMessage app architecture
- Creating stickers without code
- Preparing image assets
- Creating a sticker project using Xcode
- Creating stickers using code
- Creating a user interface
- Configuring the container view controller
- Configuring view controller containment
- Configuring compact and expanded modes
Share this video
Embed this video
Video: Receive secret messages