This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class UberDeepLink: BaseDeepLink, ConstructDeepLinkProtocol { | |
func constructApp(){ | |
guard let uberProtocol = self.urlProtocol, let dropoffLocation = self.destinationLocation, let pickupLocation = self.originLocation else { | |
return nil | |
} | |
let httpsProtocol = "https://m.uber.com/" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init(originLocation : CLLocationCoordinate2D, destinationLocation:CLLocationCoordinate2D, originAddress: String, destinationAddress: String, urlProtocol: String){ | |
self.originLocation = originLocation | |
self.destinationLocation = destinationLocation | |
self.destinationAddress = dropoffFormattedAddress | |
self.originAddress = originAddress | |
self.urlProtocol = urlProtocol | |
} | |
func deepLink() { | |
if let appURL = finalURL { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import CoreLocation | |
protocol ConstructDeepLinkProtocol{ | |
func constructApp() | |
} | |
class BaseDeepLink: NSObject { | |
var originLocation : CLLocationCoordinate2D? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
excluded: # paths to ignore during linting. Takes precedence over `included`. | |
- Carthage | |
- Pods | |
- Source/ExcludedFolder | |
- Source/ExcludedFile.swift | |
# rules that have both warning and error levels, can set just the warning level | |
# implicitly | |
line_length: 250 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
excluded: # paths to ignore during linting. Takes precedence over `included`. | |
- Carthage | |
- Pods | |
- Source/ExcludedFolder | |
- Source/ExcludedFile.swift | |
# rules that have both warning and error levels, can set just the warning level | |
# implicitly | |
line_length: 250 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BaseApiClient.swift | |
// Melhor Corrida | |
// | |
// Created by Paulo Rosa on 07/08/17. | |
// Copyright © 2017 Paulo Rosa. All rights reserved. | |
// | |
//swiftlint:disable empty_enum_arguments | |
import UIKit | |
import Alamofire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - Paths | |
var hearders: String { | |
if path == "estimates" || path == "users"{ | |
return "103260408667b5727f0bc10dc37240b2d38579051d9924b979ea2e4fe3a31635802b3b4ff8e25d31b39066957a8c3811c9f427e0d8a4c8c0bc58916fc3ea1be6" | |
} | |
return "" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func asURLRequest() throws -> URLRequest { | |
let url: URL | |
if path == "estimates" || path == "users"{ | |
url = try Router.routeResults.asURL() | |
} else { | |
url = try Router.routeGoogle.asURL() | |
} | |
var urlRequest = URLRequest(url: url.appendingPathComponent(path)) | |
urlRequest.httpMethod = method.rawValue | |
if hearders != ""{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func signin(_ data: URLRequestParams, success: @escaping (User) -> Void, failure: @escaping (ApiError) -> Void ){ | |
var data = URLRequestParams() | |
data["usuario"] = "nayanne.moritsuka+tcr6@terras.agr.br" | |
data["senha"] = "1234" | |
// da um break na linha abaixo, e ve se a variavel data ta populada | |
Alamofire.request(Router.login(data: data)) | |
.validate() | |
.responseJSON { response in | |
switch response.result { | |
case .success: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init(fromJSON json: JSON) { | |
// tinha que alterar esse init: | |
let result = json["result"] | |
self.id = result["id"].stringValue | |
self.name = result["nome"].stringValue | |
self.token = result["token"].stringValue | |
self.email = result["usuario"].stringValue | |
self.cpf = result["cpf"].stringValue | |
self.password = result["senha"].stringValue |
OlderNewer