天天看点

iOS 开发常用官方文档

调试相关

About Debugging with Xcode

About LLDB and Debugging

LLDB Quick Start Guide

苹果审核

App Store Review Guidelines

Universal Link

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 每次都有提醒,用户体验不是很好

iOS 开发常用官方文档

当然,如果是用户点击的按钮触发的跳转就不会有这个问题

<a href="justalk://path" target="_blank" rel="external nofollow" >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, , 
      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 = ;
transform.b = ;
transform.c = ;
transform.d = -;
transform.tx = ;
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);
           

多线程

  • Threading Programming Guide

    包含了 RunLoop 线程安全等

  • Concurrency Programming Guide

    并发编程

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 及含义

文字处理

  • Text Programming Guide for iOS

    文字绘制,CoreText,字体规范等

  • String Programming Guide for Core Foundation

    详细介绍了 c 到 oc 字符串的实现及使用规则

  • About Text Handling in iOS

    baseLine 等概念解析,键盘,字体属性及样式,文字相关底层 API (如 CoreText)

Predicate

Predicate Programming Guide