English subtitles

← Preparing to Play Sound - Intro to iOS App Development with Swift

Get Embed Code
3 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Okay, so I trust that you know how to add an image to this button.
  2. What I will do however,
  3. is walk you through how to add constraints to this image.
  4. I Ctrl + drag from the button in this direction and
  5. selected the option called Top Space, and then Ctrl + dragged from
  6. the button in this direction and selected Leading Space as the option.
  7. Now I've added two constraints here.
  8. If I select any one of them, and then go to the utility area.
  9. I can look under Size Inspector to see that the value of this constraint is
  10. a constant 50 points from the top.
  11. If I select the other constraint I can see that it's value is
  12. a constant 30 points from the leading edge.
  13. After that I went to the assistant editor and
  14. in there I created a new action called Play Slow audio.
  15. Now, this function gets executed any time someone presses this button over here.
  16. So now, I can write code to play audio in this function.