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,…)
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