SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Women Who Code
iOS Meetup
2016 AUG 21
While on your journey of introducing a new experience for your amazing app
you hit a decision point.
Do you develop write your own code or do you use something someone has
written?
If you want to DIY, turn to page 57
If you want to use something someone has written, turn to page 154
What this talk IS covering
Dependency Management Options
Pros and Cons of each
My personal bias
What this talk IS NOT
covering
Application Architecture (kind of)
Project Structure (sort of)
System Configuration (just a little)
154
Cocoapods in 5 “easy” steps
$ sudo gem install cocoapods && pod setup —-verbose
$ pod init
$ pod install
$ nano Podfile
1
2
3
4
// sudo because it’s a global install
// gem because it’s written in Ruby
// Run setup… go take a break
// if setup breaks… there’s a fix
// creates a ‘Podfile’ with defaults
// Assumes you already are at the top level of your project
// (personal choice) use linux text editor for initial changes to Podfile
// select your platform
// select the libraries you want to use
// exit from the editor
// install libraries
5 $ open MyApp.xcworkspace // open workspace in XCode. W T H is a workspace?
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'PrettyRandom' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for PrettyRandom
pod 'CocoaLumberjack/Swift'
target 'PrettyRandomTests' do
inherit! :search_paths
# Pods for testing
end
target 'PrettyRandomUITests' do
inherit! :search_paths
# Pods for testing
end
end
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'PrettyRandom' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for PrettyRandom
pod 'CocoaLumberjack/Swift'
target 'PrettyRandomTests' do
inherit! :search_paths
# Pods for testing
end
target 'PrettyRandomUITests' do
inherit! :search_paths
# Pods for testing
end
end
I love homebrew
http://brew.sh
Carthage in 5 “easy”-ish steps
$ brew install carthage
$ nano Cartfile
$ carthage update —-platform iOS
1
2
3
4
// shouldn’t take long
// it’s easier to start a Cartfile from here
// install libraries for the type of app you are building for
// extremely minimalistic
// This is platform dependent
// you must manually link your libraries
// It has to be done through the XCode UI
4?
github "CocoaLumberjack/CocoaLumberjack"
Carthage Step 4 (a) … (c)
macOS
iOS, watchOS, tvOS
• On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop each
framework you want to use from the Carthage/Build folder on disk.
• On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Copy Files Phase”.
• For each framework you’re using, drag and drop its corresponding dSYM file.
• On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and
drop each framework you want to use from the Carthage/Build folder on disk.
• On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”.
Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below
the shell:
• and add the paths to the frameworks you want to use under “Input Files”, e.g.:
/usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/iOS/Box.framework
$(SRCROOT)/Carthage/Build/iOS/Result.framework
$(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework
Swift PM in 5
$ swift package init --type executable
$ swift package generate-xcodeproj
1
2
3
5
// creates a ‘Package.swift’ with defaults
// Assumes you already are at the top level of
your project
// depending on your internets, this could take a while
// add dependencies
// generates PrettyRandom.xcodeproj file
Install Xcode 8.0 (beta)
$ open PrettyRandom.xcodeproj
4
import PackageDescription
let package = Package(
name: "PrettyRandom",
dependencies: [
.Package(url: "https://github.com/thecb4/SwiftyJSON.git", versions: Version(3,0,2)..<Version(3,0,34)),
]
)
$ nano Package.swift
// open Xcode (beta) and realize nothing works because
the library isn’t Swift 3 compatible
Swift PM in 5… Nevermind
$ swift package init --type executable
$ swift package generate-xcodeproj
1
2
3
5
// creates a ‘Package.swift’ with defaults
// Assumes you already are at the top level of
your project
// depending on your internets, this could take a while
// add dependencies
// generates PrettyRandom.xcodeproj file
Install Xcode 8.0 (beta)
$ open PrettyRandom.xcodeproj
4
import PackageDescription
let package = Package(
name: "PrettyRandom",
dependencies: [
.Package(url: "https://github.com/thecb4/SwiftyJSON.git", versions: Version(3,0,2)..<Version(3,0,34)),
]
)
$ nano Package.swift
// open Xcode (beta) and realize nothing works because
the library isn’t Swift 3 compatible
side by side comparison
Written In Ruby Swift Swift
Current Version 1.0.1 0.16.2 swiftpm-18
Control File Podfile Cartfile Package.swift
Repository Cocoapods Trunk git git
Libraries 3000+ 3000+1 ???
Search Index website,
command line
If it’s on github you can
use it1
IBM Catalog
Version support Semantic Semantic Semantic
Target Support Yes What target? On Roadmap
Integration Type Source Source or Binary Source
Platform Support
macOS, iOS, watchOS,
tvOS
macOS, iOS, watchOS,
tvOS
Linux, macOS2, iOS2,
watchOS2, tvOS2
Swift Support 2.2.3 2.2.3 3.0
1. The library has to have a Shared Scheme to work
2. If you are building a library you are fine. Anything with a UI is a lot of work
I love carthage
https://github.com/Carthage/Carthage
Written In Ruby Swift Swift
Current Version 1.0.1 0.16.2 swiftpm-18
Control File Podfile Cartfile Package.swift
Repository Cocoapods Trunk git git
Libraries 3000+ 3000+1 ???
Search Index website,
command line
If it’s on github you can
use it1
IBM Catalog
Version support Semantic Semantic Semantic
Target Support Yes What target? On Roadmap
Integration Type Source Source or Binary Source
Platform Support
macOS, iOS, watchOS,
tvOS
macOS, iOS, watchOS,
tvOS
Linux, macOS2, iOS2,
watchOS2, tvOS2
Swift Support 2.2.3 2.2.3 3.0
1. The library has to have a Shared Scheme to work
2. If you are building a library you are fine. Anything with a UI is a lot of work
Any Questions?
references
These slides… http://goo.gl/oJM5Pf
Homebrew… http://brew.sh
Carthage… https://github.com/Carthage/Carthage
Cocoapods… https://cocoapods.org
Swift Package Manager… https://swift.org/package-manager
Libraries vs. Frameworks… http://www.knowstack.com/framework-vs-library-cocoa-ios/
contact
cavelle@thecb4.io
@_thecb4

Contenu connexe

Tendances

Tendances (20)

LVPHP.org
LVPHP.orgLVPHP.org
LVPHP.org
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
WebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the WebWebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the Web
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous Integration
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:winConsole Apps: php artisan forthe:win
Console Apps: php artisan forthe:win
 
Automate Yo' Self
Automate Yo' SelfAutomate Yo' Self
Automate Yo' Self
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
Perl Continous Integration
Perl Continous IntegrationPerl Continous Integration
Perl Continous Integration
 
用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golang
 
Lesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupLesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment Setup
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
Getting Your Hooks into Cordova
Getting Your Hooks into CordovaGetting Your Hooks into Cordova
Getting Your Hooks into Cordova
 
Getting your Hooks into Cordova
Getting your Hooks into CordovaGetting your Hooks into Cordova
Getting your Hooks into Cordova
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Development
 

En vedette

En vedette (10)

Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10
 
Learn watchOS Programming!
Learn watchOS Programming! Learn watchOS Programming!
Learn watchOS Programming!
 
Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2
 
[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming
 
watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話
 
Transfer data from iPhone to iWatch
Transfer data from iPhone to iWatchTransfer data from iPhone to iWatch
Transfer data from iPhone to iWatch
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016
 
Apple watch course
Apple watch courseApple watch course
Apple watch course
 
D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile Applications
 

Similaire à Dependent things dependency management for apple sw - slideshare

symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 

Similaire à Dependent things dependency management for apple sw - slideshare (20)

State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud Foundry
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Apache Cordova
Apache CordovaApache Cordova
Apache Cordova
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
What is CocoaPods and how to setup?
What is CocoaPods and how to setup?What is CocoaPods and how to setup?
What is CocoaPods and how to setup?
 
Pharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous IntegrationPharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous Integration
 
PHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous Integration
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat Overview
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Composer
ComposerComposer
Composer
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud Foundry
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Dernier (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 

Dependent things dependency management for apple sw - slideshare

  • 1. Women Who Code iOS Meetup 2016 AUG 21
  • 2.
  • 3.
  • 4. While on your journey of introducing a new experience for your amazing app you hit a decision point. Do you develop write your own code or do you use something someone has written? If you want to DIY, turn to page 57 If you want to use something someone has written, turn to page 154
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. What this talk IS covering Dependency Management Options Pros and Cons of each My personal bias
  • 11. What this talk IS NOT covering Application Architecture (kind of) Project Structure (sort of) System Configuration (just a little)
  • 12. 154
  • 13.
  • 14. Cocoapods in 5 “easy” steps $ sudo gem install cocoapods && pod setup —-verbose $ pod init $ pod install $ nano Podfile 1 2 3 4 // sudo because it’s a global install // gem because it’s written in Ruby // Run setup… go take a break // if setup breaks… there’s a fix // creates a ‘Podfile’ with defaults // Assumes you already are at the top level of your project // (personal choice) use linux text editor for initial changes to Podfile // select your platform // select the libraries you want to use // exit from the editor // install libraries 5 $ open MyApp.xcworkspace // open workspace in XCode. W T H is a workspace? # Uncomment this line to define a global platform for your project # platform :ios, '9.0' target 'PrettyRandom' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for PrettyRandom pod 'CocoaLumberjack/Swift' target 'PrettyRandomTests' do inherit! :search_paths # Pods for testing end target 'PrettyRandomUITests' do inherit! :search_paths # Pods for testing end end
  • 15. # Uncomment this line to define a global platform for your project # platform :ios, '9.0' target 'PrettyRandom' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for PrettyRandom pod 'CocoaLumberjack/Swift' target 'PrettyRandomTests' do inherit! :search_paths # Pods for testing end target 'PrettyRandomUITests' do inherit! :search_paths # Pods for testing end end
  • 16.
  • 17.
  • 18.
  • 20.
  • 21. Carthage in 5 “easy”-ish steps $ brew install carthage $ nano Cartfile $ carthage update —-platform iOS 1 2 3 4 // shouldn’t take long // it’s easier to start a Cartfile from here // install libraries for the type of app you are building for // extremely minimalistic // This is platform dependent // you must manually link your libraries // It has to be done through the XCode UI 4? github "CocoaLumberjack/CocoaLumberjack"
  • 22. Carthage Step 4 (a) … (c) macOS iOS, watchOS, tvOS • On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk. • On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Copy Files Phase”. • For each framework you’re using, drag and drop its corresponding dSYM file. • On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk. • On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell: • and add the paths to the frameworks you want to use under “Input Files”, e.g.: /usr/local/bin/carthage copy-frameworks $(SRCROOT)/Carthage/Build/iOS/Box.framework $(SRCROOT)/Carthage/Build/iOS/Result.framework $(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Swift PM in 5 $ swift package init --type executable $ swift package generate-xcodeproj 1 2 3 5 // creates a ‘Package.swift’ with defaults // Assumes you already are at the top level of your project // depending on your internets, this could take a while // add dependencies // generates PrettyRandom.xcodeproj file Install Xcode 8.0 (beta) $ open PrettyRandom.xcodeproj 4 import PackageDescription let package = Package( name: "PrettyRandom", dependencies: [ .Package(url: "https://github.com/thecb4/SwiftyJSON.git", versions: Version(3,0,2)..<Version(3,0,34)), ] ) $ nano Package.swift // open Xcode (beta) and realize nothing works because the library isn’t Swift 3 compatible
  • 28. Swift PM in 5… Nevermind $ swift package init --type executable $ swift package generate-xcodeproj 1 2 3 5 // creates a ‘Package.swift’ with defaults // Assumes you already are at the top level of your project // depending on your internets, this could take a while // add dependencies // generates PrettyRandom.xcodeproj file Install Xcode 8.0 (beta) $ open PrettyRandom.xcodeproj 4 import PackageDescription let package = Package( name: "PrettyRandom", dependencies: [ .Package(url: "https://github.com/thecb4/SwiftyJSON.git", versions: Version(3,0,2)..<Version(3,0,34)), ] ) $ nano Package.swift // open Xcode (beta) and realize nothing works because the library isn’t Swift 3 compatible
  • 29.
  • 30. side by side comparison
  • 31. Written In Ruby Swift Swift Current Version 1.0.1 0.16.2 swiftpm-18 Control File Podfile Cartfile Package.swift Repository Cocoapods Trunk git git Libraries 3000+ 3000+1 ??? Search Index website, command line If it’s on github you can use it1 IBM Catalog Version support Semantic Semantic Semantic Target Support Yes What target? On Roadmap Integration Type Source Source or Binary Source Platform Support macOS, iOS, watchOS, tvOS macOS, iOS, watchOS, tvOS Linux, macOS2, iOS2, watchOS2, tvOS2 Swift Support 2.2.3 2.2.3 3.0 1. The library has to have a Shared Scheme to work 2. If you are building a library you are fine. Anything with a UI is a lot of work
  • 33. Written In Ruby Swift Swift Current Version 1.0.1 0.16.2 swiftpm-18 Control File Podfile Cartfile Package.swift Repository Cocoapods Trunk git git Libraries 3000+ 3000+1 ??? Search Index website, command line If it’s on github you can use it1 IBM Catalog Version support Semantic Semantic Semantic Target Support Yes What target? On Roadmap Integration Type Source Source or Binary Source Platform Support macOS, iOS, watchOS, tvOS macOS, iOS, watchOS, tvOS Linux, macOS2, iOS2, watchOS2, tvOS2 Swift Support 2.2.3 2.2.3 3.0 1. The library has to have a Shared Scheme to work 2. If you are building a library you are fine. Anything with a UI is a lot of work
  • 34.
  • 36. references These slides… http://goo.gl/oJM5Pf Homebrew… http://brew.sh Carthage… https://github.com/Carthage/Carthage Cocoapods… https://cocoapods.org Swift Package Manager… https://swift.org/package-manager Libraries vs. Frameworks… http://www.knowstack.com/framework-vs-library-cocoa-ios/