You could ask this book about something what worry you.
When you touch this book📕, it gives answer for you! 😎.
*Good luck and have fun my Friends!*💛
I used:
- Image view
- Button
- Array
- AVFoundation
When you you start app, you can hear amazing song🎵 (I imported for this AVFoundation),
when you opening or closing this virtual book you can hear sound effect 👻 (AVFoundation):
func playSound() { let url = Bundle.main.url(forResource: "shot", withExtension: "mp3") player = try! AVAudioPlayer(contentsOf: url!) player.play() }
You can open or close this book enough touch the book.
You can see, when this book's open you can close it touch
on book or touch it outside of it and it will close. But you
can't open it when book's close if you touch it outside this book.
Example a code for click on book:
@IBAction func changeText(_ sender: UIButton) {
let arrayText = ["YES", "NO", "MAYBE", "NO DOUBT ABOUT IT", "ABSOLUTELY", "THE STARS SAY NO",
"SO IT SHALL BE", "UNLIKELY", "INDICATIONS SAY YES", "POSITIVELY", "YOU CAN COUNT ON IT",
"ANSWER UNCLEAR ASK LATER", "DON'T BET ON IT", "LOOKS LIKE YES", "CHANCE AREN'T GOOD",
"FOCUS AND ASK AGAIN", "CAN'T SAY NOW", "PROSPECT GOOD", "VERY LIKELY", "CONSULT ME LATER",
"CANNOT FORETELL NOW"]
if bookImage.image == #imageLiteral(resourceName: "clouse_book") {
playSound()
bookImage.image = #imageLiteral(resourceName: "open_book")
textAnswer.text = arrayText.randomElement()
} else {
setBook()
}
}
Example app:
All images and sounds using in this app was take with open resources.
Type of licence: Non-Commercial.
This app is not intended for commercial use!
If you are the owner of these images or sounds and
you do not want your materials to be presented in this application,
or it somehow violates your copyright.
Please let me know and I will remove this material from the application immediately.
Email: [email protected]