SlideShare a Scribd company logo
ABANDONNER ALAMOFIRE
(OU COMMENT ALAMOFIRE NOUS A LAISSÉ TOMBER)
def shared_pods
pod 'Alamofire', '~> 3.3.0'
pod 'Appboy-iOS-SDK', '2.21.0'
pod 'Branch', '0.11.16'
pod 'CLImageEditor', '0.1.4'
pod 'CMPopTipView', '2.2.0'
pod 'Crashlytics', '~> 3.8.2'
pod 'CRToast', '0.0.9'
pod 'DraggableCollectionView', '0.1'
pod 'DZNEmptyDataSet', '1.7.3'
pod 'DZNSegmentedControl', '1.3.2'
pod 'Fabric', '~> 1.6.9'
pod 'FBSDKCoreKit', '4.15.1'
pod 'FBSDKLoginKit', '4.15.1'
pod 'FBSDKShareKit', '4.15.1'
pod 'InstagramKit', '3.7'
pod ‘StreemMapper'
pod 'RealmSwift', ' ~> 2.0.0'
pod 'SDWebImage/WebP', '3.8.1'
pod 'SimpleAuth/Meetup', '0.3.2'
pod 'SnapKit', '~> 0.22.0'
pod 'Starscream', '1.1.3'
pod 'SVProgressHUD', '1.1.3'
pod 'SVWebViewController', :git => 'https://github.com/TransitApp/SVW
end
DÉPENDENCES COCOAPODS
PROBLÈMES DES LIBRAIRIES EXTERNES
▸ Code non maitrisé
▸ Bugs potentiels à chaque mise à jour
▸ Potentiel abandon
PROBLÈMES AVEC ALAMOFIRE
▸ Complexe à appréhender
▸ Difficile à forker
▸ Ne fournit pas d’architecture
▸ Besoin d’autres librairies (JSON, Rx,…)
REQUETE HTTP ALAMOFIRE
Alamofire.request("https://api.deezer.com/track/123")
.responseJSON { (response:DataResponse<Any>) in
//Manage JSON response
}
PROBLÈMES AVEC ALAMOFIRE
APP
NETWORK LAYER
ALAMOFIRE
INTERNET
Adapted from Moya
PROBLÈMES RENCONTRÉS CHEZ HER
▸ Changement du header User-Agent
▸ Abandon d’iOS8
3h de perdues
?
PLUSIEURS SOLUTIONS
▸ Abandonner iOS8
▸ Forker Alamofire
▸ Rester sur Swift 2 et Xcode 7
▸ Utiliser une autre librairie
▸ Réécrire un nouveau module
NIKKA - IDÉES
▸ Répondre à 90% des besoins utilisateurs
▸ Pouvoir adapter le noyaux à ses besoins
▸ Pouvoir gérer différentes APIs
▸ Fournir une structure de base
▸ Pouvoir ajouter des extensions
NIKKA - IMPLÉMENTATION
class DeezerProvider:HTTPProvider {
let baseURL = URL(string:"https://api.deezer.com")!
let additionalHeaders = ["access_token":"eyJh..."]
}
Provider
class DeezerProvider:HTTPProvider {
let baseURL = URL(string:"https://api.deezer.com")!
}
class DeezerProvider:HTTPProvider {
let baseURL = URL(string:"https://api.deezer.com")!
let additionalHeaders = ["access_token":"eyJh..."]
func validate(response: HTTPURLResponse, data: Data,
error: Error?) -> NikkaError? {
}
}
NIKKA - IMPLÉMENTATION
extension Route{
static let me = Route(path:"/me")
static let infos = Route(path:"/infos")
static let track = {(id:Int64) in Route(path:"/track/(id)")}
static let ratePlaylist = {(id:Int,rating:Int) in
Route(path:"/playlist/(id)",
method:.post,
params:["note":rating])
}
}
Route
NIKKA - IMPLÉMENTATION
DeezerProvider().request(.track(12345678)).response{
(response:Response<Any>?) in
}
Making a request
NIKKA - EXTENSIONS
JSON
DeezerProvider().request(.track(12345678)).responseObject{
(Response<Track>) in
}
Librairies supportées :
• Gloss
• ModelMapper
• ObjectMapper
• StreemMapper
• Unbox
NIKKA - EXTENSIONS
Futures
Rx
let track:Future<Track> =
DeezerProvider().request(.track(12345678)).responseObject()
let track:Observable<Track> =
DeezerProvider().request(.track(12345678)).responseObject()
SOURCES
Feel free to reach out at
emilien@weareher.com
github.com/JustaLab/Nikka
medium.com/@streem

More Related Content

