Hello World (Xcode)

Today I was (in a small way) involved in preparing an app (application) for deployment to Apple iOS devices. Even with my years of using Apple Macs, I have not really spent any time creating applications/programs for Macs past AppleScript / Apple Automator. With the chance to learn a new language and have some fun, it is time to learn Xcode and Swift!

I downloaded Xcode on my MacBook a few months back but haven’t got around to launching it (Python has been my thing for the last few weeks). Tonight I’m firing it up and going to give it a whirl and try and get it to display the classic “Hello World!”.

xcode_welcome

The initial splash for Xcode looks very different to the IDE that I’ve become used to with Python IDLE IDE. I decided to try creating a new Xcode project. After a few moments choosing to create an iOS app and signing in with my Apple account, I’m presented with a layout screen.Screen Shot 2018-03-28 at 21.20.48.png

The left hand side of the screen is a navigation pane, containing folders and files. The “.swift” files, as the name suggests, contains swift coding.

Screen Shot 2018-03-28 at 21.25.52.pngThe “Main.storyboard” allows for layouts to be created, including text labels:

Screen Shot 2018-03-28 at 21.31.25.png

Clicking Product > Run (or pressing APPLE R keys) allows for Xcode to simulate an iOS device:

Screen Shot 2018-03-28 at 21.32.06.png

And it displays the text label:

Screen Shot 2018-03-28 at 21.35.37.png

This is just a label being displayed, next up I hope to give Swift itself a whirl and code it to say Hello World.

So what is Swift? Swift is Apple’s programming language based on Objective C. I’m hoping that I can leverage my Python skills and use them to get a foothold in Swift for some fun 🙂

The Wikipedia page for Swift can be found at: https://en.wikipedia.org/wiki/Swift_(programming_language)

The Apple Developer page for Swift can be found at: https://developer.apple.com/swift/

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.