This file contains hidden or 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
// | |
// LHNetworking+Endpoint.swift | |
// magellan | |
// | |
// Created by Ivan Bruel on 09/04/15. | |
// Copyright (c) 2015 Passworks S.A. All rights reserved. | |
// | |
import Foundation | |
import Lighthouse |
This file contains hidden or 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
infix operator ?-> { associativity left precedence 140 } | |
func ?-><T>(lhs: T?, rhs: ((T)->(Void))) { | |
if let value = lhs { | |
rhs(value) | |
} | |
} | |
// Usage | |
var someOptionalVariable : Int? |
This file contains hidden or 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
<activity | |
android:name="com.hokolinks.activity.HokoActivity" | |
android:alwaysRetainTaskState="true" | |
android:launchMode="singleTask" | |
android:noHistory="true" | |
android:theme="@android:style/Theme.Translucent.NoTitleBar"> | |
<intent-filter> | |
<data android:scheme="<your-app-scheme>"/> | |
<action android:name="android.intent.action.VIEW" /> |
This file contains hidden or 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
// | |
// UIImage+UIColor.swift | |
// | |
import UIKit | |
extension UIImage { | |
class func imageWithColor(color: UIColor) -> UIImage { | |
let rect = CGRectMake(0.0, 0.0, 1.0, 1.0) | |
UIGraphicsBeginImageContext(rect.size) |
This file contains hidden or 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
public class MainActivity extends Activity { | |
private Permissions mPermissions; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
mPermissions = Permissions.with(this); | |
} |
This file contains hidden or 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
class Animal { | |
var name: String | |
var age: Int | |
var image: UIImage | |
init(name: String, age: Int, image: UIImage) { | |
self.name = name | |
self.age = age | |
self.image = image | |
} |
This file contains hidden or 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
class AnimalViewController: UIViewController { | |
// Model Object | |
var animal: Animal | |
// View Object | |
var imageView: UIImageView | |
override func viewDidLoad() { | |
// Maps Model into a View |
This file contains hidden or 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
class AnimalViewModel { | |
let name: String | |
let image: UIImage | |
private let _hungry: Variable<Bool> | |
var hungry: Observable<Bool> { | |
return _hungry.asObservable() | |
} | |
init(animal: Animal) { |
This file contains hidden or 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
class AnimalTableViewCell: UITableViewCell { | |
private var imageView: UIImageView | |
private var nameLabel: UILabel | |
private var hungryIconView: HungryIconView | |
private let disposeBag = DisposeBag() | |
var viewModel: AnimalViewModel { | |
didSet { |
This file contains hidden or 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
// | |
// DressDetailsAddToBagViewModel.swift | |
// ChicByChoice | |
// | |
// Created by Ivan Bruel on 18/04/16. | |
// Copyright © 2016 Chic by Choice. All rights reserved. | |
// | |
import Foundation | |
import RxSwift |
OlderNewer