Skip to content

Commit

Permalink
Update some.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mioke committed Oct 13, 2022
1 parent 562c267 commit efb56f3
Show file tree
Hide file tree
Showing 21 changed files with 251 additions and 57 deletions.
10 changes: 5 additions & 5 deletions MIOSwiftyArchitecture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pod::Spec.new do |s|
# s.libraries = 'c++', 'sqlite3'

# s.source_files = 'SwiftyArchitecture/Base/**/*.swift'
s.default_subspecs = 'Assistance', 'Networking', 'Persistance', 'RxExtension', 'AppDocker', 'Componentize'
s.default_subspecs = 'Assistance', 'Networking', 'Persistance', 'RxExtension', 'AppDock', 'Componentize'

s.subspec 'Assistance' do |ss|
ss.frameworks = 'UIKit', 'Foundation'
Expand Down Expand Up @@ -54,8 +54,8 @@ Pod::Spec.new do |s|
ss.dependency 'RxSwift', '~> 6.2'
end

s.subspec 'AppDocker' do |ss|
ss.source_files = 'SwiftyArchitecture/Base/AppDocker/**/*.swift'
s.subspec 'AppDock' do |ss|
ss.source_files = 'SwiftyArchitecture/Base/AppDock/**/*.swift'
ss.dependency 'MIOSwiftyArchitecture/Assistance'
ss.dependency 'MIOSwiftyArchitecture/Networking'
ss.dependency 'MIOSwiftyArchitecture/RxExtension'
Expand All @@ -77,7 +77,7 @@ Pod::Spec.new do |s|
ss.dependency 'MIOSwiftyArchitecture/Assistance'
ss.dependency 'MIOSwiftyArchitecture/Networking'
ss.dependency 'MIOSwiftyArchitecture/RxExtension'
ss.dependency 'MIOSwiftyArchitecture/AppDocker'
ss.dependency 'MIOSwiftyArchitecture/AppDock'
ss.dependency 'MIOSwiftyArchitecture/Componentize'
end

Expand All @@ -87,7 +87,7 @@ Pod::Spec.new do |s|
test_spec.dependency 'MIOSwiftyArchitecture/Assistance'
test_spec.dependency 'MIOSwiftyArchitecture/Networking'
test_spec.dependency 'MIOSwiftyArchitecture/RxExtension'
test_spec.dependency 'MIOSwiftyArchitecture/AppDocker'
test_spec.dependency 'MIOSwiftyArchitecture/AppDock'
test_spec.dependency 'MIOSwiftyArchitecture/Componentize'
test_spec.dependency 'MIOSwiftyArchitecture/Testable'

Expand Down
10 changes: 5 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ PODS:
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- MIOSwiftyArchitecture (2.0.0):
- MIOSwiftyArchitecture/AppDocker (= 2.0.0)
- MIOSwiftyArchitecture/AppDock (= 2.0.0)
- MIOSwiftyArchitecture/Assistance (= 2.0.0)
- MIOSwiftyArchitecture/Componentize (= 2.0.0)
- MIOSwiftyArchitecture/Networking (= 2.0.0)
- MIOSwiftyArchitecture/Persistance (= 2.0.0)
- MIOSwiftyArchitecture/RxExtension (= 2.0.0)
- MIOSwiftyArchitecture/AppDocker (2.0.0):
- MIOSwiftyArchitecture/AppDock (2.0.0):
- MIOSwiftyArchitecture/Assistance
- MIOSwiftyArchitecture/Networking
- MIOSwiftyArchitecture/RxExtension
Expand All @@ -48,13 +48,13 @@ PODS:
- MIOSwiftyArchitecture/Networking
- RxSwift (~> 6.2)
- MIOSwiftyArchitecture/Testable (2.0.0):
- MIOSwiftyArchitecture/AppDocker
- MIOSwiftyArchitecture/AppDock
- MIOSwiftyArchitecture/Assistance
- MIOSwiftyArchitecture/Componentize
- MIOSwiftyArchitecture/Networking
- MIOSwiftyArchitecture/RxExtension
- MIOSwiftyArchitecture/Tests (2.0.0):
- MIOSwiftyArchitecture/AppDocker
- MIOSwiftyArchitecture/AppDock
- MIOSwiftyArchitecture/Assistance
- MIOSwiftyArchitecture/Componentize
- MIOSwiftyArchitecture/Networking
Expand Down Expand Up @@ -139,7 +139,7 @@ SPEC CHECKSUMS:
AuthProtocol: 699414ec99eb060731d49ec1092901fc1ae55e3e
Differentiator: e8497ceab83c1b10ca233716d547b9af21b9344d
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
MIOSwiftyArchitecture: 013b955874684ff4ec74401c6400746b29a5b96a
MIOSwiftyArchitecture: 630881ed75a01b7ee670043a3a5b15cc72c71fc1
ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81
Realm: fac5ecd031fcb81171627b74944c885662d4b266
RealmSwift: 9b02d25acb46a14756bde9893abb99e2e3675923
Expand Down
2 changes: 1 addition & 1 deletion README-AppDocker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SwiftyArchitecture - App Docker
# SwiftyArchitecture - App Dock

## App Context

