SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Dependency
Management
Cocoapods and the 

most common used library in Swift
Objective
• We are going to re-create our Weather application
using the most popular library that is widely used
by iOS developer.
• We will see the difference in term of performance
between the app created during Mini Project and
app created during Library.
Cocoapods
• Cocoapods is iOS Dependency Management tool.
• Dependency Management tools help to manage
your library , you don’t need to worry about the
dependency and versioning.
• Example of dependency management tool in other
language: Composer and Gradle.
Installing Cocoapods
• Update Ruby (Ruby is pre-installed for MAC 10.7
and above) : sudo gem update --system
• Download CocoaPods using gem: sudo gem install
cocoapods
• Install Cocoapods: pod setup
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
Latest installation code in El
Capitan
Install Library using Pod
• Go to the path of our Project from terminal
• Create our Podfile using this command:
-pod init
• Open Podfile with Xcode using following
command:
• open -a Xcode Podfile
• Add the library needed between ‘do’ and ‘end’
• Go to your project directory and download
the library : pod install
Library repository
• We navigate to cocoapods.org or cocoacontrols.com to get the Library that can be
integrated into our app.
• We are going to add the following Library into the
• Alamofire
• SwiftyJson
• Kingfisher
• SCLAlertView
• Once the app is installed we are going to work with the workspace of the project.
Alamofire
• Alamofire is the most popular networking library for
Networking using Swift (AFNetworking for Objective
C)
• AFNetworking is built on top of Foundation URL
loading system.
• Refer to documentation for more info.
AFNetworking Sample Code
Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: (JSON)")
}
}
Alamofire.request(.POST, "https://httpbin.org/get", parameters: ["foo": "bar"])
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: (JSON)")
}
}
AFNetworking POST request
AFNetworking GET request
SwiftyJSON
• SwiftyJSON is one of the most helpful library to
facilitate the parsing of JSON.
• Due to Swift safe-type and optional binding
principal, we need to verify the type and nullity
when retrieving the JSON.
• SwiftyJSON will help us reduce the complexity of
doing all that.
Example
if let topApps = parsedObject as? NSDictionary {
if let feed = topApps["feed"] as? NSDictionary {
if let apps = feed["entry"] as? NSArray {
if let firstApp = apps[0] as? NSDictionary {
if let imname = firstApp["im:name"] as? NSDictionary {
if let appName = imname["label"] as? NSString {
//3
println("Optional Binding: (appName)")
}
}
}
}
}
if let appName = json["feed"]["entry"][0]["im:name"]["label"].string {
println("SwiftyJSON: (appName)")
}
This code in Swift:
Can be simplified to this:
MBProgressHUD
• MBProgressHUD is an iOS
library that displays a translucent
HUD with an indicator.
• We use it to inform user that a
background thread is being
executed.
• MBProgressHUD is code written
in Objective C. Cocoapods help
us to bridge the code from
Objective C to Swift.
MBProgressHUD Sample
Code
MBProgressHUD.showHUDAddedTo(self.view, animated: true)
MBProgressHUD.hideHUDForView(self.view, animated: true)
MBProgressHUD show a HUD.
MBProgressHUD hide a HUD.
Kingfisher
• Kingfisher is a lightweight and pure Swift
implemented library for downloading and caching
images from the web
• It is a UIImageView category. New method will be
added to UIImageView and you can call the
methods to load image from URL
import Kingfisher
imageView.kf_setImageWithURL(NSURL(string: "http://your_image_url.png")!)
SCLAlertView
• SCLAlertView is one of
the library that can be
found from
CocoaControls.
• You can create a nicer
UIAlertView for your
application.
SCLAlertView().showWarning("Hello
Warning", subTitle: "This is a more
descriptive warning text.") // Warning
SCLAlertView().showInfo("Hello Info",
subTitle: "This is a more descriptive info
text.") // Info

Contenu connexe

Tendances

Learning Elixir as a Rubyist
Learning Elixir as a RubyistLearning Elixir as a Rubyist
Learning Elixir as a RubyistAlex Kira
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAmazon Web Services
 
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv Amazon Web Services
 
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgPHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgQuentin Adam
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)Abel Muíño
 
Spark Streaming Info
Spark Streaming InfoSpark Streaming Info
Spark Streaming InfoDoug Chang
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon Web Services
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Mohan Arumugam
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL databaseRubyc Slides
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenchesYan Cui
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the thingsJohn Cleary
 
Generic Parse Server
Generic Parse ServerGeneric Parse Server
Generic Parse Serverdavidolesch
 
Terraform day 3
Terraform day 3Terraform day 3
Terraform day 3Kalkey
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonYurii Vasylenko
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...Amazon Web Services
 

Tendances (20)

Learning Elixir as a Rubyist
Learning Elixir as a RubyistLearning Elixir as a Rubyist
Learning Elixir as a Rubyist
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
 
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
 
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgPHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)
 
Spark Streaming Info
Spark Streaming InfoSpark Streaming Info
Spark Streaming Info
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL database
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Capistrano 3 Deployment
Capistrano 3 DeploymentCapistrano 3 Deployment
Capistrano 3 Deployment
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the things
 
Generic Parse Server
Generic Parse ServerGeneric Parse Server
Generic Parse Server
 
Terraform day 3
Terraform day 3Terraform day 3
Terraform day 3
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
 
Encrypting/Decrypting mule
Encrypting/Decrypting  muleEncrypting/Decrypting  mule
Encrypting/Decrypting mule
 

En vedette

The Nuts And Bolts: Getting Started in Social Media
The Nuts And Bolts:  Getting Started in Social MediaThe Nuts And Bolts:  Getting Started in Social Media
The Nuts And Bolts: Getting Started in Social MediaStacey Harmon
 
Indicadores de desempeño de tecnología y emprendimiento
Indicadores de desempeño de tecnología y emprendimientoIndicadores de desempeño de tecnología y emprendimiento
Indicadores de desempeño de tecnología y emprendimientoSantiago Bedoya Palacio
 
25. cuestionario de las letras rojas. lamento por jerusalén 2a. parte.
25.  cuestionario de las letras rojas. lamento por jerusalén 2a. parte.25.  cuestionario de las letras rojas. lamento por jerusalén 2a. parte.
25. cuestionario de las letras rojas. lamento por jerusalén 2a. parte.Comparte la Biblia
 
Alice and Bob are Eff'd
Alice and Bob are Eff'dAlice and Bob are Eff'd
Alice and Bob are Eff'dJason Ross
 
Athlete NCAA Recruiting Registration (Section 3 of 11)
Athlete NCAA Recruiting Registration (Section 3 of 11)Athlete NCAA Recruiting Registration (Section 3 of 11)
Athlete NCAA Recruiting Registration (Section 3 of 11)athletebuilder
 
Reforming the Industrial Disputes Act
Reforming the Industrial Disputes ActReforming the Industrial Disputes Act
Reforming the Industrial Disputes ActSamarth Chaddha
 
Golden medias - a strategic BRAND management Firm
Golden medias - a strategic BRAND management FirmGolden medias - a strategic BRAND management Firm
Golden medias - a strategic BRAND management FirmGolden Medias
 
Allanamiento demanda
Allanamiento demandaAllanamiento demanda
Allanamiento demandaJòse Rangel
 
Radio Journalism & Production - RADIO FORMATS
Radio Journalism & Production - RADIO FORMATS Radio Journalism & Production - RADIO FORMATS
Radio Journalism & Production - RADIO FORMATS Trinity Dwarka
 

En vedette (11)

The Nuts And Bolts: Getting Started in Social Media
The Nuts And Bolts:  Getting Started in Social MediaThe Nuts And Bolts:  Getting Started in Social Media
The Nuts And Bolts: Getting Started in Social Media
 
Indicadores de desempeño de tecnología y emprendimiento
Indicadores de desempeño de tecnología y emprendimientoIndicadores de desempeño de tecnología y emprendimiento
Indicadores de desempeño de tecnología y emprendimiento
 
25. cuestionario de las letras rojas. lamento por jerusalén 2a. parte.
25.  cuestionario de las letras rojas. lamento por jerusalén 2a. parte.25.  cuestionario de las letras rojas. lamento por jerusalén 2a. parte.
25. cuestionario de las letras rojas. lamento por jerusalén 2a. parte.
 
Alice and Bob are Eff'd
Alice and Bob are Eff'dAlice and Bob are Eff'd
Alice and Bob are Eff'd
 
Todo musica
Todo musicaTodo musica
Todo musica
 
The Warmst Photigraphy
The Warmst PhotigraphyThe Warmst Photigraphy
The Warmst Photigraphy
 
Athlete NCAA Recruiting Registration (Section 3 of 11)
Athlete NCAA Recruiting Registration (Section 3 of 11)Athlete NCAA Recruiting Registration (Section 3 of 11)
Athlete NCAA Recruiting Registration (Section 3 of 11)
 
Reforming the Industrial Disputes Act
Reforming the Industrial Disputes ActReforming the Industrial Disputes Act
Reforming the Industrial Disputes Act
 
Golden medias - a strategic BRAND management Firm
Golden medias - a strategic BRAND management FirmGolden medias - a strategic BRAND management Firm
Golden medias - a strategic BRAND management Firm
 
Allanamiento demanda
Allanamiento demandaAllanamiento demanda
Allanamiento demanda
 
Radio Journalism & Production - RADIO FORMATS
Radio Journalism & Production - RADIO FORMATS Radio Journalism & Production - RADIO FORMATS
Radio Journalism & Production - RADIO FORMATS
 

Similaire à Cocoapods and Most common used library in Swift

Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache CordovaIvano Malavolta
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsSadayuki Furuhashi
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sOrtus Solutions, Corp
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...Future Processing
 
Amazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to productionAmazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to productionPaolo latella
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbsAWS Chicago
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architectureRomain Rochegude
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0Eugenio Romano
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 serversMark Myers
 
Running Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic BeanstalkRunning Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic BeanstalkAmazon Web Services
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 

Similaire à Cocoapods and Most common used library in Swift (20)

Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api's
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
 
Amazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to productionAmazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to production
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
 
Play framework
Play frameworkPlay framework
Play framework
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Running Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic BeanstalkRunning Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic Beanstalk
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 

Dernier

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Dernier (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

Cocoapods and Most common used library in Swift

  • 1. Dependency Management Cocoapods and the 
 most common used library in Swift
  • 2. Objective • We are going to re-create our Weather application using the most popular library that is widely used by iOS developer. • We will see the difference in term of performance between the app created during Mini Project and app created during Library.
  • 3. Cocoapods • Cocoapods is iOS Dependency Management tool. • Dependency Management tools help to manage your library , you don’t need to worry about the dependency and versioning. • Example of dependency management tool in other language: Composer and Gradle.
  • 4. Installing Cocoapods • Update Ruby (Ruby is pre-installed for MAC 10.7 and above) : sudo gem update --system • Download CocoaPods using gem: sudo gem install cocoapods • Install Cocoapods: pod setup
  • 5. $ mkdir -p $HOME/Software/ruby $ export GEM_HOME=$HOME/Software/ruby $ gem install cocoapods [...] 1 gem installed $ export PATH=$PATH:$HOME/Software/ruby/bin $ pod --version Latest installation code in El Capitan
  • 6. Install Library using Pod • Go to the path of our Project from terminal • Create our Podfile using this command: -pod init • Open Podfile with Xcode using following command: • open -a Xcode Podfile • Add the library needed between ‘do’ and ‘end’ • Go to your project directory and download the library : pod install
  • 7. Library repository • We navigate to cocoapods.org or cocoacontrols.com to get the Library that can be integrated into our app. • We are going to add the following Library into the • Alamofire • SwiftyJson • Kingfisher • SCLAlertView • Once the app is installed we are going to work with the workspace of the project.
  • 8. Alamofire • Alamofire is the most popular networking library for Networking using Swift (AFNetworking for Objective C) • AFNetworking is built on top of Foundation URL loading system. • Refer to documentation for more info.
  • 9. AFNetworking Sample Code Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) .responseJSON { response in print(response.request) // original URL request print(response.response) // URL response print(response.data) // server data print(response.result) // result of response serialization if let JSON = response.result.value { print("JSON: (JSON)") } } Alamofire.request(.POST, "https://httpbin.org/get", parameters: ["foo": "bar"]) .responseJSON { response in print(response.request) // original URL request print(response.response) // URL response print(response.data) // server data print(response.result) // result of response serialization if let JSON = response.result.value { print("JSON: (JSON)") } } AFNetworking POST request AFNetworking GET request
  • 10. SwiftyJSON • SwiftyJSON is one of the most helpful library to facilitate the parsing of JSON. • Due to Swift safe-type and optional binding principal, we need to verify the type and nullity when retrieving the JSON. • SwiftyJSON will help us reduce the complexity of doing all that.
  • 11. Example if let topApps = parsedObject as? NSDictionary { if let feed = topApps["feed"] as? NSDictionary { if let apps = feed["entry"] as? NSArray { if let firstApp = apps[0] as? NSDictionary { if let imname = firstApp["im:name"] as? NSDictionary { if let appName = imname["label"] as? NSString { //3 println("Optional Binding: (appName)") } } } } } if let appName = json["feed"]["entry"][0]["im:name"]["label"].string { println("SwiftyJSON: (appName)") } This code in Swift: Can be simplified to this:
  • 12. MBProgressHUD • MBProgressHUD is an iOS library that displays a translucent HUD with an indicator. • We use it to inform user that a background thread is being executed. • MBProgressHUD is code written in Objective C. Cocoapods help us to bridge the code from Objective C to Swift.
  • 13. MBProgressHUD Sample Code MBProgressHUD.showHUDAddedTo(self.view, animated: true) MBProgressHUD.hideHUDForView(self.view, animated: true) MBProgressHUD show a HUD. MBProgressHUD hide a HUD.
  • 14. Kingfisher • Kingfisher is a lightweight and pure Swift implemented library for downloading and caching images from the web • It is a UIImageView category. New method will be added to UIImageView and you can call the methods to load image from URL import Kingfisher imageView.kf_setImageWithURL(NSURL(string: "http://your_image_url.png")!)
  • 15. SCLAlertView • SCLAlertView is one of the library that can be found from CocoaControls. • You can create a nicer UIAlertView for your application. SCLAlertView().showWarning("Hello Warning", subTitle: "This is a more descriptive warning text.") // Warning SCLAlertView().showInfo("Hello Info", subTitle: "This is a more descriptive info text.") // Info