diff --git a/Magic 8 Ball.xcodeproj/project.xcworkspace/xcuserdata/heggy.xcuserdatad/UserInterfaceState.xcuserstate b/Magic 8 Ball.xcodeproj/project.xcworkspace/xcuserdata/heggy.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..4ea5e42 Binary files /dev/null and b/Magic 8 Ball.xcodeproj/project.xcworkspace/xcuserdata/heggy.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Magic 8 Ball.xcodeproj/xcuserdata/heggy.xcuserdatad/xcschemes/xcschememanagement.plist b/Magic 8 Ball.xcodeproj/xcuserdata/heggy.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0776c79 --- /dev/null +++ b/Magic 8 Ball.xcodeproj/xcuserdata/heggy.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Magic 8 Ball.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Magic 8 Ball/Base.lproj/Main.storyboard b/Magic 8 Ball/Base.lproj/Main.storyboard index 2766965..4877e15 100644 --- a/Magic 8 Ball/Base.lproj/Main.storyboard +++ b/Magic 8 Ball/Base.lproj/Main.storyboard @@ -1,24 +1,68 @@ - + + - + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + diff --git a/Magic 8 Ball/ViewController.swift b/Magic 8 Ball/ViewController.swift index 13dc436..7270245 100644 --- a/Magic 8 Ball/ViewController.swift +++ b/Magic 8 Ball/ViewController.swift @@ -10,8 +10,19 @@ import UIKit class ViewController: UIViewController { + @IBOutlet weak var ballImageView: UIImageView! + let ballArray = [#imageLiteral(resourceName: "ball1.png"),#imageLiteral(resourceName: "ball2.png"),#imageLiteral(resourceName: "ball3.png"),#imageLiteral(resourceName: "ball4.png"),#imageLiteral(resourceName: "ball5.png")] + + @IBAction func askButtonPressed(_ sender: Any) { + + ballImageView.image = ballArray[Int.random(in: 0...4)] + + } + + + }