Perfect Combination of LaunchImage and LaunchScreen in iOS8

In iOS8, Apple introduced LaunchScreen.xib to replace the previous LaunchImage as the app’s launch interface. Compared to LaunchImage, LaunchScreen.xib is undoubtedly more convenient with AutoLayout, especially as iOS device screen sizes become increasingly diverse. Otherwise, an app compatible with iPhone5 to iPhone6Plus would require four different sizes of LaunchImages. However, LaunchScreen is only supported in iOS8, so some developers still choose the traditional LaunchImage method. There’s also a way to combine LaunchImage and LaunchScreen: using LaunchScreen for larger iPhones (iPhone6 and iPhone6Plus, which both run iOS8) and LaunchImage for iOS7 (since iOS7 phones only include 4-inch and 5.5-inch iPhones, only two images are needed). ...

October 25, 2014 · 1 min · Zhiya

Creating a Simple Safari Extension

Previously, I developed a Chrome extension that converts URLs into QR codes and wanted to use a similar extension in Safari. After searching, it seemed there wasn’t one available, so I decided to create a Safari extension myself and document the process. Obtaining a Developer Certificate To create a Safari extension, you first need to generate a developer certificate. Visit the Apple Developer Center and join the Safari Developer Program, which is free. Once you’re part of the developer program, you can generate a certificate by visiting Certificates, Identifiers & Profiles, clicking the plus sign in the top right corner, and generating a developer certificate. After successfully creating it, download the certificate to your local machine and import it into Keychain Access. ...

October 23, 2014 · 4 min · Zhiya

Exploring Push Notification Registration Failures in iOS8

Apple officially released iOS8 on September 18th. Upon updating, I discovered that my app could not launch on iOS8. The Console displayed the following message: 2014-09-19 16:26:20.369 demo[379:30506] registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later. Upon checking the documentation, I found that the method registerForRemoteNotificationTypes used for registering push notifications has been deprecated in iOS8. The documentation states: Following the documentation’s guidance, I replaced it with the registerForRemoteNotifications method, which does not accept any parameters. However, this led to a new issue: the app could successfully register on devices where it was already installed, but failed to register on newly installed iOS8 devices. Neither application:didRegisterForRemoteNotificationsWithDeviceToken: nor application:didFailToRegisterForRemoteNotificationsWithError: responded, and on devices where registration was successful, push notifications were received without sound alerts. Further review of the documentation revealed the following: ...

September 19, 2014 · 2 min · Zhiya

Differences Between Air SDK and Flex SDK

Recently, I upgraded the SDK for AS development from Flex SDK 4.9.1 to Air SDK 4.0, which caused a previously written FLV player to stop playing videos. Eventually, I discovered the bug was due to a variable name in a method being the same as a get method in the class. The situation is similar to what is shown in the image below: In the image, the variable time and the get method time have the same name. The compiler handles this naming conflict differently in Flex SDK and Air SDK. ...

March 27, 2014 · 1 min · Zhiya

Installing Flash Builder Plugin in Eclipse 4.3

Flash Builder is an Eclipse-based IDE. In the utilities directory of the Flash Builder folder, Adobe has provided an installation program for the plugin version, named Adobe Flash Builder 4.7 Plug-in Utility. This plugin version allows you to integrate Flash Builder into an already installed Eclipse as a view, enabling you to develop AS programs within Eclipse. After running the plugin installation program and following the prompts, you will find that the current latest version of Eclipse is 4.3. However, the Flash Builder 4.7 plugin version only supports Eclipse 3.7 or 4.2 and cannot be installed on 4.3. ...

February 27, 2014 · 1 min · Zhiya