SlideShare a Scribd company logo
1 of 23
Download to read offline
Building static libraries
for iOS with
kamil.burczyk@sigmapoint.pl
• What is CocoaPods?
• Local CocoaPods dependencies.
• Building a distribution library.
• One library - 5 different architectures.
• Avoiding collisions in other projects.
• Final thoughts.
Roadmap:
CocoaPods is the dependency manager for
Objective-C projects. It has thousands of
libraries and can help you scale your projects
elegantly. [http://cocoapods.org]
Podfile:
pod 'CocoaLumberjack', '~> 1.7.0'
pod 'AFNetworking', '~> 1.3.3'
pod 'UIView+AutoLayout', '~> 1.1.0'
pod 'MagicalRecord', '~> 2.2'
pod 'Reachability', '~> 3.1.1'
pod 'UIAlertView-Blocks', '~> 0.0.1'
Terminal:
$ pod install
Semantic versioning:
!
• Major.Minor.Patch -> 2.0.1
• Major - incompatible API changes
• Minor - added features but backward compatible
• Patch - backward compatible bug fixes
int add(int a, int b) { return a-b; } // 1.0.0
double add(int a) { return 3.14+a; }
int add(int a, int b, int c=0) { return a+b+c; }
int add(int a, int b) { return a+b; } // x.y.z
CocoaPods project structure
Podspec file
Pod::Spec.new do |s|
s.name = "NetworkLib"
s.version = “1.0.0”
s.platform = :ios, '7.0'
s.source_files = 'NetworkLib', 'NetworkLib/**/*.{h,m}'
s.public_header_files = 'NetworkLib/**/*.h'
s.resources = "NetworkLib/*.png"
s.framework = 'SystemConfiguration'
s.requires_arc = true
s.dependency 'AFNetworking'
end
Local CocoaPods dependency
$ pod 'NetworkLib', :path => '../NetworkLib'
git fork CocoaPods dependency
$ pod 'WebViewJavascriptBridge', :git =>
‘https://github.com/burczyk/WebViewJavascriptBridge/',
:commit => '5183c4c'
Demo #1
Building distribution library
xcodebuild
-workspace NetworkLib.xcworkspace
-scheme NetworkLib
-sdk iphonesimulator
-configuration Debug
lipo
-create lib1.a lib2.a
-output libMultipleArch.a
Aggregate Lib script
Build all supported architectures
$ lipo —info libNetworkingLib-debug-0.1.a
!
!
Architectures in the fat file:
libNetworkLib-debug-0.1.a are:
armv7 armv7s i386 x86_64 arm64
Copy files phase & results
Demo #2
Symbol collisions
What happens if user adds AFNetworking to
his app?
Symbols investigation
$ nm libNetworkLib-debug-0.1.a | grep AFN
!
!
000000000000bea0 s -[UIWebView(_AFNetworking)
af_HTTPRequestOperation].eh
!
0000000000000030 t -[UIWebView(_AFNetworking)
af_setHTTPRequestOperation:]
!
000000000000bec8 s -[UIWebView(_AFNetworking)
af_setHTTPRequestOperation:].eh
!
0000000000000190 t ___44-[UIWebView(AFNetworking)
requestSerializer]_block_invoke
!
000000000000bf18 s ___44-[UIWebView(AFNetworking)
requestSerializer]_block_invoke.eh
Symbol collisions solutions
• Pretend they don’t exist ;)
• Write in docs which dependencies are required
• Export all dependencies’ headers
• Build library with prefixed symbols
Exporting all symbols
http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/
nm $CODESIGNING_FOLDER_PATH -j | sort | uniq |
grep "_OBJC_CLASS_$_" | grep -v "$_NS" | sed …
//NamespacedDependencies.h:
!
#ifndef AFHTTPSessionManager
#define AFHTTPSessionManager
__NS_SYMBOL(AFHTTPSessionManager)
#endif
AFHTTPSessionManager —> SIGMA_AFHTTPSessionManager
Configuring Pods & lib to use prefixed symbols
Symbols re-investigation
$ nm libNetworkLib-debug-0.1.a | grep SIGMA
!
!
000000000000b720 s l_OBJC_
$_CATEGORY_SIGMA_AFURLConnectionOperation_$__UIProgressView
!
000000000000b6d8 s l_OBJC_
$_PROP_LIST_SIGMA_AFURLConnectionOperation_
$__UIProgressView
!
U _OBJC_CLASS_$_SIGMA_AFHTTPRequestOperation
!
U _OBJC_CLASS_$_SIGMA_AFHTTPRequestSerializer
!
U _OBJC_CLASS_$_SIGMA_AFHTTPResponseSerializer
Demo #3
• Easy development
• Clean git repo
• Easy switching from local podspec to static
library
• Shell & classic build script sometimes
necessary
• Only one step to put your lib to global repo
Summary
Contact:
	 kamil.burczyk@sigmapoint.pl	 	 	 @KamilBurczyk
