# 翻译 🍔 View Controller Programming Guide for iOS (opens new window)
# 简介
《ViewController编程指南》
是iOS
编程学习的必经之路,因此也已经有了很多国内的其他翻译,不过总觉得还有改进的空间,因此重新去翻译一下。主要是:
- UI 更好看一点。
- 会多审校几次,尽可能读起来舒适。
- 更方便阅读,因为有和官方类似的侧边栏。
翻译的水准就无从保证了,读者见谅 ♥️ 。
可能现在大家都用 Swift 开发了,不过即便如此,Objc + MVC 的模式,仍然是理解 iOS 开发的必经之路,我仍然是这么想的。希望十年后,仍然这么想。
# 目录
-
- 1. 定义你的子类 🍟 define your subclass
- 2. 实现容器视图控制器 🍟 Implementing a Container View Controller
- 设计自定义容器视图控制器 🍟 Designing a Custom Container View Controller
- Example: Navigation Controller 🍟 Example: Navigation Controller
- Example: Split View Controller 🍟 Example: Split View Controller
- 在Interface Builder中配置容器 🍟 Configuring a Container in Interface Builder
- 实现自定义容器视图控制器 🍟 Implementing a Custom Container View Controller
- 将子视图控制器添加到您的内容上 🍟 Adding a Child View Controller to Your Content
- 删除子视图控制器 🍟 Removing a Child View Controller
- 子视图控制器之间的转换 🍟 Transitioning Between Child View Controllers
- 管理子VC的外观更新 🍟 Managing Appearance Updates for Children
- 关于构建容器视图控制器的建议 🍟 Suggestions for Building a Container View Controller
- 将控制委托给子视图控制器 🍟 Delegating Control to a Child View Controller
- 3. 支持无障碍 🍟 Supporting Accessibility
- 4. 保存和恢复状态 🍟 Preserving and Restoring State
- 标记保存视图控制器 🍟 Tagging View Controllers for Preservation
- 选择有效的restorationIdentifier 🍟 Choosing Effective Restoration Identifiers
- 排除视图控制器组 🍟 Excluding Groups of View Controllers
- 保留视图控制器的视图 🍟 Preserving a View Controller’s Views
- 在启动时恢复视图控制器 🍟 Restoring View Controllers at Launch Time
- 对视图控制器的状态进行编码和解码 🍟 Encoding and Decoding Your View Controller’s State
- 保存和恢复视图控制器的提示 🍟 Tips for Saving and Restoring Your View Controllers
-
- 1. 呈现视图控制器 🍟 PresentingaViewController
- 呈现和转场过程 🍟 The Presentation and Transition Process
- 呈现样式 🍟 Presentation Styles
- 全屏呈现样式 🍟 Full-Screen Presentation Styles
- 弹出风格 🍟 The Popover Style
- 当前上下文样式 🍟 The Current Context Styles
- 自定义呈现样式 🍟 Custom Presentation Styles
- 转场样式 🍟 Transition Styles
- 呈现与展现视图控制器 🍟 Presenting Versus Showing a View Controller
- 呈现视图控制器 🍟 Presenting a View Controller
- 显示视图控制器 🍟 Showing View Controllers
- 模态化呈现视图控制器 🍟 Presenting View Controllers Modally
- 在Popover中呈现视图控制器 🍟 Presenting a View Controller in a Popover
- 关闭呈现的视图控制器 🍟 Dismissing a Presented View Controller
- 呈现在不同故事板中定义的视图控制器 🍟 Presenting a View Controller Defined in a Different Storyboard
- 2. 使用Segue 🍟 Using Segues
- 在视图控制器之间创建Segue 🍟 Creating a Segue Between View Controllers
- 在运行时修改Segue的行为 🍟 Modifying a Segue’s Behavior at Runtime
- 创建一个 Unwind Segue 🍟 Creating an Unwind Segue
- 以编程方式启动Segue 🍟 Initiating a Segue Programmatically
- 创建自定义Segue 🍟 Creating a Custom Segue
- Segue的生命周期 🍟 The Life Cycle of a Segue
- 实现自定义Segue 🐶 Implementing a Custom Segue
- 3.自定义转场动画 🍟 Customizing the Transition Animations
- 转场动画序列 🍟 The Transition Animation Sequence
- 转场委托 🍟 The Transitioning Delegate
- 自定义动画序列 🍟 The Custom Animation Sequence
- 转场上下文对象 🍟 The Transitioning Context Object
- 转场协调器 🍟 The Transition Coordinator
- 使用自定义动画呈现视图控制器 🍟 Presenting a View Controller Using Custom Animations
- 实现转场委托 🍟 Implementing the Transitioning Delegate
- 实现你的Animator对象 🍟 Implementing Your Animator Objects
- 获取动画参数 🍟 Getting the Animation Parameters
- 创建转场动画 🍟 Creating the Transition Animations
- 创建动画。🍟 Create the animations.
- 动画后的清理 🍟 Cleaning Up After the Animations
- 为您的转场添加交互性 🍟 Adding Interactivity to Your Transitions
- 创建伴随转场运行的动画 🍟 Creating Animations that Run Alongside a Transition
- 在动画中使用呈现控制器 🍟 Using a Presentation Controller with Your Animations
- 4. 创建自定义呈现 🍟 Creating Custom Presentations
- 自定义呈现过程 🍟 The Custom Presentation Process
- 创建自定义呈现控制器 🍟 Creating a Custom Presentation Controller
- 设置Presented视图控制器的frame 🍟 Setting the Frame of the Presented View Controller
- 管理和动画自定义视图 🍟 Managing and Animating Custom Views
- 将您的呈现控制器提供给UIKit 🍟 Vending Your Presentation Controller to UIKit
- 适应不同的尺寸类 🍟 Adapting to Different Size Classes
- 1. 呈现视图控制器 🍟 PresentingaViewController
-
- 1. 自适应模型 🍟 The Adaptive Model
- 2. 构建自适应接口 🍟 Building an Adaptive Interface
- 适应特征变化 🍟 Adapting to Trait Changes
- 配置故事板以处理不同尺寸类 🍟 Configuring Your Storyboard to Handle Different Size Classes
- 改变子视图控制器的特征 🍟 Changing the Traits of a Child View Controller
- 使Presented视图控制器适应新的风格 🍟 Adapting Presented View Controllers to a New Style
- 实现自适应Popovers的技巧 🍟 Tips for Implementing Adaptive Popovers
- 响应尺寸变化 🍟 Responding to Size Changes
# 特殊名词
English | Chinese | Reason |
---|---|---|
presentation | 呈现 | 默认翻译成演示、显示、表现,似乎都无法体现出是个特殊的名词,因此用一个比较差异化的表述“呈现”,对应反义词为“关闭” |
size class | 尺寸类 | 翻译成大小类就很奇怪,尺寸类合适一点 |
# 参考
← iOS 一. 概述 🍟 Overview →