refreshing your app in ios 7

17
Refreshing your app in iOS 7 Michael Vitrano @michaelvitrano

Post on 11-Sep-2014

999 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Refreshing Your App in iOS 7

Refreshing your app in iOS 7

Michael Vitrano@michaelvitrano

Page 2: Refreshing Your App in iOS 7

Going iOS 7+

● Impressive adoption rate: ~60% in less than a week

● Older versions of apps are available on iTunes

● Users expect their apps to be native to the iOS 7 ecosystem

● Awesome new APIs

Page 3: Refreshing Your App in iOS 7

New APIs

● Text Kit

● UIKit Dynamics

● Multitasking

● Custom View Controller Transitions

Page 4: Refreshing Your App in iOS 7

Custom View Controller Transitions

● Pre iOS 7, you could have implemented this functionality yourself

● Required hacks, manually managing the process

● Using the new API, these types of transitions require much less code and effort

Page 5: Refreshing Your App in iOS 7

iOS 7 as an Engineering Refresh

● You’re going to be rethinking and revamping almost every part of your app’s experience

● Given this, an iOS 7 update is the perfect opportunity to rethink your app’s architecture and organization.

Page 6: Refreshing Your App in iOS 7

The Evolution of an App

Page 7: Refreshing Your App in iOS 7

A Modular Approach

Editor

App

Page 8: Refreshing Your App in iOS 7

A Modular Approach (cont.)

EditorPhoto Selectionand Sharing

Content Analytics

Page 9: Refreshing Your App in iOS 7

Thin View Controllers

● One of the biggest problems was bloated View Controllers

● Four Techniques:○ Using modern APIs○ Splitting View Controllers into categories○ Composition over Subclassing○ Data aware views

Page 10: Refreshing Your App in iOS 7

Modern APIs

● Previously, we were supporting iOS 5

● UICollectionView

● AutoLayout

Page 11: Refreshing Your App in iOS 7

Categorizing View Controllers

● View controllers can have many different roles at once

● Group different aspects of the Controller’s functionality into categories

● Reduces the number of lines per file, improves organization and code clarity

Page 12: Refreshing Your App in iOS 7

AFPhotoSourceViewController

PhotoSourcePhotoEditor

StackTransitions CarouselView

Base Class(View Initialization,Interface actions)

Page 13: Refreshing Your App in iOS 7

Composition over Subclassing

● Organize frequently used design patterns into template objects

● Allows for code reuse for slices of common functionality in objects that do not share an inheritance chain

Page 14: Refreshing Your App in iOS 7

Collection View Data Source

● AFCollectionViewDataSource

● Takes an array of data objects and UICollectionViewCell subclass implementing the AFCollectionViewDataSourceView protocol

● Multi-Section versions too!

Page 15: Refreshing Your App in iOS 7

Selection Controller

● Creates a Collection View, initializes the Layout and the Data Source

● Provides a common interface for View Controllers to receive selection events

● Everything is centered around data objects

Page 16: Refreshing Your App in iOS 7

Data Aware Views

● Certain views are designed solely to represent a piece of data, i.e. an Effect pack

● These views should be able to configure themselves to represent a particular data object

● Removes the configuration from the View Controller

Page 17: Refreshing Your App in iOS 7

Results

● Content View Controller Hierarchy○ From 4 layers of subclasses to 2○ Reduced the amount of code by more than

half

● Overall, reduced the code base by over 25%

● Improved compile times and developer productivity