Guru's writing
  • Guru's blogging
  • Welcome!
  • NEW RELEASE!
  • Books
  • Ten Twisted Tales
  • Boogadooga Stories for Children
  • Letting go of Ganapathy
  • How to create your e-commerce website in a day
  • All My Apps
  • Ramana Nool Thirattu Urai
  • Ramana Stuthi Panchakam
  • Ramana Maharishi Translated
  • Bob Dylan and Kannadasan
  • RamanaMaharishiApp
  • MahaPeriyava
  • SingaporeDrivingQuiz
  • Advaita Masters
  • Ramana Maharishi Android App
  • GlucoTrak
  • gurucodes
  • IAMGRATEFUL

Swift and iOS with Udacity, part II.

30/10/2015

0 Comments

 
Things got more interesting in this segment. In section 3a, we learnt to navigate between screens, add more buttons and actions and some hardcore stuff I couldn't manage on my own like converting string to url among others, but the instructor (a cheerful guy named Kunal) addressed those issues in the next video. To break it down, here's what we learned:
First, we added a navigation control by embedding it from the drop down menu, created a second interface controller, and created a new  Cocoa Touch class file and named it playSoundsViewController and connected it from the Record button on the main screen. So that when you click on the record button it takes you to the next screen. [NOTE: Make sure you name the file properly or it won't let y ou drag outlets or actions. Once you create a new screen and file, click on the new screen and go to the Identity Inspector and type in the new file's name, it will auto fill.]
Then we learnt how to add an mp3 file to the project and access using AV Foundation. We created a path to the audio file in the viewDidLoad section by creating a var filepath and using NSBundle with its subclass mainBundle. 
We created an instance of the AVAudio player and converted NSString to NSUrl.
We added two buttons, playfast and playslow and connected them to the interface so they play the embedded audio file at the corresponding speeds by using the rate method in the AVAudioPlayer class.
We make sure the file, when accessed either plays the mp3 or returns an error message if the entry is invalid. Also, we need to have the variable audioPlayer needs to be a global variable so it can be accessed from other functions. [NOTE: I was redoing the lesson so I could take down all the steps, and was stuck on this error I didn't get before 'EXC_BAD_INSTRUCTION code=EXC_1386_INVOP'. Spent over an hour fixing this, then while comparing to the earlier working code, realised I had put - instead of _ in the mp3 file name. So in case you get that error, it could be this.]
We are supposed to take the common pieces of code and create a new function butI'm not sure where to add the function to, so I'll see if that gets addressed in the next lesson. 
0 Comments

​What I learnt about Swift with Udacity

21/10/2015

0 Comments

 
This is a topic we are required to write about on finishing the first section of Udacity's course, I thought I might as well do a post and perhaps keep updating it as and when I manage to finish the many courses I'm taking. So here goes:
I've been meaning to enroll for one of Udacity's many courses for a while and that came to fruition when I signed up for their free Intro to iOS Development with Swift course. 
The course is laid out very well, the instructions by the teacher Kunal were clear and easy to follow, the quizzes were relevant and made you think. I managed to solve quite a few based on what I learnt on the Udemy courses and by googling. There's a forum where you can submit your answers and ask questions, I noticed the instructor answering some questions, which is always encouraging.
Broadly, the course is about building a simple recording app. In the first part, you are taught how to add labels, buttons, images to the buttons, constraints and how to use them, aligning images, hiding and showing labels and the text they contain, the difference between IBOutlets and IBActions, the relationship between Model, View and Controller (I knew about it a bit from my Ruby and Rails lessons) and the difference between the 1x, 2x image boxes in the xc assets (the 1x is meant for non-retina iPhones and 2x and 3x are for retina iPhones). By the way, strong and weak in IBOutlets are Swift's way of managing memory, a weak variable is an instruction to hold a weak reference while a strong variable/outlet means I initialised it, so keep it till I don't need it anymore.
I must say, based on this course, I am tempted to take up their nanodegree on Beginning iOS Development. And they have an attractive incentive of refunding 50% of the tuition fees for those finishing the course within a year.
0 Comments

    Author

    This is a chronicle of my journey into coding. I'll post where I am at on the road to learning Ruby with One month Rails and HTML/CSS with Teamtreehouse, and Python which I'm learning on my own. Ambitious for a writer? You bet!

    Archives

    October 2017
    October 2015
    May 2015
    December 2014
    November 2014
    September 2014
    August 2014
    July 2014

    Categories

    All
    Amazon S3
    Amazon Web Services
    AWS Keys
    Beginner Ruby
    Beginner's Ruby
    Beginning Ruby
    Codecademy
    Coding
    Css
    Github
    Gurucodes
    Guruswriting
    Html
    IOS9
    Novice Coding Journey
    Onemonth Rails
    Pragmatic Studio
    Python
    Rails
    Rails5
    Rails 5.0
    Ruby
    Ruby Newbie
    Ruby On Rails
    Ruby Prgramming
    Ruby Programming
    Shor Stories Guru
    Shorstories Guru
    Shortstories Guru
    Swift
    Tealeaf Academy
    Tealeaf Acdemy Ruby
    Teamtreehouse
    Treehouse
    Udacity
    Udemy

    RSS Feed

My other sites:  Music is about memories: http://radiomemories.blogspot.com, http://radiomemories.weebly.com/
A site dedicated to the genius of Kannadasan:http://kannadasansongs.blogspot.com 
 A travel blog: http://guruwanders.blogspot.com