iOS 開發常用官方文檔

調試相關

About Debugging with Xcode

About LLDB and Debugging
LLDB Quick Start Guide

蘋果審覈

App Store Review Guidelines

App Search Programming Guide

iOS 9學習系列:打通 iOS 9 的通用鏈接(Universal Links)

直接按照《iOS 9學習系列:打通 iOS 9 的通用鏈接(Universal Links)》裏面的操作就可以,需要特別強調的一點是:如果不支持 https, apple-app-site-association 文件一定要使用 ssl 簽名;https:///apple-app-site-association 或者https:///.well-known/apple-app-site-association 二選一即可

如果之前的 apple-app-site-association 文件有問題,你修改了,並且修改了 apple-app-site-association 的存放位置,一定一定要告訴服務器刪除原來的!!!!

使用 JavaScript 也可以實現打開一個連接可以跳轉到一個 app(window.location = “justalk://path”),但是這裏有幾點不一樣:
1. 這種方式在 Safari 每次都有提醒,用戶體驗不是很好
圖片名稱
當然,如果是用戶點擊的按鈕觸發的跳轉就不會有這個問題

<a href="justalk://path">Jump to JusTalk</a>

2. 這種方式會在 Safari 留下一個空白的頁面

這裏還有些第三方資源

Branch(免費第三方 Deep Link 和 Deferred Deep Link)
Branch SDK 實現源碼

iOS 中的 Deferred Deep Linking(延遲深度鏈接)
你知道App推廣神技“Deferred Deeplink”嗎?
Deferred Deep Linking in iOS
Android: Handling App Links
Facebook 推出 App Links 開發者工具意在解決什麼問題?

內購相關(IAP)

In-App Purchase Configuration Guide for iTunes Connect

In-App Purchase Programming Guide
Adding In-App Purchase to your Applications
Introducing Expanded Subscriptions in iTunes Connect (WWDC 2016)

需要注意的是:
1. 如果應用沒有審覈通過,那麼這次提交審覈的商品的 ID 就不能再使用,需要重新創建新的商品
2. 應用裏面要提供 term of use 和用戶協議。用戶可以查看到這些內容。如果沒有會直接被拒


iOS Human Interface Guidelines

包含不同設計元素的設計原則和尺寸
拓展功能相關的元素和設計原則(如:3D Touch、Spotlight 等)
新的 iOS 版本更新了哪些設計元素和設計原則

iOS Auto Layout Guide

auto layout 最終還是通過對約束的計算來修改 view 的 frame 來實現對控件大小和位置的控制。
需要注意的是,view 中的 transform 也是通過修改 frame 來實現 transfrom 的效果。但是 transform 並不會修改 bounds。auto layout 在計算新的 frame 時也不會參考 transform 屬性,即* transform 對 auto layout 無效*

深入剖析Auto Layout,分析iOS各版本新增特性

Resource Programming Guide

包括 Nib 工作流程和原理,nib 相關概念(file owner、first responder 等)。圖片、字符串、多媒體資源的使用等

iCloud 編程

CloudKit Quick Start

iCloud Design Guide

Extension And Widget

App Extension Programming Guide
包括自定義鍵盤,Widget 等

Wallet Developer Guide
包括自定義鍵盤,Widget 等

Document Interaction Programming Topics for iOS(UTI)

Document Interaction Programming Topics for iOS
iOS實現App之間的內容分享

音視頻相關

Audio Unit Hosting Guide for iOS
Core Audio Overview
Core Audio Glossary

iOS開發系列–音頻播放、錄音、視頻播放、拍照、視頻錄製
使用AV Foundation從攝像頭將視頻幀捕獲爲圖像
一篇對iOS音頻比較完善的文章
oc開發筆記3 錄音時頻率獲取 以及聲像顯示

iOS Dual Camera 相關
包括相機校正信息、深度信息、廣角和長焦圖片獲取等

func depthDataMap() -> CVPixelBuffer? {

  // 1
  guard let fileURL = Bundle.main.url(forResource: name, withExtension: ext) as CFURL? else {
    return nil
  }

  // 2
  guard let source = CGImageSourceCreateWithURL(fileURL, nil) else {
    return nil
  }

  // 3
  guard let auxDataInfo = CGImageSourceCopyAuxiliaryDataInfoAtIndex(source, 0, 
      kCGImageAuxiliaryDataTypeDisparity) as? [AnyHashable : Any] else {
    return nil
  }

  // 4
  var depthData: AVDepthData

  do {
    // 5
    depthData = try AVDepthData(fromDictionaryRepresentation: auxDataInfo)

  } catch {
    return nil
  }

  // 6
  if depthData.depthDataType != kCVPixelFormatType_DisparityFloat32 {
    depthData = depthData.converting(toDepthDataType: kCVPixelFormatType_DisparityFloat32)
  }

  // 7
  return depthData.depthDataMap
}
// 1
let depthReader = DepthReader(name: name, ext: ext)

// 2
let depthDataMap = depthReader.depthDataMap()

// 3
depthDataMap?.normalize()

// 4
let ciImage = CIImage(cvPixelBuffer: depthDataMap)
depthDataMapImage = UIImage(ciImage: ciImage)


Core Animation Programming Guide

包含了動畫機制,使用教程,以及有哪些 keyPath 可以使用。詳見章節《Key Path Support for Structures》

Quartz 2D Programming Guide

繪圖相關的所有知識。包括塗鴉的實現(詳見《Setting Blend Modes》)圖片的變換(詳見《Transforms》)

通過下面的代碼可以把 UIKit 座標轉換成 2D 繪圖座標系

CGAffineTransform transform = CGAffineTransformIdentity;
transform.a = 1;
transform.b = 0;
transform.c = 0;
transform.d = -1;
transform.tx = 0;
transform.ty = CGBitmapContextGetHeight(context);
// 對應的是 2D 繪圖座標系下的值
frame = CGRectApplyAffineTransform(frame, transform);

關於仿射變換可以參照如何通俗地講解「仿射變換」這個概念?以及章節Transforms

Local and Remote Notification Programming Guide

包含了接口說明和 APNs 機制

訪問系統通訊錄數據

iOS7 - iOS 9
iOS10
Address Book Programming Guide for iOS

KeyChain

Keychain Services Programming Guide

使用 KeyChain 的時候有以下幾點需要注意:
1. In iOS, Keychain rights depend on the provisioning profile used to sign your application. Be sure to consistently use the same provisioning profile across different versions of your application.
2. An app with a minimum deployment target earlier than iOS 8.0 cannot use application groups for keychain item sharing, and should instead rely on the keychain-access-groups entitlement to share keychain items.
3. When your app creates a keychain item, if you do not explicitly specify the kSecAttrAccessGroup key in the item’s attributes dictionary, Keychain Services uses the first group of the app’s access groups array (ordered as shown above) as the default access group. If your app has a keychain-access-groups entitlement, Keychain Services uses the first of these. Otherwise, it uses the application identifier, which is always present. Thus, by default, unless you add a keychain-access-groups entitlement, an app creates keychain items to which only it has access. On the other hand, all the named access groups from the collection above are valid values for the kSecAttrAccessGroup key. This allows you to add new items to any one of the app’s groups.
4. SecItemAdd 等方法會返回 OSStatus 類型的結果,返回值的含義可以參照 SecBase.h
5. KeyChain 中 kSecAttrGeneric 的作用類似於 identifier。當添加一條記錄某一(A)的時候,如果 KeyChain 中有一條記錄(B)和 A 有相同的 kSecAttrGeneric ,並且 A 和 B 的屬性種類也完全相同,那麼這個時候使用 Add 方法會失敗,應該使用 Update 方法。

// add
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    [dic setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass];
    [dic setObject:[@"11223344" dataUsingEncoding:NSUTF8StringEncoding] forKey:(__bridge id)kSecAttrGeneric];
    [dic setObject:@"1122334466" forKey:(__bridge id)kSecAttrAccount];
    [dic setObject:[@"1122334455" dataUsingEncoding:NSUTF8StringEncoding] forKey:(__bridge id)kSecAttrService];
    [dic setObject:(__bridge id)kCFBooleanFalse forKey:(__bridge id)kSecReturnData];
    OSStatus status = SecItemAdd((__bridge CFDictionaryRef)dic, NULL);
// match
// 匹配條件是 kSecClass 爲 kSecClassGenericPassword
// 並且 kSecAttrGeneric 爲 [@"11223344" dataUsingEncoding:NSUTF8StringEncoding]
// 同時其他屬性中包含 [@"112233" dataUsingEncoding:NSUTF8StringEncoding]
NSMutableDictionary *dic2 = [NSMutableDictionary dictionary];
    [dic2 setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass];
    [dic2 setObject:[@"11223344" dataUsingEncoding:NSUTF8StringEncoding] forKey:(__bridge id)kSecAttrGeneric];
    [dic2 setObject:[@"112233" dataUsingEncoding:NSUTF8StringEncoding] forKey:(__bridge id)kSecMatchSubjectContains];
    [dic2 setObject:(__bridge id)kSecMatchLimitAll forKey:(__bridge id)kSecMatchLimit];
    [dic2 setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnAttributes];
    CFTypeRef outPut = NULL;
    OSStatus status2 = SecItemCopyMatching((__bridge CFDictionaryRef)dic2, (CFTypeRef *) &outPut);


多線程

Runtime

  • Runtime 函數列表
    Runtime 相關函數列表及含義

  • Type Encodings
    runtime 情況下不同數據類型對應的類型列表。如:c 代表 char 類型,i 代表 int 類型等

APP 發佈

App Distribution Guide
- 包含了證書相關的知識,以及如何配置工程來出版本等
- 查看 APP 中 provision 的 entitlements

iTunes Connect 開發人員幫助
itunesconnect 使用幫助。包括 App Store 圖標規範等

App Programming Guide for iOS
工程配置(包括必須的資源等)、生命週期、後臺原理等

On-Demand Resources Guide
如何使用 On-Demand 方式來動態加載應用中需要的資源來減小下載包大小

Bundle Programming Guide
程序、framework等都是 Bundle 只是類型不同

iOS 7 UI Transition Guide

包含 iOS 7 更新了哪些東西,怎樣從之前的版本過度到 iOS 7
例如: wantsFullScreenLayout、edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars、automaticallyAdjustsScrollViewInsets 等

Information Property List Key Reference

iOS 中 info.plist 用的 property key 及含義

文字處理

Predicate

Predicate Programming Guide

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章