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
// | |
// RxXCTestCase.swift | |
// | |
// Created by Muhammad Hassan on 02/12/2020. | |
// Copyright © 2020 Muhammad Hassan. All rights reserved. | |
// | |
import XCTest | |
import RxSwift | |
import RxTest |
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 UIViewController { | |
public func dch_checkDeallocation(afterDelay delay: TimeInterval = 5.0) { | |
let rootParentViewController = dch_rootParentViewController | |
// We don’t check `isBeingDismissed` simply on this view controller because it’s common | |
// to wrap a view controller in another view controller (e.g. in UINavigationController) | |
// and present the wrapping view controller instead. | |
if isMovingFromParent || rootParentViewController.isBeingDismissed { | |
let selfType = type(of: self) |
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 <#Inputs#> { | |
} | |
protocol <#Outputs#> { | |
} | |
protocol <#ViewModelType#> { | |
var inputs: <#Inputs#> { get } |
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
find . -type f -exec wc -l {} + | sort -n |
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 <#ViewControllerName#>: UIViewController { | |
// MARK: - Outlets | |
// MARK: - Properties | |
// MARK: - View Life Cycle | |
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
// | |
// JSONParsing.swift | |
// hplus-sports | |
// | |
// Created by Muhammad Hassan on 9/27/17. | |
// Copyright © 2017 Lynda.com. All rights reserved. | |
// | |
import Foundation |
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
//1 | |
let fetchRequest1 = NSFetchRequest<Venue>() | |
let entity = | |
NSEntityDescription.entity(forEntityName: "Venue", | |
in: managedContext)! | |
fetchRequest1.entity = entity | |
// 2 | |
let fetchRequest2 = NSFetchRequest<Venue>(entityName: "Venue") | |
// 3 | |
let fetchRequest3: NSFetchRequest<Venue> = Venue.fetchRequest() |
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 CoreData | |
class CoreDataStack { | |
private let modelName: String | |
init(modelName: String) { | |
self.modelName = modelName | |
} |