import UIKit import Foundation class ViewController: UIViewController { @IBOutlet var actualQuote: UITextView! let data = GetData().$userData override func viewDidLoad() { super.viewDidLoad() print("\(data)") // Immediately get a quote upon app entry. getQuote() } @IBAction func nextQuote(_ sender: UIButton) { getQuote() } @IBAction func btnAbout(_ sender: UIBarButtonItem) { let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String print("\(String(describing: appVersion))") let title = "About" as String let msg = "CP inspirational Quotes\n\nVersion 1.0\n\n(c) 2020 CPS CO." let button = "Close" as String let alert = UIAlertController(title: title, message: msg, preferredStyle: .alert) alert.addAction(UIAlertAction(title: button, style: .default, handler: nil)) self.present(alert, animated: true) } @IBAction func btnSupport(_ sender: UIBarButtonItem) { let title = "Support" as String let msg = "Please send all comments and/or questions to:\n\ncpsoftware1@gmail.com" as String let button = "Close" as String let alert = UIAlertController(title: title, message: msg, preferredStyle: .alert) alert.addAction(UIAlertAction(title: button, style: .default, handler: nil)) self.present(alert, animated: true) } func getQuote() { let sayings = [0,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,92,93,94,95,96,97,98,99,100] let random = Int(arc4random_uniform(UInt32(sayings.underestimatedCount))) switch random { case 0: actualQuote.text = "'I wonder why somebody didn't do something....Then I realized, I AM somebody!'\n\n- Unknown" case 1: actualQuote.text = "'All our dreams can come true, if we have the courage to pursue them.'\n\n- Walt Disney" case 2: actualQuote.text = "'The secret of getting ahead is getting started.'\n\n- Mark Twain" case 3: actualQuote.text = "'I’ve missed more than 9,000 shots in my career. I’ve lost almost 300 games. 26 times I’ve been trusted to take the game winning shot and missed. I’ve failed over and over and over again in my life and that is why I succeed.'\n\n- Michael Jordan" case 4: actualQuote.text = "'Don’t limit yourself. Many people limit themselves to what they think they can do. You can go as far as your mind lets you. What you believe, remember, you can achieve.' \n\n– Mary Kay Ash" case 5: actualQuote.text = "'Don't limit yourself based on what someone else tells you.\n\n-Unknown'" case 6: actualQuote.text = "'I wondered why somebody didn't do something, then I realized, it takes common sense!'\n\n- Unknown" case 7: actualQuote.text = "'Only the paranoid survive.' \n\n– Andy Grove" case 8: actualQuote.text = "'It’s hard to beat a person who never gives up.' \n\n– Babe Ruth" case 9: actualQuote.text = "'I wake up every morning and think to myself, ‘how far can I push this company in the next 24 hours.’\n\n– Leah Busque" case 10: actualQuote.text = "'If people are doubting how far you can go, go so far that you can’t hear them anymore.'\n\n– Michele Ruiz" case 11: actualQuote.text = "'We need to accept that we won’t always make the right decisions, that we’ll screw up royally sometimes – understanding that failure is not the opposite of success, it’s part of success.'\n\n – Arianna Huffington" case 12: actualQuote.text = "'Write it. Shoot it. Publish it. Crochet it, sauté it, whatever. MAKE.'\n\n – Joss Whedon" case 13: actualQuote.text = "'Ask NOT what your country can do for you, ask what you can do for your country.'\n\n - John F. Kennedy" case 14: actualQuote.text = "'Again, truly I tell you that if two of you on earth agree about anything they ask for, it will be done for them by my Father in heaven.'\n\nMatthew 18:19" case 15: actualQuote.text = "'Anyone who has ever made anything of importance was disciplined.'\n\n— Andrew Hendrixson" case 16: actualQuote.text = "'Don’t spend time beating on a wall, hoping to transform it into a door.'\n\n— Coco Chanel" case 17: actualQuote.text = "'Turn that frown upside down.'\n\n- Unknown" case 18: actualQuote.text = "'Optimism is the one quality more associated with success and happiness than any other.'\n\n — Brian Tracy'" case 19: actualQuote.text = "'Always keep your eyes open. Keep watching. Because whatever you see can inspire you.'\n\n — Grace Coddington'" case 20: actualQuote.text = "'What you get by achieving your goals is not as important as what you become by achieving your goals.'\n\n — Henry David Thoreau" case 21: actualQuote.text = "'Don't pee on my leg, and tell me its raining.'\n\n- Judge Judith Sheindlin (Judge Judy)" case 22: actualQuote.text = "'Stay hungry, stay foolish.'\n\n- Steve Jobs - Former CEO, Apple, Inc." case 23: actualQuote.text = "'What lies behind you and what lies in front of you, pales in comparison to what lies inside of you.'\n\n- Ralph Waldo Emerson" case 24: actualQuote.text = "'We must let go of the life that we had planned, so as to accept the one that's waiting for us.'\n\n- Joseph Campbell" case 25: actualQuote.text = "'We can't help everyone. But everyone can help someone'\n\nRonald Reagan" case 26: actualQuote.text = "'A man should look for what is, and not what he thinks it should be'\n\nAlbert Einstein" case 27: actualQuote.text = "'Trust the timing of your life.'\n\n- Unknown" case 28: actualQuote.text = "'Let your smile change the world. But don't let the world change your smile.'\n\n- Unknown" case 29: actualQuote.text = "'Learn from the mistakes of others. You can't live long enough to make them all yourself.'\n\n- Eleanor Roosevelt" case 30: actualQuote.text = "'I know for sure that what we dwell on, is what we become'\n\n- Oprah Winfrey" case 31: actualQuote.text = "'Act like what you do matters.\nIT DOES.'\n\n- William James" case 32: actualQuote.text = "'How we live is what makes us real.'\n\n- Unknown" case 33: actualQuote.text = "'It's okay to be a glowstick. Sometimes we have to break before we shine.'\n\n- Jadah Sellner" case 34: actualQuote.text = "'If you're offered a seat on a rocket ship, don't ask what seat, just get on!'\n\n- Sheryl Sandberg" case 35: actualQuote.text = "'Stop being afraid of what can go wrong, and start being positive of what can go right.'\n\n- Unknown" case 36: actualQuote.text = "'THINK POSITIVE\n\nTALK POSITIVE\n\nFEEL POSITIVE'\n\n- Unknown" case 37: actualQuote.text = "'Out of the moutain of despair, a mountain of hope'\n\n- Dr. Martin Luther King, Jr." case 38: actualQuote.text = "'The most wasted days is one without laughter.'\n\n- E.E. Cummings" case 39: actualQuote.text = "'Life is like a box of choclates. You never know what you're gonna get.'\n\n- Forest Gump" case 40: actualQuote.text = "'Push yourself. Because no one is gonna do it for you.'\n\n- Unknown" case 41: actualQuote.text = "'Never give up. Because great things take time!'\n\n- Unknown" case 42: actualQuote.text = "'Stars can't shine without darkness.\n\n- Unknown" case 43: actualQuote.text = "'Your dream doesn't have an expiration date. Take a deep breath, and try again!'\n\n- KT Willen" case 44: actualQuote.text = "'5 DAY REMINDERS:\n\n1. I am amazing\n2. I can do anything\n3. Positivity is a CHOICE.\n4. I celebrate my individuality.\n5. I am prepaired to succeed.'\n\n- Unknown" case 45: actualQuote.text = "'I really appreciate people who correct me, because without them, I might have been repeating mistakes for a long time.'\n\n- Mufti Menk" case 46: actualQuote.text = "'No question is stupid. It is stupid NOT to ask the question!'\n\n- Unknown" case 47: actualQuote.text = "'Yes, I talk to myself. I need expert advice!'\n\n- Unknown" case 48: actualQuote.text = "'Yes, I talk to my pet. DON'T YOU?'\n\n- Unknown" case 49: actualQuote.text = "'No matter how old or who you are. When a child give you a toy phone, you ANSWER it!'\n\n- Unknown" case 50: actualQuote.text = "'No matter how old we are. When we see a TRY ME button, we press it!'\n\n- Unknown" case 51: actualQuote.text = "'When you want to give up, DON'T. Keep trying until you reach your goals. Even if someone else tells you it's impossible.'\n\n- Unknown" case 52: actualQuote.text = "'Frankly my dear, I don't give a damn.'\n\nClark Gable, Gone With The Wind" case 53: actualQuote.text = "'Of course I talk to myself. I need expert advice!'\n\n- Unknown" case 54: actualQuote.text = "'Nothing is impossible with the right attitude.'\n\n- Unknown" case 55: actualQuote.text = "'Buckle up, Butter cup!'\n\n- Unknown" case 56: actualQuote.text = "'The same boiling water that softens the potato hardens the egg. It’s what you’re made of. Not the circumstances.'\n\n– Unknown" case 57: actualQuote.text = "'Impossible is just an opinion.'\n\n – Paulo Coelho" case 58: actualQuote.text = "'If something is important enough, even if the odds are stacked against you, you should still do it.'\n\n– Elon Musk" case 59: actualQuote.text = "'One Day, or Day One. You Decide!'\n\n- Unknown" case 60: actualQuote.text = "'It's FRIDAY, But SUNDAY's Comin'\n\n- Various" case 61: actualQuote.text = "'If you hire people just because they can do a job, they’ll work for your money. But if you hire people who believe what you believe, they’ll work for you with blood and sweat and tears.'\n\n– Simon Sinek" default: getQuote() } } }