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
Stubber.register(self.authRepository.signIn) { _ in .just(.failure(error: SignInReactor.ErrorMessage.signInFailed.rawValue)) } | |
let disposeBag = DisposeBag() | |
Observable.of(.signIn(email: self.defaultEmail, password: self.defaultPassword)) | |
.delay(1, scheduler: MainScheduler.instance) | |
.bind(to: self.signInReactor.action) | |
.disposed(by: disposeBag) | |
let states = try? self.signInReactor.state.skip(1).take(2).toBlocking(timeout: 5).toArray() |
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
let disposeBag = DisposeBag() | |
Observable.of(.signIn(email: self.invalidEmail, password: self.defaultPassword)) | |
.delay(1, scheduler: MainScheduler.instance) | |
.bind(to: self.signInReactor.action) | |
.disposed(by: disposeBag) | |
guard let state = try? self.signInReactor.state.skip(1).take(1).toBlocking(timeout: 5).first(), let errorMessage = state?.errorMessage else { | |
fail("It should emit error state") | |
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
import Eureka | |
open class _SearchablePushRow<T: Equatable, Cell: CellType> : TableSelectorRow<Cell, SearchableViewController<T>> where Cell: BaseCell, Cell: TypedCellType, Cell.Value == T, T: SearchableItem, T: CustomStringConvertible { | |
public required init(tag: String?) { | |
super.init(tag: tag) | |
onCreateControllerCallback = { [weak self] _ in | |
let controller = SearchableViewController<T>() | |
controller.searchPlaceholder = self?.searchPlaceholder | |
return controller |
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
// Creating CGRects for your UIView frame | |
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 200.dp, height: 40.dp)) | |
//Creating constraints | |
imageView.leftAnchor.constaint(equalTo: view.leftAnchor, constant: 16.dp).isActive = true | |
//Using as a font size | |
myLabel.font = UIFont.systemFont(ofSize: 13.dp) |
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
extension CGFloat { | |
/** | |
The relative dimension to the corresponding screen size. | |
//Usage | |
let someView = UIView(frame: CGRect(x: 0, y: 0, width: 320.dp, height: 40.dp) | |
**Warning** Only works with size references from @1x mockups. | |
*/ |
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 RxSwift | |
import RxCocoa | |
import RxNuke | |
import Nuke | |
// UIImageView object | |
lazy var myImageView: UIImageView = { | |
let myImageView = UIImageView() | |
myImageView.contentMode = .scaleAspectFit | |
myImageView.translatesAutoresizingMasksIntoConstraints = false |
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 RxNuke | |
import Nuke | |
import RxSwift | |
import Firebase | |
import RxCocoa | |
enum ImageVariants: String { | |
case high = "_high" | |
case med = "_med" | |
case low = "_low" |