Skip to content

Instantly share code, notes, and snippets.

View Rashidium's full-sized avatar

Rashid Ramazanov Rashidium

View GitHub Profile
import Foundation
protocol PanpaDecodable: Decodable & Keyable { }
protocol Keyable {
static var codingKey: String { get }
}
public class User: PanpaDecodable {
var username: String?
var name: String?
var surname: String?
var email: String?
var uid: String?
enum CodingKeys: String, CodingKey {
case username, name, surname, email, uid
import Foundation
public class Coupon: PanpaDecodable {
var id: String = ""
var name: String = ""
var no: String = ""
var isOpen: Bool = false
var matches: [PMatches] = []
@Rashidium
Rashidium / FeedViewController.swift
Last active January 26, 2021 14:48
Clean View Controller
import UIKit
protocol FeedDisplayLogic: AnyObject {
}
final class FeedViewController: UIViewController {
var interactor: FeedBusinessLogic?
var router: (FeedRoutingLogic & FeedDataPassing)?
@Rashidium
Rashidium / FeedInteractor.swift
Last active January 26, 2021 14:47
FeedInteractor
import Foundation
protocol FeedBusinessLogic: AnyObject {
}
protocol FeedDataStore: AnyObject {
}
@Rashidium
Rashidium / FeedPresenter.swift
Last active January 26, 2021 14:48
FeedPresenter
import Foundation
protocol FeedPresentationLogic: AnyObject {
}
final class FeedPresenter: FeedPresentationLogic {
weak var viewController: FeedDisplayLogic?
@Rashidium
Rashidium / FeedWorker.swift
Last active January 26, 2021 14:47
FeedWorker
import Foundation
protocol FeedWorkingLogic: AnyObject {
}
final class FeedWorker: FeedWorkingLogic {
}
@Rashidium
Rashidium / FeedRouter.swift
Created January 23, 2021 18:51
FeedRouter
import Foundation
protocol FeedRoutingLogic: class {
}
protocol FeedDataPassing: class {
var dataStore: FeedDataStore? { get }
}
@Rashidium
Rashidium / FeedModels.swift
Last active January 26, 2021 15:19
FeedModels
import Foundation
import API
// swiftlint:disable nesting
enum Feed {
enum FetchMovies {
struct Request {
@Rashidium
Rashidium / FeedRouter.swift
Created January 31, 2021 19:26
FeedRouter with data passing
import Foundation
protocol FeedRoutingLogic: class {
func routeToMovieDetail()
}
protocol FeedDataPassing: class {
var dataStore: FeedDataStore? { get }
}