PDF
BitTorrent on iOS
PDF
Vagrant for real (codemotion rome 2016)
PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
PDF
Web Applications with Eclipse RT and Docker in the Cloud
PDF
Vagrant for real codemotion (moar tips! ;-))
PDF
GlassFish Embedded API
PDF
Iniciando com Docker
PPTX
Setup docker on existing application
BitTorrent on iOS
Vagrant for real (codemotion rome 2016)
Multi-provider Vagrant and Chef: AWS, VMware, and more
Web Applications with Eclipse RT and Docker in the Cloud
Vagrant for real codemotion (moar tips! ;-))
GlassFish Embedded API
Iniciando com Docker
Setup docker on existing application

What's hot (20)

ODP
It Works On My Machine: Vagrant for Software Development
PDF
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
PDF
CloudKit as a backend
PPTX
Vagrant to-aws-flow
PDF
Dockerize node.js application
PDF
Scale your Magento app with Elastic Beanstalk
PDF
Cocoa pods
PPTX
IaC and Immutable Infrastructure with Terraform, Сергей Марченко
PPTX
Pluralsight Webinar: Simplify Your Project Builds with Docker
PPTX
TechUG - Kubernetes 101 - May 2020
PDF
Introduction to Vagrant
PDF
Docker deploy
PDF
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PDF
Puppet and Vagrant in development
PDF
МИХАЙЛО ЗЕНІН «Dockerizing environment for mobile test automation. Scaling fr...
PDF
Minicurso de Vagrant
PDF
App development with quasar (pdf)
PPTX
PHP development with Docker
PDF
Vagrant + Docker provider [+Puppet]
PPTX
Vagrant-Overview
It Works On My Machine: Vagrant for Software Development
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
CloudKit as a backend
Vagrant to-aws-flow
Dockerize node.js application
Scale your Magento app with Elastic Beanstalk
Cocoa pods
IaC and Immutable Infrastructure with Terraform, Сергей Марченко
Pluralsight Webinar: Simplify Your Project Builds with Docker
TechUG - Kubernetes 101 - May 2020
Introduction to Vagrant
Docker deploy
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
Puppet and Vagrant in development
МИХАЙЛО ЗЕНІН «Dockerizing environment for mobile test automation. Scaling fr...
Minicurso de Vagrant
App development with quasar (pdf)
PHP development with Docker
Vagrant + Docker provider [+Puppet]
Vagrant-Overview
Ad

Viewers also liked (20)

PDF
Handle the error
PDF
Make Acccessibility Great Again
PDF
Project Entourage
PDF
Comment faire de HLS votre solution vidéo préférée ?
PDF
Advanced functional programing in Swift
PDF
Quoi de neuf dans iOS 10.3
PDF
Présentation de HomeKit
PPTX
La sécurité sur iOS par Arnaud de Bock
PDF
L'intégration continue avec Bitrise
PDF
IoT Best practices
PDF
How to communicate with Smart things?
PDF
Programme MFI retour d'expérience
PDF
CONTINUOUS DELIVERY WITH FASTLANE
PDF
What's new in iOS9
PDF
SwiftyGPIO
PDF
Monads in Swift
PDF
Tout savoir pour devenir Freelance
PDF
Super combinators
PDF
Safari app extensions cleared up by Sanaa Squalli
PDF
Introduction to WebRTC on iOS
Handle the error
Make Acccessibility Great Again
Project Entourage
Comment faire de HLS votre solution vidéo préférée ?
Advanced functional programing in Swift
Quoi de neuf dans iOS 10.3
Présentation de HomeKit
La sécurité sur iOS par Arnaud de Bock
L'intégration continue avec Bitrise
IoT Best practices
How to communicate with Smart things?
Programme MFI retour d'expérience
CONTINUOUS DELIVERY WITH FASTLANE
What's new in iOS9
SwiftyGPIO
Monads in Swift
Tout savoir pour devenir Freelance
Super combinators
Safari app extensions cleared up by Sanaa Squalli
Introduction to WebRTC on iOS
Ad

More from CocoaHeads France (14)

PDF
Mutation testing for a safer Future
PDF
iOS App Group for Debugging
PDF
Asynchronous swift
PDF
Visual accessibility in iOS11
PDF
My script - One year of CocoaHeads
PDF
Ui testing dealing with push notifications
PDF
Design like a developer
PDF
Build a lego app with CocoaPods
PDF
Let's migrate to Swift 3.0
PDF
Découvrir dtrace en ligne de commande.
PDF
Un retour d'expérience sur Apple Pay
PDF
MVC-RS par Grégoire Lhotelier
PDF
Firebase par nicolas lehovetzki
PDF
J'ai fait une app native en React Native
Mutation testing for a safer Future
iOS App Group for Debugging
Asynchronous swift
Visual accessibility in iOS11
My script - One year of CocoaHeads
Ui testing dealing with push notifications
Design like a developer
Build a lego app with CocoaPods
Let's migrate to Swift 3.0
Découvrir dtrace en ligne de commande.
Un retour d'expérience sur Apple Pay
MVC-RS par Grégoire Lhotelier
Firebase par nicolas lehovetzki
J'ai fait une app native en React Native

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
System and Network Administraation Chapter 3
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Nekopoi APK 2025 free lastest update
PPTX
Transform Your Business with a Software ERP System
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Online Work Permit System for Fast Permit Processing
Odoo POS Development Services by CandidRoot Solutions
System and Network Administraation Chapter 3
How to Migrate SBCGlobal Email to Yahoo Easily
Design an Analysis of Algorithms I-SECS-1021-03
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Nekopoi APK 2025 free lastest update
Transform Your Business with a Software ERP System
Navsoft: AI-Powered Business Solutions & Custom Software Development
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
CHAPTER 2 - PM Management and IT Context
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo Companies in India – Driving Business Transformation.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Online Work Permit System for Fast Permit Processing

