Showing posts with label Xcode. Show all posts
Showing posts with label Xcode. Show all posts

Saturday, November 19, 2016

Swift Tip - Extensions

Extensions allow you to extend the functionality of an existing class, structure, enumeration, or protocol.  Here is an useful example:

extension Int {
    var isPerfectSquare:Bool {
        let sr = sqrt(Double(self))
        return ((Int(sr) * Int(sr)) == self)
    }

}

The above isPerfectSquare() function extends the Int class. You can call it to check if a number is a perfect square, like this:

        print(25.isPerfectSquare) //---true---
        print(26.isPerfectSquare) //---false---
        print(27.isPerfectSquare) //---false---
        print(36.isPerfectSquare) //---true---

Sunday, July 31, 2016

Swift Cheat Sheets updated for Swift 3.0

My Swift Cheat Sheets are now updated for Swift 3.0. To try out Swift 3.0, you would need Xcode 8 (beta 3 at the time of writing). You can download the cheat sheets by clicking on the images below.

Sunday, July 03, 2016

Mobile Development Series of Courses


iOS and Android Boot Camps


Looking to jumpstart your iOS or Android development projects? The fastest way to be productive is to join us in the upcoming iOS and Android Boot Camps. In these boot camps, you will learn the fundamentals in 5 days, and at the end of the 5 days, you will be productive and on your way to coding your first real-life app.


AND500 - Android Programming Bootcamp
Course Fee
S$3197 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Mon Oct 24 2016Fri Oct 28 2016PDF

IOS500 - iPhone Programming Boot Camp
Course Fee
S$3197 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Mon Jul 18 2016Fri Jul 22 2016PDF
Mon Aug 29 2016Fri Sep 02 2016PDF

Monday, May 02, 2016

iOS Boot Camp

If your company is planning to go into iOS development, the 5-Day iOS Boot Camp is the most cost-effective way to get your developers jumpstarted. Available in Swift or Objective-C, this course focuses on all the important aspects of iOS development to jumpstart your developers in the shortest time.  We can conduct this course in house, or you can send your developers to our open classes.

Topics include:

  • Introduction to Objective-C or Swift
  • Storyboard
  • Location-Based Services
  • Design Patterns
  • Protocols and Delegates
  • Databases
  • Web Services
  • Background Fetch
  • Network Connectivity

We have conducted this course successfully worldwide. Contact Wei-Meng Lee @ weimenglee@learn2develop.net for details such as costing, venue, as well as in-house arrangements.

Friday, April 15, 2016

Changes in Swift 2.2 - Selectors

Prior to Swift 2.2, you can use a string literal for Objective-C selectors. For example, in the following code snippet you could specify onTimer as the selector:

    func onTimer() {
        ...
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
        delta = CGPointMake(12.0,4.0)
        NSTimer.scheduledTimerWithTimeInterval(0.05,
                                               target:self,
                                               selector:"onTimer",
                                               userInfo:nil,
                                               repeats:true)

    }

Because there is no checking to ensure that the selector name is a well-formed selector (or that it even refers to a valid method), this method of naming a selector is dangerous and hence deprecated in Swift 2.2. 

Instead, you should now use the new #selector expression that allows you to build a selector from a reference to a method. The above code now looks like this:

    override func viewDidLoad() {
        super.viewDidLoad()

        NSTimer.scheduledTimerWithTimeInterval(0.05,
                                               target:self,
                                               selector:#selector(ViewController.onTimer),
                                               userInfo:nil,
                                               repeats:true)
    }

If the target method accepts arguments, then the selector looks like this:

    func doSomething(num1:Int, num2:Int) {
        ...
    }

    override func viewDidLoad() {
        super.viewDidLoad()        
        
        NSTimer.scheduledTimerWithTimeInterval(0.05,
                                               target:self,
                                               selector:#selector(
                                               ViewController.doSomething(_:num2:)),
                                               userInfo:nil,
                                               repeats:true)
    }

While the old method of using string literal for selector is still supported in Swift 2.2, you should use the new syntax when updating your code.

Thursday, January 14, 2016

Monday, December 28, 2015

Learn iPhone and Apple Watch Programming

Learn how to program iOS apps using the new Swift programming language from Apple. The Swift programming language now makes developing iOS apps much easier and efficient. In this course, you will get a firm grounding in the basics of the new language and the fundamental concepts of iOS Programming.

IOS101 Fundamentals of iPhone Programming using Swift (S$1197)
Once you have a solid understanding of iOS programming, you are now ready to program the Apple Watch. This course comes with an Apple Watch, and you will learn how to deploy your apps onto your iPhone and Apple Watch.

IOS302 Advanced iOS - Apple Watch Programming (S$1397)


P.S. You need to bring along your own Mac. 

Tuesday, November 03, 2015

IOS302 - Apple Watch Programming

In the upcoming Apple Watch Programming course, I will cover the latest watchOS 2.0.

Apple's latest watchOS 2.0 supports:

    * Complications and Time Travel
    * The new Watch Connectivity Framework
    * New execution model for apps
    * Several new controls like Picker, Alerts and Action Sheets, and Movie control
    * The ability to access the hardware on the Apple Watch


