User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ios-labs-s14:advanced-frameworks [2014/02/24 12:32]
mbarboi created
ios-labs-s14:advanced-frameworks [2014/02/24 12:40]
Line 1: Line 1:
 =====Frameworks===== =====Frameworks=====
 +Frameworks are collections of code written by someone else you can easily include in your project.
 +There are two types: Cocoa frameworks (iOS frameworks) and 3rd-party frameworks (aka vendor frameworks). Anyone can compile their iOS code into a framework and expose it to other developers without passing around their source code. 
 +The act of including a framework into your project is known as **linking** to it (alternatively,​ linking against).
 +The steps are as follows, assuming you are trying to link to the MapKit framework:
 +  -Click the blue project file at the top of the project navigator
 +  -Select "Build Phases"​ on top of the screen
 +  -Click arrow next to "Link Binary With Libraries",​ press plus button
 +  -Search for the framework name, select and press add
 +{{ ios-labs-s14:​7_3.png }}
 +Including third-party frameworks is a little more simple; you can usually just drag them into the frameworks folder.
 +Note that some frameworks, notably those that expose new, custom objects to the project, also require you to import the framework headers. To follow the example above, the import statement is:
 +  #import <​MapKit/​MapKit.h>​
 +  ​
 +and must be placed in any classes that manipulate MapKit classes. Note the chevrons (<>) instead of the usual quotes (""​).
ios-labs-s14/advanced-frameworks.txt ยท Last modified: 2014/02/24 12:40 by mbarboi