Skip to content

Instantly share code, notes, and snippets.

View GeekTree0101's full-sized avatar
🏗️
빌딩중

David Ha (小河) GeekTree0101

🏗️
빌딩중
View GitHub Profile
@GeekTree0101
GeekTree0101 / TheProgrammersBrain34page.swift
Created January 15, 2022 02:36
TheProgrammersBrain34page.swift
View TheProgrammersBrain34page.swift
enum CouponStatus {
case notExist
case retry
case expired
case active
case get
case used
View test.swift
extension Router: Delegate {
func dismissAndPresentWriteForm(_ groupID: Int?) {
self.viewController?.present(WriteFormViewController(), animated: true)
}
}
class 제이가만든뷰컨트롤러 {
var selectedGroupID: Int? {
View test.swift
struct ViewModel {
let id: Int
let name: String
let hasLock: Bool
}
let groups: [FleaMarketGroup] = ...
let viewModels: [ViewModel] = groups.map { hasLock: true } + [ViewModel( hasLock: false)]
@GeekTree0101
GeekTree0101 / abstractCase.swift
Last active November 1, 2021 02:44
Usecase 추상화 vs 실객체
View abstractCase.swift
protocol FeedUsecase { }
final class BusinessFeedUsecase: FeedUsecase {
init(repo: ArticleRepositoryProtocol) { ... }
}
final class FleaMarketFeedUsecase: FeedUsecase {
init(repo: ArticleRepositoryProtocol) { ... }
View AppDependency.swift
import Foundation
import HaihwanFoundation
struct AppDependency {
let networking: NetworkingLogic
let authWorker: AuthWorkerLogic
let propertyWorker: PropertyWorkerLogic
@GeekTree0101
GeekTree0101 / dx.swift
Created June 19, 2020 03:53
Texture DX experiment
View dx.swift
import AsyncDisplayKit
import BonMot
// MARK: - Action
extension TestNode {
public var didTapButton: () -> Void {
return buttonNode.on(.touchUpInside)
}
@GeekTree0101
GeekTree0101 / Syncronizer.swift
Last active February 27, 2020 03:12
Domain Model Syncronizer
View Syncronizer.swift
protocol Syncronizable {
func isSyncronizable(from value: Self?) -> Bool
}
class Syncronizer {
static let shared = Syncronizer()
@GeekTree0101
GeekTree0101 / test.swift
Created January 22, 2020 07:23
상태 검증 vs 행위 검증
View test.swift
class Object {
var isEnabled: Bool = false
func test() {
isEnabled = true
}
}
class SpyObject: Object {