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
private extension XCTestCase { | |
func XCTAssertThrows<T, E>(_ expression: @autoclosure () throws -> T, specificError: E) where E: Error, E: Equatable { | |
XCTAssertThrowsError(try expression()) { error in | |
XCTAssertEqual(error as? E, specificError) | |
} | |
} | |
} |
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 PlaygroundSupport | |
var str = "Hello, playground" | |
let view = UIView(frame: CGRect(x: 0, y: 0, width: 600, height: 600)) | |
view.backgroundColor = .red | |
let bottomLabel = UILabel() | |
bottomLabel.text = "Hello world!" | |
bottomLabel.sizeToFit() |
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 AppDelegate { | |
var window: UIWindow? | |
} | |
//Chain of Resposability: Handler | |
protocol ErrorHandler { | |
var errorHandlerSuccessor: ErrorHandler? {get} | |
func handleError(error: 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
import UIKit | |
//MARK: Common | |
enum Result<T> { | |
case success(T) | |
case failure(Error) | |
} | |
struct Task { | |
var title: String |
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
// | |
// ContentSizePagingCollectionDelegate.swift | |
// CardsCarousel | |
// | |
// Created by Daniel Carlos Souza Carvalho on 2/20/21. | |
// | |
import UIKit | |
/// Horizontal paging for collections based on the content size |
OlderNewer