Thank you!
Links:
http://cocoapods.org/
http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/
http://blog.sigmapoint.pl/

More Related Content

What's hot

.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 .Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 Tikal Knowledge
 
Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014Robert Reiz
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationDevelopment Seed
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...All Things Open
 
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...Codemotion
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsMichael Lihs
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Codemotion
 
Brujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalabilityBrujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalabilityDamien Coraboeuf
 
DockerCon SF 2015: Scaling New Services
DockerCon SF 2015: Scaling New ServicesDockerCon SF 2015: Scaling New Services
DockerCon SF 2015: Scaling New ServicesDocker, Inc.
 
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and ComposeDockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and ComposeDocker, Inc.
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Gareth Bowles
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers Rafael Benevides
 

What's hot (20)

Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 .Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
 
Jenkins Reviewbot
Jenkins ReviewbotJenkins Reviewbot
Jenkins Reviewbot
 
Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
 
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
 
Brujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalabilityBrujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalability
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
DockerCon SF 2015: Scaling New Services
DockerCon SF 2015: Scaling New ServicesDockerCon SF 2015: Scaling New Services
DockerCon SF 2015: Scaling New Services
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and ComposeDockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers
 

Similar to Building static libraries for iOS with CocoaPods

Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingUpkar Lidder
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed CodeMicro Focus
 
NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM Micro Focus
 
COBOL deployment to .NET or JVM
COBOL deployment to .NET or JVMCOBOL deployment to .NET or JVM
COBOL deployment to .NET or JVMMicro Focus
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKsrelayr
 
COBOL deployment to .Net or JVM - Developer Day
COBOL deployment to .Net or JVM - Developer DayCOBOL deployment to .Net or JVM - Developer Day
COBOL deployment to .Net or JVM - Developer DayMicro Focus
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deploymentThilo Utke
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonIvan Ma
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09Michael Neale
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaRichard Gee
 
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM BluemixDeploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM BluemixArthur De Magalhaes
 
Flexible delivery options
Flexible delivery options Flexible delivery options
Flexible delivery options Micro Focus
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyEugene Zharkov
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2Vincent Mercier
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhiskAlex Glikson
 
Develop - Race to the Finish! Accelerate Your Skills
Develop - Race to the Finish! Accelerate Your SkillsDevelop - Race to the Finish! Accelerate Your Skills
Develop - Race to the Finish! Accelerate Your SkillsLaurenWendler
 

Similar to Building static libraries for iOS with CocoaPods (20)

Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed Code
 
NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM
 
COBOL deployment to .NET or JVM
COBOL deployment to .NET or JVMCOBOL deployment to .NET or JVM
COBOL deployment to .NET or JVM
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKs
 
COBOL deployment to .Net or JVM - Developer Day
COBOL deployment to .Net or JVM - Developer DayCOBOL deployment to .Net or JVM - Developer Day
COBOL deployment to .Net or JVM - Developer Day
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with Kafka
 
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM BluemixDeploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
 
