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 | |
protocol ReusableView: class {} | |
extension ReusableView { | |
static var reuseIdentifier: String { | |
return String(describing: 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
import Foundation | |
import UIKit | |
extension UIViewController: ReusableView { } |
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 | |
extension UIStoryboard { | |
func instantiateViewController<T: UIViewController>() -> T where T: ReusableView { | |
return instantiateViewController(withIdentifier: T.reuseIdentifier) as! T | |
} | |
} |
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 FileRouter { | |
// MARK: Properties | |
weak var view: UIViewController? | |
// MARK: Static methods | |
static func setupModule() -> FileViewController { | |
let viewController = UIStoryboard(name: FileViewController.storyboardName).instantiateViewController() as! FileViewController |
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. Declare which messages can be sent to the delegate | |
// File ProductScreenDelegate.swift | |
protocol ProductScreenDelegate { | |
//Add arguments if you need to send some information | |
func onProductScreenDismissed() | |
func onProductSelected(_ product: Product?) | |
} |
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. Declare which messages can be sent to the delegate | |
// File ProductCategoriesCoreDelegate.swift | |
protocol ProductCategoriesCoreDelegate: class { | |
//Add arguments if you need to send some information | |
func setupSubmodules(with product: Product) | |
} | |
// 2. Create a delegate to send him a message |
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 MainSearchInteractor { | |
// Properties | |
weak var output: MainSearchInteractorOutput? | |
var apiDataManager = ProfileApiDataManager() | |
var localDataManager = ProfileLocalDataManager() | |
} | |
extension MainSearchInteractor: MainSearchUseCase { |
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 | |
protocol MainSearchView: BaseView { | |
func showCustomError(_ message: String?) | |
func updateVisibility(onSearchController willBeActive: Bool) | |
func showSearchResult(_ products: [Product]?, shouldAppend: Bool) | |
} | |
protocol MainSearchPresentation: class { |
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 | |
class KeyboardController: NSObject { | |
var viewController: UIViewController | |
var constraint: NSLayoutConstraint | |
var isKeyboardHidden: Bool { | |
return constraint.constant == 0 | |
} |
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 RealmSwift | |
import ObjectMapper | |
import ObjectMapper_Realm | |
class Event: Object, Mappable, Identifiable, RandomizePlaceholder, TrackableEntity { | |
dynamic var id: Int = 0 | |
fileprivate dynamic var stringType: String = "" | |
fileprivate dynamic var title = "" |
OlderNewer