Skip to content

Instantly share code, notes, and snippets.

View ivangodfather's full-sized avatar
馃崅

Ivan Ruiz ivangodfather

馃崅
View GitHub Profile
class ServiceLocator {
static let instance = ServiceLocator()
func getPresenterForCarList(ui: CarListUI, wireframe: CarWireframe) -> CarListPresenter {
return CarListPresenter(
ui: ui,
useCase: GetCarList(
agent: CarAgent(
repository: CarRepository()
class CarListPresenter {
private let ui: CarListUI
private let useCase: GetCarList
private let wireFrame: CarWireframe
init(ui: CarListUI, useCase: GetCarList,) {
self.ui = ui
self.useCase = useCase
var myVar: Int?
guard (myVar != nil) else {
myVar = 1 //How i can continue here after setting a value?
continue // continue is only allowd inside a loop
}
print(myVar) //i want 1
["lang": en, "action": promotions, "idCustomer": 145, "order": {
addressDelivery = {
address = otra;
addressName = laotra;
availableDelivery = 1;
availableTime = (
"00:01 - 23:59",
"00:01 - 23:59",
"00:01 - 23:59",
"00:01 - 23:59",
class Product: Equatable {
var id: Int?
}
func ==(lhs: Product, rhs: Product) -> Bool {
return lhs.id == rhs.id
}
var myProducts = [//Array with products with some products repetaed ]
<h1>pol铆tica de protecci贸n de datos</h1>
<p><strong>Orange Espagne S.A.U.</strong>, Orange en adelante, ha adoptado una serie de medidas esenciales de una pol铆tica adecuada de protecci贸n de la privacidad y la confidencialidad para los datos que de sus clientes reciba, almacene y/o procese. 脡stas han sido ideadas como instrumentos de protecci贸n inmediata de los datos personales que los clientes de Orange le hayan cedido, as铆 como soporte para que cualquier cliente pueda obtener una informaci贸n completa sobre cualquier aspecto de la recogida y tratamiento de tales datos por parte de Orange.</p>
<p>Orange considera que su desarrollo debe basarse en el respeto absoluto a la confidencialidad y privacidad de los datos personales que recoja y procese de sus usuarios, de tal forma que el cliente pueda saber en todo momento qu茅 datos personales est谩n en poder de Orange, y c贸mo est谩n siendo utilizados. Asimismo, toda aquella informaci贸n adicional que se nos facilite tendr谩 el exclusivo prop贸sito de mejorar el s
request(.GET, CUSTOMER_URL, parameters: params, encoding: .URL).responseJSON { (request, response, result) -> Void in
var message = JSON(result.value ?? "")["message"].string ?? "Default value to make it nonOptional"
switch(result) {
case .Success(let json):
if let customer = JSON(json)["customer"].dictionaryObject {
GlobalCache.sharedInstance.setCustomer(customer)
}
completion(succeed: response?.statusCode == 200, message: message) //ERROR
case .Failure(_,_):
completion(succeed: false, message: message) //ERROR
@IBDesignable class ExclusiveSelectorView: UIView {
@IBInspectable var cellWidth: CGFloat?
Failed to set (cellWidth) user defined inspected property on (Test.ExclusiveSelectorView): [<Test.ExclusiveSelectorView 0x7fd3a2242960> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cellWidth.
class CustomLabel: UILabel {
override var text: String? {
willSet {
if upperCase == true {
text = newValue?.uppercaseString // i need to modify the newValue and assign it without calling the setter aggain
}
}
}
class MenuVC: UIViewController {
private var menuItems = AppearanceService.template().menuItems()
private let cellIdentifier = "menu"
var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.delegate = self