Alamofire

  • 1. ABANDONNER ALAMOFIRE (OU COMMENT ALAMOFIRE NOUS A LAISSÉ TOMBER)
  • 2. def shared_pods pod 'Alamofire', '~> 3.3.0' pod 'Appboy-iOS-SDK', '2.21.0' pod 'Branch', '0.11.16' pod 'CLImageEditor', '0.1.4' pod 'CMPopTipView', '2.2.0' pod 'Crashlytics', '~> 3.8.2' pod 'CRToast', '0.0.9' pod 'DraggableCollectionView', '0.1' pod 'DZNEmptyDataSet', '1.7.3' pod 'DZNSegmentedControl', '1.3.2' pod 'Fabric', '~> 1.6.9' pod 'FBSDKCoreKit', '4.15.1' pod 'FBSDKLoginKit', '4.15.1' pod 'FBSDKShareKit', '4.15.1' pod 'InstagramKit', '3.7' pod ‘StreemMapper' pod 'RealmSwift', ' ~> 2.0.0' pod 'SDWebImage/WebP', '3.8.1' pod 'SimpleAuth/Meetup', '0.3.2' pod 'SnapKit', '~> 0.22.0' pod 'Starscream', '1.1.3' pod 'SVProgressHUD', '1.1.3' pod 'SVWebViewController', :git => 'https://github.com/TransitApp/SVW end DÉPENDENCES COCOAPODS
  • 3. PROBLÈMES DES LIBRAIRIES EXTERNES ▸ Code non maitrisé ▸ Bugs potentiels à chaque mise à jour ▸ Potentiel abandon
  • 4. PROBLÈMES AVEC ALAMOFIRE ▸ Complexe à appréhender ▸ Difficile à forker ▸ Ne fournit pas d’architecture ▸ Besoin d’autres librairies (JSON, Rx,…)
  • 6. PROBLÈMES AVEC ALAMOFIRE APP NETWORK LAYER ALAMOFIRE INTERNET Adapted from Moya
  • 7. PROBLÈMES RENCONTRÉS CHEZ HER ▸ Changement du header User-Agent ▸ Abandon d’iOS8 3h de perdues ?
  • 8. PLUSIEURS SOLUTIONS ▸ Abandonner iOS8 ▸ Forker Alamofire ▸ Rester sur Swift 2 et Xcode 7 ▸ Utiliser une autre librairie ▸ Réécrire un nouveau module
  • 9. NIKKA - IDÉES ▸ Répondre à 90% des besoins utilisateurs ▸ Pouvoir adapter le noyaux à ses besoins ▸ Pouvoir gérer différentes APIs ▸ Fournir une structure de base ▸ Pouvoir ajouter des extensions
  • 10. NIKKA - IMPLÉMENTATION class DeezerProvider:HTTPProvider { let baseURL = URL(string:"https://api.deezer.com")! let additionalHeaders = ["access_token":"eyJh..."] } Provider class DeezerProvider:HTTPProvider { let baseURL = URL(string:"https://api.deezer.com")! } class DeezerProvider:HTTPProvider { let baseURL = URL(string:"https://api.deezer.com")! let additionalHeaders = ["access_token":"eyJh..."] func validate(response: HTTPURLResponse, data: Data, error: Error?) -> NikkaError? { } }
  • 11. NIKKA - IMPLÉMENTATION extension Route{ static let me = Route(path:"/me") static let infos = Route(path:"/infos") static let track = {(id:Int64) in Route(path:"/track/(id)")} static let ratePlaylist = {(id:Int,rating:Int) in Route(path:"/playlist/(id)", method:.post, params:["note":rating]) } } Route
  • 13. NIKKA - EXTENSIONS JSON DeezerProvider().request(.track(12345678)).responseObject{ (Response<Track>) in } Librairies supportées : • Gloss • ModelMapper • ObjectMapper • StreemMapper • Unbox
  • 14. NIKKA - EXTENSIONS Futures Rx let track:Future<Track> = DeezerProvider().request(.track(12345678)).responseObject() let track:Observable<Track> = DeezerProvider().request(.track(12345678)).responseObject()
  • 15. SOURCES Feel free to reach out at emilien@weareher.com github.com/JustaLab/Nikka medium.com/@streem