Skip to content

Instantly share code, notes, and snippets.

@bigMOTOR
bigMOTOR / CIFilter+Extension.swift
Created March 5, 2023 10:25 — forked from Umity/CIFilter+Extension.swift
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@bigMOTOR
bigMOTOR / 2021-10-02_Article_ComposableContextsArchitecture_3.swift
Created October 7, 2021 15:21
2021-10-02_Article_ComposableContextsArchitecture_3.swift
// MARK: Context
private final class UserScreenContext: UserRepositoryTypeHolderType {
let userRepository: UserRepositoryType
init(userRepository: UserRepositoryType) {
self.userRepository = userRepository
}
}
extension UserScreenContext: ObserveUserNameUseCase {}
@bigMOTOR
bigMOTOR / 2021-10-02_Article_ComposableContextsArchitecture_2.swift
Last active October 6, 2021 21:54
2021-10-02_Article_ComposableContextsArchitecture_2.swift
extension ObserveUserNameUseCase where Self: UserRepositoryHolderType {
var userName: Observable<String> {
return userRepository.user
.compactMap { $0 }
.map { "\($0.firstName) \($0.lastName)" }
.distinctUntilChanged()
}
}
protocol UserRepositoryType {
@bigMOTOR
bigMOTOR / 2021-10-02_Article_ComposableContextsArchitecture_1.swift
Last active October 6, 2021 21:29
2021-10-02_Article_ComposableContextsArchitecture_1.swift
protocol ObserveUserNameUseCase {
var userName: Observable<String> { get }
}
protocol SignOutUseCase {
func signOut()
}
struct UserScreenViewModel {
typealias UseCases = ObserveUserNameUseCase & SignOutUseCase
@bigMOTOR
bigMOTOR / Terms of Use PhotoMapper App.md
Last active March 11, 2021 17:38
Terms of Use PhotoMapper App

Terms of Use

Nikolay Fiantsev, PhotoMapper: GPS EXIF Edito‪r‬

These Terms and Conditions (“Terms”, “Terms and Conditions”) govern your relationship with mobile applications owned by Nikolay Fiantsev. (the “Service”).

Please read these Terms and Conditions carefully before using our mobile applications (the “Service”).

Your access to and use of the Service is based on your acceptance of and compliance with these Terms. These Terms apply to all visitors, users and others who access or use the Service.

@bigMOTOR
bigMOTOR / 2021-01-30_Article_DataDrivenRxDatasources_5.swift
Created January 30, 2021 18:57
2021-01-30_Article_DataDrivenRxDatasources_5.swift
struct MyAnimatableTableViewModel {
let sections: Driver<[AnimatableTableSectionModel<String>]>
init(repository = SomeRepository()) {
sections = repository.models
.map {
[AnimatableTableSectionModel(model: "Your Section Header",
items: [
XibCellViewModel(value: id1, onSelected: { print("---") }),
XibCellViewModel(value: id1, onSelected: { print("+++") }),
@bigMOTOR
bigMOTOR / 2021-01-30_Article_DataDrivenRxDatasources_3.swift
Last active January 30, 2021 19:16
2021-01-30_Article_DataDrivenRxDatasources_3.swift
final class XibCell: UITableViewCell, ModelledCell {
@IBOutlet weak var valueLabel: UILabel!
var cellModel: CellViewModel? {
didSet {
guard let viewModel = cellModel as? XibCellViewModel else { return }
self.valueLabel.text = viewModel.value
}
}
@bigMOTOR
bigMOTOR / 2021-01-30_Article_DataDrivenRxDatasources_2.swift
Created January 30, 2021 10:25
2021-01-30_Article_DataDrivenRxDatasources_2.swift
let dataSource = RxTableViewSectionedReloadDataSource<SectionOfCustomData>(
configureCell: { dataSource, tableView, indexPath, item in
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
cell.textLabel?.text = "Item \(item.anInt): \(item.aString) - \(item.aCGPoint.x):\(item.aCGPoint.y)"
return cell
})
@bigMOTOR
bigMOTOR / 2021-01-30_Article_DataDrivenRxDatasources_1.swift
Last active January 30, 2021 10:24
2021-01-30_Article_DataDrivenRxDatasources_1.swift
tableView.rx
.bind(sections: sections)
.disposed(by: bag)
@bigMOTOR
bigMOTOR / 2020-12-20_Article_SwiftUInCleanArchitecture_4.swift
Created December 20, 2020 16:06
2020-12-20_Article_SwiftUInCleanArchitecture_4
struct ContentView: View {
var body: some View {
return ModelledViewFactory<RootView>()
.build(RootView.ViewModel.init)
}
}