Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS

Since the first widget is an ImageView, you need to set an image in properties.
You need to import an image in Assets.xcassets. As shown in Figure  7-16 , select
Assets.xcassets and right-click to see the menu, then select Import. You can either
provide your own image or use the same that has been used in the example from
https://openclipart.org/detail/122965/car-pictogram. Select an image and click
on Open.


Figure 7-16. Import an image asset


Figure 7-17. Available/imported assets

Once imported, the image becomes available in the application, as shown in
Figure  7-17.


Now that the image is available in the assets, you need to set this image in the
ImageView widget that you added on the storyboard. Switch back to Main.storyboard
and select ImageView from the storyboard. As shown in Figure  7-18 , from the Attribute
Inspector on the right, choose ParkedCar (or the name of your image) in the Image and
Highlighted dropdowns. You can always set two different images when the image is
highlighted versus normal scenarios.

Free download pdf