This course includes an Apple Watch Sport.


IOS302 - Advanced iOS - Apple Watch Programming
Course Fee
S$1397 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Fri Nov 20 2015 CONFIRMEDFri Nov 20 2015PDF
Wed Dec 23 2015 CONFIRMEDWed Dec 23 2015PDF
Fri Mar 18 2016Fri Mar 18 2016PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621 

Tuesday, October 06, 2015

Source code for talk in GOTO Conference Copenhagen 5-6 Oct 2015


I have attached the demos for the talk "Developing Killer Apple Watch Apps" that I delivered at the GOTO Conference, Copenhagen 5-6 Oct 2015. You can download the source code here.

Friday, September 04, 2015

IOS302 - Apple Watch Programming Course - 17 Sep 2015

In the upcoming Apple Watch Programming course, I will cover the latest watchOS 2.0!

Apple's latest watchOS 2.0 will support:

    * Complications and Time Travel
    * The new Watch Connectivity Framework
    * New execution model for apps
    * Several new controls like Picker, Alerts and Action Sheets, and Movie control
    * The ability to access the hardware on the Apple Watch
Course Fee
S$1397 (nett; no GST) Includes an Apple Watch Sport
Get a copy of my Learning WatchKit Programming book when you attend the course.
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Thu Sep 17 2015 CONFIRMEDThu Sep 17 2015PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621

Tuesday, June 30, 2015

Get an Apple Watch when you sign up for the Apple Watch Programming course

Now that the Apple Watch is available in Singapore, you can now write and test your apps on the Apple Watch directly without using the simulator! And when you sign up for the IOS302 Apple Watch Programming course, you will get an Apple Watch with the course!
Course Fee
S$1397 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Fri Jul 10 2015Fri Jul 10 2015PDF
Wed Sep 16 2015 CONFIRMEDWed Sep 16 2015PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621  

If your company requires in-house training, you can contact us to customize the topics to meet your training requirements. We train worldwide! We have conducted customized classes in the United States, Canada, Norway, Denmark, Japan, China, Hong Kong, Taiwan, and Thailand.

Monday, June 22, 2015

IOS103 - Practical iOS Programming using the Swift Programming Language

Want to learn Swift by doing something interesting? In the upcoming IOS103 - Practical iOS Programming using the Swift Programming language course, you will learn the Swift programming language by working on some interesting projects, such as:

1. Multithreading using Grand Central Dispatch
2. Protocols and Delegates
3. Completion Handler Design Patterns
4. Closures
Course Fee
S$1197 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Mon Sep 21 2015 CONFIRMEDTue Sep 22 2015PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621  

If your company requires in-house training, you can contact us to customize the topics to meet your training requirements. We train worldwide! We have conducted customized classes in the United States, Canada, Norway, Denmark, Japan, China, Hong Kong, Taiwan, and Thailand.

Thursday, June 18, 2015

Learning iOS Programming?

So, you are planning to get started with iOS programming. Good for you. But how do you get started? I have the following two courses to get you started:

IOS101 - Fundamentals of iPhone Programming using Swift
IOS103 - Practical iOS Programming using the Swift Programming Language

Which course is suitable for you?

You should attend IOS101 if you:

  • Are new to iOS programming
  • Want to learn how to create iPhone apps using Swift

You should attend IOS103 if you:

  • Are already familiar with Objective-C and want to learn how to code in Swift
  • Want to learn advanced Swift features
  • Want to learn how to use Swift to create interesting iOS projects

IOS103 - Practical iOS Programming using the Swift Programming Language - New Course!

As the Swift programming language gains traction, it is now important to learn this language so that you can be prepared for the future. This new course is specifically designed for those who are already familiar with Objective-C and who want to learn Swift in the fastest possible way.

Instead of covering all the language syntax in 2 days, this course will discuss Swift through the use of practical examples. Participants will learn how to use Swift in their iOS projects, and learn on-the-job as they work through some of the most interesting projects in iOS.
Course Fee
S$1197 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Mon Sep 21 2015Tue Sep 22 2015PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621  

If your company requires in-house training, you can contact us to customize the topics to meet your training requirements. We train worldwide! We have conducted customized classes in the United States, Canada, Norway, Denmark, Japan, China, Hong Kong, Taiwan, and Thailand. 

Wednesday, May 20, 2015

Course Highlight - IOS302 Programming Apple Watch

The Apple Watch is here and shipping! Get your apps ready for the next rush in apps creation! In this course, you will learn all about the techniques for programming your Apple Watch. What's more, the course fee includes an Apple Watch (38mm Sport edition; participants will receive the Apple Watch when it is available in Singapore).
Course Fee
S$1397 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 60% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateDetailsCategory
Thu Jun 18 2015Thu Jun 18 2015PDF
Fri Jul 10 2015Fri Jul 10 2015PDF
Wed Sep 16 2015Wed Sep 16 2015PDF
Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621  

If your company requires in-house training, you can contact us to customize the topics to meet your training requirements. We train worldwide! We have conducted customized classes in the United States, Canada, Norway, Denmark, Japan, China, Hong Kong, Taiwan, and Thailand.