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
class MyAwesomeViewConroller: UIViewController { | |
var awesomeView: MyAwesomeView { | |
return view as MyAwesomeView | |
} | |
init() { | |
super.init(nibName: nil, bundle: nil) | |
} | |
override func loadView() { |
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
public class View: UIView { | |
public init() { | |
super.init(frame: CGRect.zero) | |
configureView() | |
} | |
public required init?(coder: NSCoder) { | |
super.init(coder: coder) | |
configureView() | |
} |
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
class AwesomeView: GenericView { | |
let bestTitleLabel: UILabel = { | |
let label = UILabel() | |
label.textAlignment = .Center | |
label.textColor = .purpleColor() | |
return label | |
}() | |
let otherTitleLabel: UILabel = { |
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
@objc func didPressLogIn(sender: AnyObject?) { | |
guard !isPerformingLogIn else { return } | |
isPerformingLogIn = true | |
let email = contentView.formView.emailField.text | |
let password = contentView.formView.passwordField.text | |
guard validateAndShowError(email, password: password) else { | |
isPerformingLogIn = false | |
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
currentRequest?.getValue { [weak self] result in | |
guard let user = result.okValue where result.errorValue == nil else { | |
self?.showRequestError(result.errorValue) | |
self?.isPerformingSignUp = false | |
return | |
} | |
self?.finishSignUp(user) | |
} |
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
ImageView img = (ImageView)findViewById(R.id.imgView1); | |
img.setImageResource(android.R.drawable.ic_media_play); |
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
// This is a generated file, do not edit! | |
// Generated by R.swift, see https://github.com/mac-cain13/R.swift | |
import Foundation | |
import Rswift | |
import UIKit | |
/// This `R` struct is code generated, and contains references to static resources. | |
struct R { | |
/// This `R.color` struct is generated, and contains static references to 0 color palettes. |
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 GenericViewKit | |
public class StateView: GenericView { | |
public enum State { | |
case Loading | |
case Loaded | |
case Error | |
} |
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
class AwesomeView: GenericView { | |
let bestTitleLabel = UILabel().then { | |
$0.textAlignment = .Center | |
$0.textColor = .purpleColor()tww | |
} | |
let otherTitleLabel = UILabel().then { | |
$0.textAlignment = . | |
$0.textColor = .greenColor() | |
} |
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 GenericViewKit | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
private let applicationController = ApplicationController() | |
func application(application: UIApplication, | |
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
applicationController.configureReporting() |