Thursday, June 5, 2014

Apple Swift Programming Language - Hello World


Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility.

In my efforts to learn the new language, I’ve decided I will be posting regularly as I step through the learning process, sharing everything I find. This is the first post of many on the topic, and I hope you decide to follow along!

Let's start with basic Xcode template..

1.  Create an Empty Application:

2. Now create a new UIViewController which will act as a rootViewController


3. So for instance in Objective-C where you have this:
 RootViewController *vc = [[RootViewController alloc] init];  

You now have this:
 var vc = RootViewController()  


4. You may have to get rid off from designated initializer from RootViewController class or you have to create instance with:
 var vc = RootViewController(nibName: nil, bundle: nil)  

5. Now create instance of UINavigationController and attach your vc instance to the rootViewController.



6. Build and run!

Source Code

We will cover Swift basics in next Article

Cheers!!

Monday, April 7, 2014

Move repo from bitbucket to github


Simple and pretty neat trick:

Lets say your project repository in my $HOME/dev/SampleProject directory.

cd $HOME/dev/SampleProject
git remote rename origin bitbucket
git remote add origin https://github.com/sample/SampleProject.git
git push origin master
 
 
Once your push has been successful to Github then you can delete the old remote by using:
git remote rm bitbucket

It'll only remove your local reference not your origin repository.

Tags:
You'll notice that your tags are still not visible in github. You may need to run single command on terminal:
git push origin --tags -f


 

 
Submit Express Inc.Search Engine Optimization Services