iOS Timer Tutorial in Swift

On February 28, 2016, in Swift, by James Liu

Timer is a very common method to perform a schedule task within a period of time. We can execute the timer once or repeatedly. In this tutorial, I will show you how to use iOS timer in Swift. Once you finish this tutorial, you will understand how to create a iOS timer in Swift and execute a task after a certain time interval.
Continue reading »

 

Set UIWebView Content not to Scroll When Keyboard is Shown

On February 18, 2016, in iPhone iPad Object-C, by James Liu

This week, I have met a problem when I am developing a hybrid app with Cordova (Phonegap). The Cordova app is basing on UIWebView. So the whole app is build by HTML5, Javascript and CSS. Usually, UIWebView will scroll up when keyboard is shown if we click an input field or textfield focus. Therefore, all content in the UIWebView is pushing up. In most of the case, this behavior is correct. However, in my case, it becomes to be a problem. And I have to prevent UIWebView to scroll when keyboard appears.
Continue reading »

Tagged with:  

iOS Customize URL Schemes for Other Apps Calling

On January 20, 2016, in Swift, by James Liu

These days, I am trying to develop an iOS app which allows other apps to launch it. In iOS, we can customize URL schemes in our app. It will tell iPhone to launch this app when it finds other apps trying to open an URL which fit the URL schemes. This will be my another SWIFT tutorial which also helps me be familiar with SWIFT language.
Continue reading »

 

Get People Name and Phone Number from Contact by Swift

On December 30, 2015, in Swift, by James Liu

It’s time to learn Swift. After Swift first release in 2014, now more and more people start using Swift as their program language in iOS. Therefore, I decide to use Swift in my current project, loading people first name, last name and phone number from contact. This will be a good project to learn Swift from beginning.

When we create new project in Xcode, it will use Swift language by default. The only different between Objective-c and Swift is there is no .h and .m file any more. There is only one .swift file which we can declare class inside. In my new project, there is only two .swift file. One is AppDelegate.swift; the other one is ViewController.swift. All my logic to get people information from contact are in ViewController.swift. Now, I will start to show you how to get people first name, last name, and phone number from contact. All example source code will use swift.
Continue reading »

 

Swift or Objective-C Which One Shall I Choose?

On December 14, 2015, in iPhone iPad Object-C, Swift, by James Liu

As an Apple developer, Swift or Objective-C, which language shall I choose? This is a very good question. Even as an experienced apple developer, it is always hard to decide. As the first time, Apple announced swift language at 2014. And now it is much stronger. In 2015, Swift is open source. Either you are an experienced apple developer who are expert on Objective-C, or you are a beginner who want to learn programme on Apple platform, it is time to watch on Swift. As I always say, the best lesson for learning a new skill is doing something real. Therefore, I decide to write my next ios Apple by Swift. Before I release my first Swift project tutorial on my website, I will write down some basic learning points which I have learned from my first Swift project.

Update:
My first Swift tutorial is released: Get People Name and Phone Number from Contact by Swift
Continue reading »

 
WordPress Themes