Flexible delivery options
Flexible delivery options Flexible delivery options
Flexible delivery options
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs Manually
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Develop - Race to the Finish! Accelerate Your Skills
Develop - Race to the Finish! Accelerate Your SkillsDevelop - Race to the Finish! Accelerate Your Skills
Develop - Race to the Finish! Accelerate Your Skills
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Building static libraries for iOS with CocoaPods

  • 1. Building static libraries for iOS with kamil.burczyk@sigmapoint.pl
  • 2. • What is CocoaPods? • Local CocoaPods dependencies. • Building a distribution library. • One library - 5 different architectures. • Avoiding collisions in other projects. • Final thoughts. Roadmap:
  • 3. CocoaPods is the dependency manager for Objective-C projects. It has thousands of libraries and can help you scale your projects elegantly. [http://cocoapods.org]
  • 4. Podfile: pod 'CocoaLumberjack', '~> 1.7.0' pod 'AFNetworking', '~> 1.3.3' pod 'UIView+AutoLayout', '~> 1.1.0' pod 'MagicalRecord', '~> 2.2' pod 'Reachability', '~> 3.1.1' pod 'UIAlertView-Blocks', '~> 0.0.1' Terminal: $ pod install
  • 5. Semantic versioning: ! • Major.Minor.Patch -> 2.0.1 • Major - incompatible API changes • Minor - added features but backward compatible • Patch - backward compatible bug fixes int add(int a, int b) { return a-b; } // 1.0.0 double add(int a) { return 3.14+a; } int add(int a, int b, int c=0) { return a+b+c; } int add(int a, int b) { return a+b; } // x.y.z
  • 7. Podspec file Pod::Spec.new do |s| s.name = "NetworkLib" s.version = “1.0.0” s.platform = :ios, '7.0' s.source_files = 'NetworkLib', 'NetworkLib/**/*.{h,m}' s.public_header_files = 'NetworkLib/**/*.h' s.resources = "NetworkLib/*.png" s.framework = 'SystemConfiguration' s.requires_arc = true s.dependency 'AFNetworking' end
  • 8. Local CocoaPods dependency $ pod 'NetworkLib', :path => '../NetworkLib' git fork CocoaPods dependency $ pod 'WebViewJavascriptBridge', :git => ‘https://github.com/burczyk/WebViewJavascriptBridge/', :commit => '5183c4c'
  • 10. Building distribution library xcodebuild -workspace NetworkLib.xcworkspace -scheme NetworkLib -sdk iphonesimulator -configuration Debug lipo -create lib1.a lib2.a -output libMultipleArch.a
  • 12. Build all supported architectures $ lipo —info libNetworkingLib-debug-0.1.a ! ! Architectures in the fat file: libNetworkLib-debug-0.1.a are: armv7 armv7s i386 x86_64 arm64
  • 13. Copy files phase & results
  • 15. Symbol collisions What happens if user adds AFNetworking to his app?
  • 16. Symbols investigation $ nm libNetworkLib-debug-0.1.a | grep AFN ! ! 000000000000bea0 s -[UIWebView(_AFNetworking) af_HTTPRequestOperation].eh ! 0000000000000030 t -[UIWebView(_AFNetworking) af_setHTTPRequestOperation:] ! 000000000000bec8 s -[UIWebView(_AFNetworking) af_setHTTPRequestOperation:].eh ! 0000000000000190 t ___44-[UIWebView(AFNetworking) requestSerializer]_block_invoke ! 000000000000bf18 s ___44-[UIWebView(AFNetworking) requestSerializer]_block_invoke.eh
  • 17. Symbol collisions solutions • Pretend they don’t exist ;) • Write in docs which dependencies are required • Export all dependencies’ headers • Build library with prefixed symbols
  • 18. Exporting all symbols http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/ nm $CODESIGNING_FOLDER_PATH -j | sort | uniq | grep "_OBJC_CLASS_$_" | grep -v "$_NS" | sed … //NamespacedDependencies.h: ! #ifndef AFHTTPSessionManager #define AFHTTPSessionManager __NS_SYMBOL(AFHTTPSessionManager) #endif AFHTTPSessionManager —> SIGMA_AFHTTPSessionManager
  • 19. Configuring Pods & lib to use prefixed symbols
  • 20. Symbols re-investigation $ nm libNetworkLib-debug-0.1.a | grep SIGMA ! ! 000000000000b720 s l_OBJC_ $_CATEGORY_SIGMA_AFURLConnectionOperation_$__UIProgressView ! 000000000000b6d8 s l_OBJC_ $_PROP_LIST_SIGMA_AFURLConnectionOperation_ $__UIProgressView ! U _OBJC_CLASS_$_SIGMA_AFHTTPRequestOperation ! U _OBJC_CLASS_$_SIGMA_AFHTTPRequestSerializer ! U _OBJC_CLASS_$_SIGMA_AFHTTPResponseSerializer
  • 22. • Easy development • Clean git repo • Easy switching from local podspec to static library • Shell & classic build script sometimes necessary • Only one step to put your lib to global repo Summary
  • 23. Contact: kamil.burczyk@sigmapoint.pl @KamilBurczyk Thank you! Links: http://cocoapods.org/ http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/ http://blog.sigmapoint.pl/