Browse Source
1. Changed modal style as full screen (ManageAgreement, NewRegister)
1. Changed modal style as full screen (ManageAgreement, NewRegister)
2. Edited check balance as <= 3. Set Default branch Information as GME Online 4. Added reactive method at GMEDB 5. Applied username, mobile, email as Rxpull/1/head
InKwon James Kim
5 years ago
14 changed files with 93 additions and 18 deletions
-
4GME Remit.xcodeproj/project.pbxproj
-
2GME Remit/AppDelegate.swift
-
4GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard
-
2GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift
-
6GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
-
6GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRecharge.storyboard
-
2GME Remit/Modules/RegisterModules/UserAuthentication/NewRegister/User Interface/Wireframe/NewRegisterWireframe.swift
-
4GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift
-
14GME Remit/Modules/SideMenu/SideMenuViewController.swift
-
2GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift
-
44GME Remit/Utilities/Database/Rx+UserDefaultsWrapper.swift
-
1GME RemitTests/APITest.swift
-
18GME RemitTests/DatabaseTest.swift
-
2GME RemitTests/FunctionTest.swift
@ -0,0 +1,44 @@ |
|||
// |
|||
// Rx+UserDefaultsWrapper.swift |
|||
// GME Remit |
|||
// |
|||
// Created by InKwon James Kim on 2020/01/10. |
|||
// Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved. |
|||
// |
|||
|
|||
import RxSwift |
|||
import RxCocoa |
|||
|
|||
extension UserDefaultsWrapper: ReactiveCompatible {} |
|||
|
|||
extension Reactive where Base: UserDefaults { |
|||
public func `default`<E: Equatable>(_ type: E.Type, _ keyPath: String) -> Observable<E?> { |
|||
let center = NotificationCenter.default |
|||
let initial = base.object(forKey: keyPath) as? E |
|||
let changes = center.rx.notification(UserDefaults.didChangeNotification) |
|||
.map { _ in |
|||
self.base.object(forKey: keyPath) as? E |
|||
} |
|||
|
|||
return Observable<E?>.just(initial) |
|||
.concat(changes) |
|||
.distinctUntilChanged { previous, next in |
|||
guard let previous = previous, let next = next else { |
|||
return false |
|||
} |
|||
return previous == next |
|||
} |
|||
} |
|||
} |
|||
|
|||
extension Reactive where Base: UserDefaultsWrapper<GMEDB.UserKeys> { |
|||
func set(key: GMEDB.UserKeys) -> Binder<String?> { |
|||
return Binder(self.base) { db, value in |
|||
db.set(value, key) |
|||
} |
|||
} |
|||
|
|||
func string(key: GMEDB.UserKeys) -> Observable<String?> { |
|||
return UserDefaults.standard.rx.default(String.self, key.rawValue) |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue