Skip to content

Instantly share code, notes, and snippets.

View AdieOlami's full-sized avatar
🏠
Working from home

Adie Olalekan AdieOlami

🏠
Working from home
  • Lagos, Nigeria
View GitHub Profile
@AdieOlami
AdieOlami / Networking.swift
Created January 23, 2021 00:52
Migrating Moya RxSwift to Combine exposing every process.
class OnlineProvider<Target> where Target: Moya.TargetType {
fileprivate let provider: MoyaProvider<Target>
fileprivate let reachabilityManager: ReachabilityManager
private let authManager: AuthManager
init(endpointClosure: @escaping MoyaProvider<Target>.EndpointClosure = MoyaProvider<Target>.defaultEndpointMapping,
requestClosure: @escaping MoyaProvider<Target>.RequestClosure = MoyaProvider<Target>.defaultRequestMapping,
stubClosure: @escaping MoyaProvider<Target>.StubClosure = MoyaProvider<Target>.neverStub,
@AdieOlami
AdieOlami / Makefile
Last active June 8, 2020 23:22
A simple Makefile to handle Git actions
git: git_checkout_branch
echo "🎉🎊🎁 DONE!!! Enjoy from @AdieOlami"
show_dir:
@echo "*****************************************************************"; \
echo "\nYour current working directory is \n🏡" `pwd`; \
echo "\n*****************************************************************";
git_checkout_branch: show_dir
@read -p "🆘 Do you want to create a new Branch y/n: " -n 1 -r; \
class MyInfoViewModel: ViewModel, ViewModelType {
struct Input {
let trigger: Observable<Void>
let segmentSelection: Observable<EventSegments>
let selection: Driver<MyInfoSectionItem>
let deleted: Driver<MyInfoSectionItem>
}
struct Output {
@AdieOlami
AdieOlami / PlaceSearchField.swift
Created June 25, 2019 10:21
GooglePlace Autocomplete
import UIKit
import GooglePlaces
class PlaceSearchField: UITextField, UITextFieldDelegate {
//MARK: - PROPERTIES
/// Instance of autoCompleteTableView
fileprivate var autoCompleteTableView: UITableView?
/// Gives the array of autoCompletePlacesData
open var autoCompletePlacesData = [String]()
@AdieOlami
AdieOlami / Observable+ObjectMapper.swift
Last active May 3, 2019 09:54
Observable+ObjectMapper
extension Observable {
/// handle the network response and map to JSON
/// - returns: Observable<JSON>
func handleResponseMapJSON() -> Observable<Result<JSON, ORMError>> {
return self.map { representor in
guard let response = representor as? Moya.Response else {
return .failure(ORMError.ORMNoRepresentor)