Swift language notes 2

CustomStringConvertible interface

This interface is newly added in Swift 2. It just has one function (description). According to Apple’s document, “This textual representation is used when values are written to an output stream, for example, by print.”

UIWebView WKWebView SFSafariViewController

In WWDC 2014, Apple introduced WKWebView for UIKit and AppKit. WKWebView uses Nitro JavaScript engine. In WWDC 2015, SFSafariViewController was introduced. I will give a simple summary about the differences among them.

watchOS 2 WatchKit updates

There are many updates in WatchKit of watchOS 2. I will talk about five new enhancements. I found an issue about watchOS 2 beta 3 and beta 4. This issue is that only apps written in Objective C can run on a real Apple watch and apps written in Swift cannot run on a real device.

iOS 9 NSUserActivity Search tricks

iOS 9 introduces NSUserActivity Search. The API is very easy, but there are some tricks. The following solutions are tested on iOS 9 beta 3.

ResearchKit study notes

We can know some coding practices of Apple when reading ResearchKit source code.

Swift cook book

####Get Current Date and Time

iOS Crash list

There are many ways to crash iOS apps. The below lists these cases.

iOS 64-bit upgrade summary

After June 1, 2015, all apps submitted to the App Store must include 64-bit support. For existing 32-bit projects, the upgrade must be done before June 1, 2015. So I did the upgrade and found something we need to pay attention to. There are some differences between iOS 7 and iOS8. Some layouts change a little bit in iOS 8 again iOS 9. The upgrade actually includes four parts: 1)64-bit support, 2)iOS 8 support, 3)iPhone 6 and iPhone 6 plus support, 4)build server upgrade.

Upgrade git on Raspbian

If the raspbian version is wheezy, then follow the steps below:

WatchKit study notes

Reference:Apple Watch Programming Guide, the images in the doc are from this guide.