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
// | |
// WebViewExampleViewController.swift | |
// | |
// Created by Felix Mau on 06.01.18. | |
// Copyright © 2018 Felix Mau. All rights reserved. | |
// | |
import UIKit | |
import WebKit |
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
// | |
// ImageDownloader.swift | |
// ImageDownloader | |
// | |
// Created by Oluwatobi Omotayo on 27/05/2020. | |
// Copyright © 2020 Oluwatobi Omotayo. All rights reserved. | |
// | |
import UIKit | |
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
let timer = Observable<Int>.interval(.seconds(1), scheduler: MainScheduler.instance) | |
.take(60) | |
.startWith(0) | |
.share(replay: 1) | |
timer | |
.map { 60 - $0 } | |
.map { "\($0)" } | |
.bind(to: timerLabel.rx.text) | |
.disposed(by: disposeBag) | |
timer |
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 Foundation | |
//: # NestedKey | |
/// | |
/// Use this to annotate the properties that require a depth traversal during decoding. | |
/// The corresponding `CodingKey` for this property must be a `NestableCodingKey` | |
@propertyWrapper | |
struct NestedKey<T: Decodable>: Decodable { | |
var wrappedValue: T | |
struct AnyCodingKey: CodingKey { |
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
// | |
// CustomSegmentedControl.swift | |
// CustomSegmentedControl | |
// | |
// Created by Oluwatobi Omotayo on 06/09/2019. | |
// Copyright © 2019 Oluwatobi Omotayo. All rights reserved. | |
// | |
import UIKit |
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
// model for user profile | |
struct UserProfile: Codable { | |
let email: String? | |
let names: String? | |
let phone: String? | |
} | |
// model for all api response with generic data | |
struct DataResponse<T: Decodable>: Decodable { | |
let status: Int? |
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
protocol ModalViewControllerDelegate { | |
func pushToAnotherScreen() | |
} | |
class ModalViewController: UIViewController { | |
// MARK: - Properties | |
weak var delegate: ModalViewControllerDelegate | |
lazy var cancelButton: UIButton = { |
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
// | |
// Camera.swift | |
// Tobi Omotayo | |
// | |
// Created by Oluwatobi Omotayo on 20/07/2018. | |
// Copyright © 2018 Oluwatobi Omotayo. All rights reserved. | |
// | |
import UIKit | |
import MobileCoreServices |
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 XCTest | |
import MapKit | |
class ExampleTests: XCTestCase { | |
//declaring the ViewController under test as an implicitly unwrapped optional | |
var viewControllerUnderTest : ViewController! | |
override func setUp() { |
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 Foundation | |
import UIKit | |
struct Colors { | |
static let brightOrange = UIColor(red: 255.0/255.0, green: 69.0/255.0, blue: 0.0/255.0, alpha: 1.0) | |
static let red = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0) | |
static let brandColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0) | |
static let secondaryColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0) | |
static let darkColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0) | |
} |