使用者工具

網站工具


mobile_device:ios

Developer

Doc & Book

Objective-C

Frameworks

Function

Remote Notification

如果要使用這種情況,必須要implement 以下的 method,如果需要長時間使用的話 App 很容易會被 Suspend,那就必須要使用 Background Mode(remote notifications) 來避免App被系統 Suspend

From Apple:

This method will be invoked even if the application was launched or resumed because of the remote notification. The respective delegate methods will be invoked first. Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler NS_AVAILABLE_IOS(7_0);

收到 Push 後,不論 App 是否有被開啟,在 iOS 7 都能有 10 秒鐘的存活時間,你能在這段時間內執行 MapKit 來取得定位資訊,再回傳給 Server。

application:didReceiveRemoteNotification:fetchCompletionHandler:
Use this method to process incoming remote notifications for your app. Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background. In addition, if you enabled the remote notifications background mode, the system launches your app (or wakes it from the suspended state) and puts it in the background state when a push notification arrives. However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.
When a push notification arrives, the system displays the notification to the user and launches the app in the background (if needed) so that it can call this method. Launching your app in the background gives you time to process the notification and download any data associated with it, minimizing the amount of time that elapses between the arrival of the notification and displaying that data to the user.
As soon as you finish processing the notification, you must call the block in the handler parameter or your app will be terminated. Your app has up to 30 seconds of wall-clock time to process the notification and call the specified completion handler block. In practice, you should call the handler block as soon as you are done processing the notification. The system tracks the elapsed time, power usage, and data costs for your app's background downloads. Apps that use significant amounts of power when processing push notifications may not always be woken up early to process future notifications.

連結:https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:didReceiveRemoteNotification:fetchCompletionHandler

Audio

Multipeer Connectivity

Swift

UI

Reference

UX

Design

Icon

Xcode

Xcode 6 Live Rendering

Build Tool

CocoaPods

http://cocoapods.org

CocoaPods is the dependency manager for Objective-C projects. It has thousands of libraries and can help you scale your projects elegantly.

Carthage

https://github.com/Carthage/Carthage

A simple, decentralized dependency manager for Cocoa.

Simulator

Scale

預設只有 100%、75%、50% 三種解析度,但是 iPhone 6 Plus 的解析度高 2208 像素,雖然可以縮小成 50%,1104 像素仍然放不進去 1080 高的螢幕,導致無法一次看完整個畫面。

defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.45"

可以將比例改成自訂的數值,但如果有改回原本預設的三種解析度,就要自己再重新設定。

Plug-ins

Copy to "~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/"

Translation

Testing

Reference Projects

Misc

Analysis / Crash

  • LaunchKit - a suite of tools that makes it easier to build, launch, and manage mobile apps.

Network Debugging

rvictl -s <UDID>

搭配 tcpdump 或 WireShark 側錄封包。

Blog/Forum

iOS 8

iOS 9

iTouchTW

http://app.itouchtw.com/

介紹iPod Touch和iPhone上所有的軟體,其中包括AppStore、Cydia、Installer。

iPhone tw

Stanford on iTunes U

mobile_device/ios.txt · 上一次變更: 2017/01/21 02:23 由 sars