-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefinitionViewController.swift
91 lines (82 loc) · 3.17 KB
/
DefinitionViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// DefinitionViewController.swift
// Emoji Dictionary
//
// Created by Dakota Brown on 10/23/16.
// Copyright © 2016 Dakota Brown. All rights reserved.
//
import UIKit
import AVFoundation
class DefinitionViewController: UIViewController {
var booSound:AVAudioPlayer!
var emoji = ""
@IBOutlet weak var emojiLabel: UILabel!
@IBOutlet weak var definitionLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
booSound = try? AVAudioPlayer(contentsOf:URL(fileURLWithPath:Bundle.main.path(forResource: "boo", ofType: "mp3")! ))
switch emoji{
case "😀":
definitionLabel.text = "A grinning face"
case "😬":
definitionLabel.text = "A grimacing face"
case "😁":
definitionLabel.text = "A grinning face with smiling eyes"
case "😂":
definitionLabel.text = "A face with tears of joy"
case "😃":
definitionLabel.text = "A grinning face with open mouth"
case "😄":
definitionLabel.text = "A grinning face with squinting eyes"
case "😅":
definitionLabel.text = "A grinning face with squinting \n eyes and a sweat drop"
case "😆":
definitionLabel.text = "A grinning face with tightly closed eyes"
case "😇":
definitionLabel.text = "A smiling face with halo above head"
case "😉":
definitionLabel.text = "A winking face"
case "😊":
definitionLabel.text = "A smiling face with squinting eyes"
case "🙂":
definitionLabel.text = "A slightly smiling face"
case "🙃":
definitionLabel.text = "An upside down smiling face"
case "☺️":
definitionLabel.text = "A smiling face"
case "😋":
definitionLabel.text = "A smiling face licking lips"
case "😌":
definitionLabel.text = "A relieved face"
case "😍":
definitionLabel.text = "A smiling face with heart shaped eyes"
case "😘":
definitionLabel.text = "A face blowing a kiss"
case "😗":
definitionLabel.text = "A kissing face"
case "😙":
definitionLabel.text = "A kissing face with squinting eyes"
case "😜":
definitionLabel.text = "A winking face with stuck out tounge"
case "😝":
definitionLabel.text = "A face with stuck out \n tounge and tightly closed eyes"
case "😛":
definitionLabel.text = "A face with stuck out tounge"
case "😎":
definitionLabel.text = "A smiling face with sun glasses"
case "👻":
booSound.play()
definitionLabel.text = "A ghost! Boo!"
case "👽":
definitionLabel.text = "An alien 🚀"
default:
definitionLabel.text = "Error"
}
emojiLabel.text = emoji
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}