This entry is an exmaple to use cocoapods with Swift.
Target library is LLSimpleCamera
I have already written this topic in cocoapods. This posts has how to install and how to setup
Prepare your project
Create swift application and go to your project root.
pod init open -a Xcode Podfile
And open Podfile to edit.
# Uncomment this line to define a global platform for your project platform :ios, '9.0' # Uncomment this line if you're using Swift use_frameworks! target 'CameraSample' do pod 'LLSimpleCamera', '~>4.1' end
Podfile has pod
Next install dependencies.
LLSimpleCamera is installed.
And yourproject.xcworkspace was created.
Next time you want to open project, please open xcworkspace, not xcodeproj.
xcworkspace has all setting for Pods dependencies.
To use Objective-C library from Swift, we need bridge header.
Create yourproject-Bridging-Header.h in any place
#ifndef CameraSample_Bridging_HEADER_h #define CameraSample_Bridging_HEADER_h #import <LLSimpleCamera.h> #endif
Add header search path