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
struct Frame { | |
enum Change { | |
case addRoll(_ roll: Int) | |
case setCurrentFrame(_ newValue: Bool) | |
} | |
static let Strike = 10 | |
static let FullRackOfPins = 10 | |
static let Gutter = 0 | |
static let LastFrame = 10 |
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 ViewController: UIViewController { | |
@IBOutlet weak var cardImageView: UIImageView! | |
let disposeBag = DisposeBag() | |
let divider = 100 | |
deinit { | |
print("deinit vc") | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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 x = { (i: Int) in | |
return String(square(increment(i))) | |
} |
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
saveButton.rx.tap | |
.withLatestFrom(websiteAddress.rx.text) | |
.filter(verifyUrl) | |
.map(Website.init(address:)) | |
.subscribe(onNext: updateWebsiteAddress) | |
.disposed(by: bag) |
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
//composing with another (String) -> String shape | |
let shout = addExclamation(uppercase(s)) | |
//composing with (String) -> A shape | |
let url = URL(string: uppercase("http://google.com") | |
//composing with (A) -> String shape | |
let fromData = uppercase(String(data: data, encoding: .utf8)) |
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
func uppercase(_ string: String) -> String { | |
return string.uppercased() | |
} |
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
// | |
// GithubSignupViewModel2.swift | |
// RxExample | |
// | |
// Created by Krunoslav Zaher on 12/6/15. | |
// Modified by Chuck Krutsinger on 2/20/19. | |
// | |
// Copyright © 2015 Krunoslav Zaher. All rights reserved. | |
// |
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
// | |
// GithubSignupViewModel2.swift | |
// RxExample | |
// | |
// Created by Krunoslav Zaher on 12/6/15. | |
// Modified by Chuck Krutsinger on 2/20/19. | |
// | |
// Copyright © 2015 Krunoslav Zaher. All rights reserved. | |
// |
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
// SearchResultViewModel.swift | |
// RxExample | |
// | |
// Created by Krunoslav Zaher on 4/3/15. | |
// Modified by Chuck Krutsinger on 2/20/19. | |
// | |
// Copyright © 2015 Krunoslav Zaher. All rights reserved. | |
// | |
import RxSwift |
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
#if DEBUG | |
deinit { | |
print("\(String(describing: self)) deinit") | |
} | |
#endif |
NewerOlder