New to Swift

Discussion in 'iOS Programming' started by MacProgrammer247, Nov 19, 2015.

  1. MacProgrammer247, Nov 19, 2015
    Last edited by a moderator: Nov 19, 2015

    MacProgrammer247 macrumors newbie

    Joined:
    Nov 19, 2015
    #1
    Hi,

    I've only recently started learning Swift programming and my first hurdle is that I cannot get the program to print to the console in x-code? When I press command/shift/C the cursor goes to the output section of x-code but nothing happens. Sorry I'm an absolute beginner. Any help would be appreciated...

    Here is my code:
    Code:
    import UIKit
    
    
    class ViewController: UIViewController {
    
    
        overridefunc viewDidLoad() {
    
            super.viewDidLoad()
    
            print("Hello,World!")
    
            //print("Hello", terminator: "")
    
        }
    
    
        overridefunc didReceiveMemoryWarning() {
    
            super.didReceiveMemoryWarning()
    
    
        }
    
    
    
    }
     
  2. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
    #2
    I can make it print in playground but not when I make an actual project.
     
  3. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #3
    On which version of swift are you working? Is your ViewController set to the initial ViewController?
     
  4. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
    #4
    I'm not sure. I started a new project in x-code and chose Swift. I have the latest x-code installed and I'm assuming it's the latest version of Swift. I'm not sure about the veiw controller. How would I check that?

    TIA
     
  5. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #5
    there should be an arrow next to your view in the storyboard
     
  6. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
  7. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
  8. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
    #8
    I've got no idea what you're talking about sorry?

    I'm sure there's a really simple solution that I'm missing but could you please explain what you mean? I'm totally new to this x-code environment.
     
  9. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #9
    perhaps it's better to first engage in some tutorials
    At the moment you're lacking some basic knowledge
     
  10. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
    #10
    All I'm trying to do is get it to print to the output area? I'm doing exactly what it says to do in a book for beginners but for the life of me cannot get it to print anything. I have no problem understanding the code so far I just can't understand why it's not outputting anything?

    Is there some tutorial out there that shows all the settings and stuff? Not sure why this sort of thing isn't more intuitive.
     
  11. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #11
    there are plenty of them
    which languages do you speak
     
  12. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
    #12
    Do you mean which programming languages?

    Java mainly.

    I've done a little Ruby as well, HTML5 and CSS
     
  13. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #13
    no I mean English and so. You can also upload your file if you put the map in a zip
     
  14. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015
  15. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #15
    bitfountain has a free starting course showing you the several first steps
     
  16. MacProgrammer247 thread starter macrumors newbie

    Joined:
    Nov 19, 2015

Share This Page