The Star Wars logo is a
UIImageView
subview in a big black
View
superview that fills the screen.
We saw an
UIImageView
in
Puzzle,
and a
stretching/shrinking
animation
in exercise 8 of
Animate.
AppDelegate.swift
ViewController.swift
.
Added the
AVAudioPlayer
property
and initialized it in the
viewDidLoad
method.
Also added the method
supportedInterfaceOrientations
to launch the app in lanscape orientation.
View.swift
Images.xcassets
,
an Xcode
asset catalog
file.
Star_Wars_Logo.imageset
Contents.json
:
a
JSON
file listing the files belonging to the Star_Wars_Logo image set.Star_Wars_Logo.png
:
one of the files belonging to the Star_Wars_Logo image set.
Apple prefers
.png
format.
1000 × 604 pixels.
fanfare.mp3
Info.plist
:
added the
“Initial interface orientation”
property to launch the app in landscape orientation.
I got the sound from http://www.youtube.com/watch?v=ucvlJxDyKAA, and converted it to an mp3 file with http://www.youtube-mp3.org/.
For background music and landscape orientation, see Gone. Make sure the Mac’s sound is on before you run the project.