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
import UIKit | |
final class ScreenA: UIViewController { | |
// MARK: UI | |
let viewA = UIView() | |
let nextButton = UIButton() | |
// MARK: Properties |
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
final class CroppingView: UIView { | |
// MARK: IBOutlets | |
@IBOutlet private var overlayView: UIView! | |
@IBOutlet private var cropReferenceView: UIView! | |
// MARK: Properties | |
private let shapeLayer = CAShapeLayer() | |
override func layoutSubviews() { | |
super.layoutSubviews() |
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
import UIKit | |
final class ViewController: UIViewController { | |
// MARK: UI | |
let label = UILabel() | |
let incrementButton = UIButton() | |
let decrementButton = UIButton() | |
// MARK: Properties |
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
final class Box<T> { | |
var listener: ((T) -> Void)? | |
var value: T { | |
didSet { listener?(value) } | |
} | |
init(_ value: T) { | |
self.value = value | |
} |
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
import UIKit | |
import AVFoundation | |
final class Screen: UIViewController { | |
private let captureSession = AVCaptureSession() | |
lazy private var previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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
let filter = CIFilter(name: "CIQRCodeGenerator")! | |
filter.setValue("https://medium.com/@brunomunizaf".data(using: .utf8), | |
forKey: "inputMessage") | |
let output = filter.outputImage!.transformed(by: CGAffineTransform(scaleX: 2, y: 2)) | |
let qrImage = UIImage(ciImage: output) |
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
import Quick | |
import Nimble | |
@testable import myapp | |
final class SomeScreenSpec: QuickSpec { | |
override func spec() { | |
context("init") { | |
var sut: SomeScreen! | |
let coordinator = DashboardCoordinatorDouble() |
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
import UIKit | |
let appDelegate: String? = NSClassFromString("XCTestCase") == nil ? NSStringFromClass(AppDelegate.self) : nil | |
UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, appDelegate) |
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
import Quick | |
import Nimble | |
@testable import myapp | |
final class PusherDouble: Pushing { | |
private(set) var didPresentTarget: UIViewController? | |
private(set) var didPresentFrom: UIViewController? | |
} |
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 AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions...) -> Bool { | |
DependencyContainer.register(DashboardCoordinator() as DashboardCoordinating) | |
// ... | |
} | |
} | |
final class SomeScreen: UIViewController { |