Xcode Swift Coding Newbie: 'Unterminated string literal' error

Discussion in 'iOS Programming' started by logicstudiouser, May 10, 2017.

  1. logicstudiouser macrumors 6502

    logicstudiouser

    Joined:
    Feb 4, 2010
    #1
    I have been reading a new Swift book and I am trying one of the exercises. This particular exercise is a simple Greeting app where you type in your name, click the button and below the button it returns "Hi,...".

    This is the code:
    Screen Shot 2017-05-10 at 6.24.57 PM.png

    This is the Main.storyboard:
    Screen Shot 2017-05-10 at 6.27.43 PM.png

    View Controller:
    Screen Shot 2017-05-10 at 6.35.31 PM.png

    Also, I am wondering why when I switch from iPhone 7 view to iPhone SE view, the formatting is completely off. I have everything centred, why would it move off centre when I switch iPhone views.

    Not sure if I provided enough information, if not, let me know.

    Thanks
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    You have a curly quote in there. I guess you copied and pasted that from a website. Retype the quotes.
     

Share This Page