Expand Down
12 changes: 12 additions & 0 deletions SwiftArchitecture.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ABC9EA872449AFD2009D044E /* TestObjModifyVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9EA852449AFD2009D044E /* TestObjModifyVC.swift */; };
ABC9EA882449AFD2009D044E /* TestObjModifyVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABC9EA862449AFD2009D044E /* TestObjModifyVC.xib */; };
ABD632442727FE0E00AA775A /* Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD632432727FE0D00AA775A /* Video.swift */; };
ABE27F4028F5571A009CD73D /* InfiniteTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE27F3F28F5571A009CD73D /* InfiniteTableViewController.swift */; };
ABF6CA9D243DB3C400D0849B /* TestFailureAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABF6CA9C243DB3C400D0849B /* TestFailureAPI.swift */; };
AF158A541E14B63900FB0BAF /* TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF158A531E14B63900FB0BAF /* TestAPI.swift */; };
AF158A561E1BB26700FB0BAF /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF158A551E1BB26700FB0BAF /* NotificationService.swift */; };
Expand Down Expand Up @@ -102,6 +103,7 @@
ABC9EA852449AFD2009D044E /* TestObjModifyVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestObjModifyVC.swift; sourceTree = "<group>"; };
ABC9EA862449AFD2009D044E /* TestObjModifyVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TestObjModifyVC.xib; sourceTree = "<group>"; };
ABD632432727FE0D00AA775A /* Video.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Video.swift; sourceTree = "<group>"; };
ABE27F3F28F5571A009CD73D /* InfiniteTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfiniteTableViewController.swift; sourceTree = "<group>"; };
ABF6CA9C243DB3C400D0849B /* TestFailureAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestFailureAPI.swift; sourceTree = "<group>"; };
AF158A531E14B63900FB0BAF /* TestAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestAPI.swift; sourceTree = "<group>"; };
AF158A551E1BB26700FB0BAF /* NotificationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,6 +154,7 @@
A752DE3F1C031066008E3118 /* Demo */ = {
isa = PBXGroup;
children = (
ABE27F3E28F55649009CD73D /* InfiniteTableView */,
AB6781342861C08A007740FA /* Appearance */,
A77BACEB1C157EC100AF7A86 /* ApiManager */,
A7826F741C0EF058007AA18D /* Model */,
Expand Down Expand Up @@ -297,6 +300,14 @@
path = Auth;
sourceTree = "<group>";
};
ABE27F3E28F55649009CD73D /* InfiniteTableView */ = {
isa = PBXGroup;
children = (
ABE27F3F28F5571A009CD73D /* InfiniteTableViewController.swift */,
);
path = InfiniteTableView;
sourceTree = "<group>";
};
B41F4498FD05D386DBCFBEED /* Pods */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -590,6 +601,7 @@
buildActionMask = 2147483647;
files = (
ABAFE34F28C1EAAF00D023A2 /* AuthTestViewController.swift in Sources */,
ABE27F4028F5571A009CD73D /* InfiniteTableViewController.swift in Sources */,
A791C6B11C02E90000670017 /* AppDelegate.swift in Sources */,
AB6781392861C8CD007740FA /* ThemeTestViewController.swift in Sources */,
A77BAD1A1C196DFD00AF7A86 /* InternalTestVC.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AppDockerConstants.swift
// AppDockConstants.swift
// MIOSwiftyArchitecture
//
// Created by KelanJiang on 2022/2/17.
Expand All @@ -8,14 +8,14 @@
import Foundation

public extension Consts {
static let appDockerDomain = "com.mioke.swiftyarchitecture.appdocker"
static let appDockDomain = "com.mioke.swiftyarchitecture.appdock"
}

public extension KitErrors {
private static var noDelegate: Info {
.init(code: .noDelegate, message: "The delegate of this function hasn't been set yet.")
}
static let noDelegateError: NSError = error(domain: Consts.appDockerDomain, info: noDelegate)
static let noDelegateError: NSError = error(domain: Consts.appDockDomain, info: noDelegate)
}


Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extension DataAccessObject where T: DataCenterManaged {
return Observable<Void>.create { observer in
let api = T.api
let rlm = self.stored.realm
return api.rx.loadData(with: request.params)
return api.rxLoadData(with: request.params)
// TODO: - update the scheduler
.subscribe(on: MainScheduler.instance)
.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension KitErrors {

// persistance

// app docker
// app dock

// componentize
case graphCycle = 4000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ private extension LogLevel {
}

public extension KitLogger {
static func debug(_ message: String, file: String = #file, line: Int = #line) {
static func debug(_ message: String = #function, file: String = #file, line: Int = #line) {
log(level: .debug, message: message, file: file, line: line)
}

static func info(_ message: String, file: String = #file, line: Int = #line) {
static func info(_ message: String = #function, file: String = #file, line: Int = #line) {
log(level: .info, message: message, file: file, line: line)
}

static func verbose(_ message: String, file: String = #file, line: Int = #line) {
static func verbose(_ message: String = #function, file: String = #file, line: Int = #line) {
log(level: .verbose, message: message, file: file, line: line)
}

static func error(_ message: String, file: String = #file, line: Int = #line) {
static func error(_ message: String = #function, file: String = #file, line: Int = #line) {
log(level: .error, message: message, file: file, line: line)
}
}
15 changes: 9 additions & 6 deletions SwiftyArchitecture/Base/RxExtension/RxExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import Foundation
import RxSwift

extension Reactive {
public func loadData<T: ApiInfoProtocol>(with params: [String: Any]?)
-> Observable<T.ResultType> where Base: API<T> {
return Observable.create { observer in
self.base.loadData(with: params).response({ (api, data, error) in
public extension API {
func rxLoadData(with params: [String: Any]?) -> Observable<T.ResultType> {
return Observable.create { [weak self] observer in
guard let self = self else {
observer.onCompleted()
return Disposables.create()
}
self.loadData(with: params).response({ (api, data, error) in
if let error = error {
observer.onError(error)
}
Expand All @@ -22,7 +25,7 @@ extension Reactive {
observer.onCompleted()
}
})
return Disposables.create(with: self.base.cancel)
return Disposables.create(with: self.cancel)
}
}
}
Expand Down
Loading

0 comments on commit efb56f3

Please sign in to comment.