Additional filters
This commit is contained in:
parent
fb7fe1e22e
commit
b7a3efcd23
@ -97,7 +97,7 @@
|
|||||||
7AA7BC3825A5DFB80053A5D5 /* Eureka in Frameworks */ = {isa = PBXBuildFile; productRef = 7AEF47A3253DC4D2001D6238 /* Eureka */; };
|
7AA7BC3825A5DFB80053A5D5 /* Eureka in Frameworks */ = {isa = PBXBuildFile; productRef = 7AEF47A3253DC4D2001D6238 /* Eureka */; };
|
||||||
7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */; };
|
7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */; };
|
||||||
7AAE6AD324CDDF950023860B /* VehicleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAE6AD224CDDF950023860B /* VehicleEvent.swift */; };
|
7AAE6AD324CDDF950023860B /* VehicleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAE6AD224CDDF950023860B /* VehicleEvent.swift */; };
|
||||||
7AB562BA249C9E9B00473D53 /* Region.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB562B9249C9E9B00473D53 /* Region.swift */; };
|
7AB562BA249C9E9B00473D53 /* VehicleRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB562B9249C9E9B00473D53 /* VehicleRegion.swift */; };
|
||||||
7AB67E8C2435C38700258F61 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB67E8B2435C38700258F61 /* CustomTextField.swift */; };
|
7AB67E8C2435C38700258F61 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB67E8B2435C38700258F61 /* CustomTextField.swift */; };
|
||||||
7AB67E8E2435D1A000258F61 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB67E8D2435D1A000258F61 /* CustomButton.swift */; };
|
7AB67E8E2435D1A000258F61 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB67E8D2435D1A000258F61 /* CustomButton.swift */; };
|
||||||
7ADF6C93250B954900F237B2 /* Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ADF6C92250B954900F237B2 /* Navigation.swift */; };
|
7ADF6C93250B954900F237B2 /* Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ADF6C92250B954900F237B2 /* Navigation.swift */; };
|
||||||
@ -205,7 +205,7 @@
|
|||||||
7A9FEEC72529AB23001CA50E /* RxRealmDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RxRealmDataSource.swift; sourceTree = "<group>"; };
|
7A9FEEC72529AB23001CA50E /* RxRealmDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RxRealmDataSource.swift; sourceTree = "<group>"; };
|
||||||
7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RxSectionedDataSource.swift; sourceTree = "<group>"; };
|
7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RxSectionedDataSource.swift; sourceTree = "<group>"; };
|
||||||
7AAE6AD224CDDF950023860B /* VehicleEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleEvent.swift; sourceTree = "<group>"; };
|
7AAE6AD224CDDF950023860B /* VehicleEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleEvent.swift; sourceTree = "<group>"; };
|
||||||
7AB562B9249C9E9B00473D53 /* Region.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Region.swift; sourceTree = "<group>"; };
|
7AB562B9249C9E9B00473D53 /* VehicleRegion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleRegion.swift; sourceTree = "<group>"; };
|
||||||
7AB67E8B2435C38700258F61 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = "<group>"; };
|
7AB67E8B2435C38700258F61 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = "<group>"; };
|
||||||
7AB67E8D2435D1A000258F61 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
|
7AB67E8D2435D1A000258F61 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
|
||||||
7ADF6C92250B954900F237B2 /* Navigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Navigation.swift; sourceTree = "<group>"; };
|
7ADF6C92250B954900F237B2 /* Navigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Navigation.swift; sourceTree = "<group>"; };
|
||||||
@ -380,7 +380,7 @@
|
|||||||
7A0516192414FF0900FC55AC /* DateSection.swift */,
|
7A0516192414FF0900FC55AC /* DateSection.swift */,
|
||||||
7A6DD90D24337930009DE740 /* PlateNumber.swift */,
|
7A6DD90D24337930009DE740 /* PlateNumber.swift */,
|
||||||
7A333813249A532400D878F1 /* Filter.swift */,
|
7A333813249A532400D878F1 /* Filter.swift */,
|
||||||
7AB562B9249C9E9B00473D53 /* Region.swift */,
|
7AB562B9249C9E9B00473D53 /* VehicleRegion.swift */,
|
||||||
7A659B5824A2B1BA0043A0F2 /* AudioRecord.swift */,
|
7A659B5824A2B1BA0043A0F2 /* AudioRecord.swift */,
|
||||||
7AAE6AD224CDDF950023860B /* VehicleEvent.swift */,
|
7AAE6AD224CDDF950023860B /* VehicleEvent.swift */,
|
||||||
7A0420A925619AEC00034941 /* Osago.swift */,
|
7A0420A925619AEC00034941 /* Osago.swift */,
|
||||||
@ -601,7 +601,7 @@
|
|||||||
7A813DC32508EE4F00CC93B9 /* EventCell.swift in Sources */,
|
7A813DC32508EE4F00CC93B9 /* EventCell.swift in Sources */,
|
||||||
7A3F07AD2436350B00E59687 /* SearchController.swift in Sources */,
|
7A3F07AD2436350B00E59687 /* SearchController.swift in Sources */,
|
||||||
7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */,
|
7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */,
|
||||||
7AB562BA249C9E9B00473D53 /* Region.swift in Sources */,
|
7AB562BA249C9E9B00473D53 /* VehicleRegion.swift in Sources */,
|
||||||
7A0B96A0257D6D4B000B39AD /* MultilineLabelRow.swift in Sources */,
|
7A0B96A0257D6D4B000B39AD /* MultilineLabelRow.swift in Sources */,
|
||||||
7A659B5924A2B1BA0043A0F2 /* AudioRecord.swift in Sources */,
|
7A659B5924A2B1BA0043A0F2 /* AudioRecord.swift in Sources */,
|
||||||
7A6DD90C24335A6D009DE740 /* FlagLayer.swift in Sources */,
|
7A6DD90C24335A6D009DE740 /* FlagLayer.swift in Sources */,
|
||||||
@ -847,7 +847,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 68;
|
CURRENT_PROJECT_VERSION = 69;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
@ -871,7 +871,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 68;
|
CURRENT_PROJECT_VERSION = 69;
|
||||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
|
|||||||
@ -33,8 +33,8 @@
|
|||||||
"repositoryURL": "https://github.com/onevcat/Kingfisher",
|
"repositoryURL": "https://github.com/onevcat/Kingfisher",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "2a6d1135af3915547c4b08c3b154a05e6f1075a3",
|
"revision": "2a10bf41da75599a9f8e872dbd44fe0155a2e00c",
|
||||||
"version": "5.15.5"
|
"version": "5.15.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -51,8 +51,8 @@
|
|||||||
"repositoryURL": "https://github.com/realm/realm-cocoa",
|
"repositoryURL": "https://github.com/realm/realm-cocoa",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "2dc2d259095051b997b76a07e859822661105303",
|
"revision": "7ec5df0a700ef76ad930dcedb9c63c1b354979e1",
|
||||||
"version": "5.4.7"
|
"version": "5.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,8 +60,8 @@
|
|||||||
"repositoryURL": "https://github.com/realm/realm-core",
|
"repositoryURL": "https://github.com/realm/realm-core",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "2df510904ad04287926b287b4e89b786de2808c8",
|
"revision": "66d79b3c5213fb14d491c1b22193077b488d49a6",
|
||||||
"version": "6.1.3"
|
"version": "6.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -78,8 +78,8 @@
|
|||||||
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
|
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "002d325b0bdee94e7882e1114af5ff4fe1e96afa",
|
"revision": "254617dd7fae0c45319ba5fbea435bf4d0e15b5d",
|
||||||
"version": "5.1.1"
|
"version": "5.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -87,8 +87,8 @@
|
|||||||
"repositoryURL": "https://github.com/malcommac/SwiftDate.git",
|
"repositoryURL": "https://github.com/malcommac/SwiftDate.git",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "a25913b19833860b61fac161a706e44834f03c47",
|
"revision": "6190d0cefff3013e77ed567e6b074f324e5c5bf5",
|
||||||
"version": "6.2.0"
|
"version": "6.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -63,5 +63,149 @@
|
|||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "27C2C8D7-42E9-4B34-AB1D-A2A00B31DBA3"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "345"
|
||||||
|
endingLineNumber = "345"
|
||||||
|
landmarkName = "check(number:action:force:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "507A1EC9-C1AB-4D60-82C0-3C73D3556F79"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "341"
|
||||||
|
endingLineNumber = "341"
|
||||||
|
landmarkName = "check(number:action:force:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
<Locations>
|
||||||
|
<Location
|
||||||
|
uuid = "507A1EC9-C1AB-4D60-82C0-3C73D3556F79 - c652eeb3d8934ef5"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "closure #3 (Swift.Array<AutoCat.VehicleEvent>) throws -> () in closure #2 (Swift.Error) throws -> () in AutoCat.CheckController.check(number: Swift.String, action: AutoCat.EventAction, force: Swift.Bool) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, AutoCat.Vehicle>"
|
||||||
|
moduleName = "AutoCat"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/selim/Documents/dev/autocat/AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "329"
|
||||||
|
endingLineNumber = "329"
|
||||||
|
offsetFromSymbolStart = "109">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
uuid = "507A1EC9-C1AB-4D60-82C0-3C73D3556F79 - a8cb23139c126154"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "closure #1 () -> () in closure #3 (Swift.Array<AutoCat.VehicleEvent>) throws -> () in closure #2 (Swift.Error) throws -> () in AutoCat.CheckController.check(number: Swift.String, action: AutoCat.EventAction, force: Swift.Bool) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, AutoCat.Vehicle>"
|
||||||
|
moduleName = "AutoCat"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/selim/Documents/dev/autocat/AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "329"
|
||||||
|
endingLineNumber = "329"
|
||||||
|
offsetFromSymbolStart = "34">
|
||||||
|
</Location>
|
||||||
|
</Locations>
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "159FCAA9-1442-4DBC-964C-64C42A54C925"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "309"
|
||||||
|
endingLineNumber = "309"
|
||||||
|
landmarkName = "getEvent(for:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "EE577186-7806-4EC3-A2CB-42B9A77AF142"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "304"
|
||||||
|
endingLineNumber = "304"
|
||||||
|
landmarkName = "getEvent(for:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "FBE8EF96-3DD2-4BDA-8FBB-431343BBDB68"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "336"
|
||||||
|
endingLineNumber = "336"
|
||||||
|
landmarkName = "check(number:action:force:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
<Locations>
|
||||||
|
<Location
|
||||||
|
uuid = "FBE8EF96-3DD2-4BDA-8FBB-431343BBDB68 - ae2694a5a3b56690"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "closure #2 (AutoCat.VehicleEvent) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, Swift.Array<AutoCat.VehicleEvent>> in closure #2 (Swift.Error) throws -> () in AutoCat.CheckController.check(number: Swift.String, action: AutoCat.EventAction, force: Swift.Bool) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, AutoCat.Vehicle>"
|
||||||
|
moduleName = "AutoCat"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/selim/Documents/dev/autocat/AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "324"
|
||||||
|
endingLineNumber = "324"
|
||||||
|
offsetFromSymbolStart = "25">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
uuid = "FBE8EF96-3DD2-4BDA-8FBB-431343BBDB68 - 64aa8bf9bc307c10"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "closure #1 () -> Swift.Array<AutoCat.VehicleEvent> in closure #2 (AutoCat.VehicleEvent) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, Swift.Array<AutoCat.VehicleEvent>> in closure #2 (Swift.Error) throws -> () in AutoCat.CheckController.check(number: Swift.String, action: AutoCat.EventAction, force: Swift.Bool) -> RxSwift.PrimitiveSequence<RxSwift.SingleTrait, AutoCat.Vehicle>"
|
||||||
|
moduleName = "AutoCat"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/selim/Documents/dev/autocat/AutoCat/Controllers/CheckController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "324"
|
||||||
|
endingLineNumber = "324"
|
||||||
|
offsetFromSymbolStart = "28">
|
||||||
|
</Location>
|
||||||
|
</Locations>
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
@ -12,170 +12,191 @@
|
|||||||
<key>DifferenceKit (Playground) 1.xcscheme</key>
|
<key>DifferenceKit (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>6</integer>
|
<integer>5</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DifferenceKit (Playground) 2.xcscheme</key>
|
<key>DifferenceKit (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>7</integer>
|
<integer>6</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DifferenceKit (Playground).xcscheme</key>
|
<key>DifferenceKit (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>3</integer>
|
<integer>4</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground) 1.xcscheme</key>
|
<key>Eureka (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>2</integer>
|
<integer>8</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground) 2.xcscheme</key>
|
<key>Eureka (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>4</integer>
|
<integer>9</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground) 3.xcscheme</key>
|
<key>Eureka (Playground) 3.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>19</integer>
|
<integer>19</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground) 4.xcscheme</key>
|
<key>Eureka (Playground) 4.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>21</integer>
|
<integer>21</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground) 5.xcscheme</key>
|
<key>Eureka (Playground) 5.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>23</integer>
|
<integer>23</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Eureka (Playground).xcscheme</key>
|
<key>Eureka (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>1</integer>
|
<integer>7</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground) 1.xcscheme</key>
|
<key>GettingStarted (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>15</integer>
|
<integer>14</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground) 2.xcscheme</key>
|
<key>GettingStarted (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>17</integer>
|
<integer>15</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground) 3.xcscheme</key>
|
<key>GettingStarted (Playground) 3.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>13</integer>
|
<integer>13</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground) 4.xcscheme</key>
|
<key>GettingStarted (Playground) 4.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>16</integer>
|
<integer>16</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground) 5.xcscheme</key>
|
<key>GettingStarted (Playground) 5.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>18</integer>
|
<integer>18</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>GettingStarted (Playground).xcscheme</key>
|
<key>GettingStarted (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>12</integer>
|
<integer>13</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Rx (Playground) 1.xcscheme</key>
|
<key>Rx (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>8</integer>
|
<integer>2</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Rx (Playground) 2.xcscheme</key>
|
<key>Rx (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>9</integer>
|
<integer>3</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground) 3.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>16</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground) 4.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>17</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground) 5.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>18</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Rx (Playground).xcscheme</key>
|
<key>Rx (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>5</integer>
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 1.xcscheme</key>
|
<key>SwiftDate (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>11</integer>
|
<integer>12</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 2.xcscheme</key>
|
<key>SwiftDate (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>14</integer>
|
<integer>10</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 3.xcscheme</key>
|
<key>SwiftDate (Playground) 3.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>20</integer>
|
<integer>20</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 4.xcscheme</key>
|
<key>SwiftDate (Playground) 4.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>22</integer>
|
<integer>22</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 5.xcscheme</key>
|
<key>SwiftDate (Playground) 5.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>24</integer>
|
<integer>24</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground).xcscheme</key>
|
<key>SwiftDate (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false />
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>10</integer>
|
<integer>11</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
@ -183,7 +204,7 @@
|
|||||||
<key>7A1146FC23FDE7E500B424AF</key>
|
<key>7A1146FC23FDE7E500B424AF</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>primary</key>
|
<key>primary</key>
|
||||||
<true />
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
@ -16,12 +16,36 @@ enum AddedBy: String, CustomStringConvertible, CaseIterable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum SortParameter: String, CustomStringConvertible, CaseIterable {
|
||||||
|
case addedDate
|
||||||
|
case updatedDate
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .addedDate: return NSLocalizedString("added time", comment: "sort by added time")
|
||||||
|
case .updatedDate: return NSLocalizedString("updated time", comment: "sort by updated time")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SortOrder: String, CustomStringConvertible, CaseIterable {
|
||||||
|
case ascending
|
||||||
|
case descending
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .ascending: return NSLocalizedString("ascending", comment: "sort order")
|
||||||
|
case .descending: return NSLocalizedString("descending", comment: "sort order")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FiltersController: FormViewController {
|
class FiltersController: FormViewController {
|
||||||
|
|
||||||
var done = false
|
var done = false
|
||||||
var filter: Filter!
|
var filter: Filter!
|
||||||
var onDone: (() -> Void)?
|
var onDone: (() -> Void)?
|
||||||
var regions: [Region] = []
|
var regions: [VehicleRegion] = []
|
||||||
|
|
||||||
let bag = DisposeBag()
|
let bag = DisposeBag()
|
||||||
|
|
||||||
@ -77,6 +101,20 @@ class FiltersController: FormViewController {
|
|||||||
.onChange { self.filter.color = $0.value == "Any" ? nil : $0.value }
|
.onChange { self.filter.color = $0.value == "Any" ? nil : $0.value }
|
||||||
.cellUpdate { $1.value = self.filter.color ?? "Any" }
|
.cellUpdate { $1.value = self.filter.color ?? "Any" }
|
||||||
|
|
||||||
|
<<< PushRow<String>("Year") { row in
|
||||||
|
row.title = NSLocalizedString("Year", comment: "Manufacturing year")
|
||||||
|
row.value = self.filter.year ?? "Any"
|
||||||
|
row.optionsProvider = .lazy({ form, completion in
|
||||||
|
Api.getYears().observeOn(MainScheduler.instance).subscribe { years in
|
||||||
|
completion(["Any"] + years.map(String.init))
|
||||||
|
} onError: { error in
|
||||||
|
print("Get years error: \(error)")
|
||||||
|
}.disposed(by: self.bag)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.onChange { self.filter.year = $0.value == "Any" ? nil : $0.value }
|
||||||
|
.cellUpdate { $1.value = self.filter.year ?? "Any" }
|
||||||
|
|
||||||
form +++ Section() { $0.tag = "Regions" }
|
form +++ Section() { $0.tag = "Regions" }
|
||||||
<<< LabelRow("RegionsRow") { row in
|
<<< LabelRow("RegionsRow") { row in
|
||||||
row.title = NSLocalizedString("Regions", comment: "")
|
row.title = NSLocalizedString("Regions", comment: "")
|
||||||
@ -115,7 +153,23 @@ class FiltersController: FormViewController {
|
|||||||
row.value = self.filter.addedBy?.description ?? AddedBy.anyone.description
|
row.value = self.filter.addedBy?.description ?? AddedBy.anyone.description
|
||||||
}
|
}
|
||||||
|
|
||||||
form +++ Section(NSLocalizedString("Time range", comment: ""))
|
form +++ Section(NSLocalizedString("Update time", comment: ""))
|
||||||
|
<<< DateInlineRow("FromDateUpdated") { row in
|
||||||
|
row.title = NSLocalizedString("From", comment: "")
|
||||||
|
row.noValueDisplayText = NSLocalizedString("Beginning", comment: "")
|
||||||
|
row.value = self.filter.fromDateUpdated
|
||||||
|
}
|
||||||
|
.onChange { self.filter.fromDateUpdated = $0.value }
|
||||||
|
.cellUpdate(self.update(cell:row:))
|
||||||
|
<<< DateInlineRow("ToDateUpdated") { row in
|
||||||
|
row.title = NSLocalizedString("To", comment: "")
|
||||||
|
row.noValueDisplayText = NSLocalizedString("Now", comment: "")
|
||||||
|
row.value = self.filter.toDateUpdated
|
||||||
|
}
|
||||||
|
.onChange { self.filter.toDateUpdated = $0.value }
|
||||||
|
.cellUpdate(self.update(cell:row:))
|
||||||
|
|
||||||
|
form +++ Section(NSLocalizedString("Added time", comment: ""))
|
||||||
<<< DateInlineRow("FromDate") { row in
|
<<< DateInlineRow("FromDate") { row in
|
||||||
row.title = NSLocalizedString("From", comment: "")
|
row.title = NSLocalizedString("From", comment: "")
|
||||||
row.noValueDisplayText = NSLocalizedString("Beginning", comment: "")
|
row.noValueDisplayText = NSLocalizedString("Beginning", comment: "")
|
||||||
@ -131,6 +185,22 @@ class FiltersController: FormViewController {
|
|||||||
.onChange { self.filter.toDate = $0.value }
|
.onChange { self.filter.toDate = $0.value }
|
||||||
.cellUpdate(self.update(cell:row:))
|
.cellUpdate(self.update(cell:row:))
|
||||||
|
|
||||||
|
form +++ Section(NSLocalizedString("Sort", comment: "Header section. Noun."))
|
||||||
|
<<< PickerInlineRow<SortParameter>("SortBy") { row in
|
||||||
|
row.title = NSLocalizedString("Sort by", comment: "")
|
||||||
|
row.value = self.filter.sortBy
|
||||||
|
row.options = SortParameter.allCases
|
||||||
|
}
|
||||||
|
.onChange { self.filter.sortBy = $0.value }
|
||||||
|
.cellUpdate { $1.value = self.filter.sortBy }
|
||||||
|
<<< SegmentedRow<SortOrder>("SortOrder") { row in
|
||||||
|
row.title = NSLocalizedString("Order", comment: "sort order")
|
||||||
|
row.value = self.filter.sortOrder
|
||||||
|
row.options = SortOrder.allCases
|
||||||
|
}
|
||||||
|
.onChange { self.filter.sortOrder = $0.value }
|
||||||
|
.cellUpdate { $1.value = self.filter.sortOrder }
|
||||||
|
|
||||||
form +++ Section()
|
form +++ Section()
|
||||||
<<< ButtonRow("ClearAll") { $0.title = NSLocalizedString("Clear all filters", comment: "") }.onCellSelection { cell, row in
|
<<< ButtonRow("ClearAll") { $0.title = NSLocalizedString("Clear all filters", comment: "") }.onCellSelection { cell, row in
|
||||||
self.filter.clear()
|
self.filter.clear()
|
||||||
@ -164,7 +234,9 @@ class FiltersController: FormViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(cell: DateInlineRow.Cell, row: DateInlineRow) {
|
func update(cell: DateInlineRow.Cell, row: DateInlineRow) {
|
||||||
let date = row.tag == "FromDate" ? self.filter.fromDate : self.filter.toDate
|
guard let tag = row.tag else { return }
|
||||||
|
|
||||||
|
let date = self.date(from: tag)
|
||||||
if date != nil {
|
if date != nil {
|
||||||
let button = UIButton(type: .close)
|
let button = UIButton(type: .close)
|
||||||
button.accessibilityLabel = row.tag
|
button.accessibilityLabel = row.tag
|
||||||
@ -177,6 +249,16 @@ class FiltersController: FormViewController {
|
|||||||
row.value = date
|
row.value = date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func date(from tag: String) -> Date? {
|
||||||
|
switch tag {
|
||||||
|
case "FromDate": return self.filter.fromDate
|
||||||
|
case "ToDate": return self.filter.toDate
|
||||||
|
case "FromDateUpdated": return self.filter.fromDateUpdated
|
||||||
|
case "ToDateUpdated": return self.filter.toDateUpdated
|
||||||
|
default: return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@objc func clearDate(_ sender: UIButton) {
|
@objc func clearDate(_ sender: UIButton) {
|
||||||
guard let tag = sender.accessibilityLabel else { return }
|
guard let tag = sender.accessibilityLabel else { return }
|
||||||
guard let row = self.form.rowBy(tag: tag) as? DateInlineRow else { return }
|
guard let row = self.form.rowBy(tag: tag) as? DateInlineRow else { return }
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import RxSwift
|
import RxSwift
|
||||||
|
|
||||||
class RegionsDataSourse: UITableViewDiffableDataSource<Region, Int> {
|
class RegionsDataSourse: UITableViewDiffableDataSource<VehicleRegion, Int> {
|
||||||
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||||
return snapshot().sectionIdentifiers[section].name
|
return snapshot().sectionIdentifiers[section].name
|
||||||
}
|
}
|
||||||
@ -11,8 +11,8 @@ class RegionsController: UIViewController, UISearchResultsUpdating, UITableViewD
|
|||||||
|
|
||||||
@IBOutlet weak var tableView: UITableView!
|
@IBOutlet weak var tableView: UITableView!
|
||||||
|
|
||||||
var regions: [Region] = []
|
var regions: [VehicleRegion] = []
|
||||||
var regionsFiltered: [Region] = []
|
var regionsFiltered: [VehicleRegion] = []
|
||||||
var done = false
|
var done = false
|
||||||
var onDone: (([Int]?) -> Void)?
|
var onDone: (([Int]?) -> Void)?
|
||||||
var regionCodes: [Int] = []
|
var regionCodes: [Int] = []
|
||||||
@ -69,7 +69,7 @@ class RegionsController: UIViewController, UISearchResultsUpdating, UITableViewD
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateTableView() {
|
func updateTableView() {
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<Region, Int>()
|
var snapshot = NSDiffableDataSourceSnapshot<VehicleRegion, Int>()
|
||||||
snapshot.appendSections(self.regionsFiltered)
|
snapshot.appendSections(self.regionsFiltered)
|
||||||
for region in self.regionsFiltered {
|
for region in self.regionsFiltered {
|
||||||
snapshot.appendItems(region.codes, toSection: region)
|
snapshot.appendItems(region.codes, toSection: region)
|
||||||
|
|||||||
@ -101,6 +101,7 @@ class SearchController: UIViewController, UISearchResultsUpdating, UITableViewDe
|
|||||||
controller.filter = self.filter
|
controller.filter = self.filter
|
||||||
controller.onDone = {
|
controller.onDone = {
|
||||||
self.filter = controller.filter
|
self.filter = controller.filter
|
||||||
|
self.datasource.setSortParameter(self.filter.sortBy ?? .updatedDate)
|
||||||
self.datasource.reset()
|
self.datasource.reset()
|
||||||
self.filterRelay.accept(self.filter)
|
self.filterRelay.accept(self.filter)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,45 +3,60 @@ import SwiftDate
|
|||||||
import DifferenceKit
|
import DifferenceKit
|
||||||
|
|
||||||
protocol Dated {
|
protocol Dated {
|
||||||
var date: Date { get }
|
var added: Date { get }
|
||||||
|
var updated: Date { get }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Vehicle: Dated {
|
extension Vehicle: Dated {
|
||||||
var date: Date {
|
var updated: Date {
|
||||||
return Date(timeIntervalSince1970: self.updatedDate)
|
Date(timeIntervalSince1970: self.updatedDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
var added: Date {
|
||||||
|
Date(timeIntervalSince1970: self.addedDate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AudioRecord: Dated {
|
extension AudioRecord: Dated {
|
||||||
var date: Date {
|
var updated: Date {
|
||||||
|
Date(timeIntervalSince1970: self.getAddedDate())
|
||||||
|
}
|
||||||
|
|
||||||
|
var added: Date {
|
||||||
Date(timeIntervalSince1970: self.getAddedDate())
|
Date(timeIntervalSince1970: self.getAddedDate())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension RandomAccessCollection where Element: Dated & Hashable & Differentiable {
|
extension RandomAccessCollection where Element: Dated & Hashable & Differentiable {
|
||||||
func groupedByDate() -> [DateSection<Element>] {
|
func groupedByDate(type: SortParameter = .updatedDate) -> [DateSection<Element>] {
|
||||||
let now = Date()
|
let now = Date()
|
||||||
let monthStart = now.dateAtStartOf(.month)
|
let monthStart = now.dateAtStartOf(.month)
|
||||||
var sections: [TimeInterval: [Element]] = [:]
|
var sectionsIndices: [TimeInterval: Int] = [:]
|
||||||
|
var sectionsArray: [DateSection<Element>] = []
|
||||||
for vehicle in self {
|
for vehicle in self {
|
||||||
let date = vehicle.date
|
let date = self.date(of: type, for: vehicle)
|
||||||
var key = date.dateAtStartOf(.day).timeIntervalSince1970
|
let dateInRegion = DateInRegion(date, region: Region.current)
|
||||||
|
|
||||||
|
var key = dateInRegion.dateAtStartOf(.day).timeIntervalSince1970
|
||||||
if date.isBeforeDate(monthStart, orEqual: false, granularity: .day) {
|
if date.isBeforeDate(monthStart, orEqual: false, granularity: .day) {
|
||||||
key = date.dateAtStartOf(.month).timeIntervalSince1970
|
key = dateInRegion.dateAtStartOf(.month).timeIntervalSince1970
|
||||||
}
|
}
|
||||||
|
|
||||||
if sections[key] == nil {
|
if let index = sectionsIndices[key] {
|
||||||
sections[key] = [vehicle]
|
sectionsArray[index].append(vehicle)
|
||||||
} else {
|
} else {
|
||||||
sections[key]?.append(vehicle)
|
sectionsArray.append(DateSection<Element>(timestamp: key, items: [vehicle]))
|
||||||
|
sectionsIndices[key] = sectionsArray.count - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var sectionsArray: [DateSection<Element>] = []
|
return sectionsArray
|
||||||
for (timestamp, vehicles) in sections {
|
}
|
||||||
sectionsArray.append(DateSection<Element>(timestamp: timestamp, items: vehicles))
|
|
||||||
|
func date(of type: SortParameter, for object: Dated) -> Date {
|
||||||
|
switch type {
|
||||||
|
case .addedDate: return object.added
|
||||||
|
case .updatedDate: return object.updated
|
||||||
}
|
}
|
||||||
|
|
||||||
return sectionsArray.sorted { $0.timestamp > $1.timestamp }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ struct DateSection<T>: Differentiable, DifferentiableSection, Hashable where T:
|
|||||||
formatter.timeStyle = .none
|
formatter.timeStyle = .none
|
||||||
self.header = formatter.string(from: date)
|
self.header = formatter.string(from: date)
|
||||||
} else {
|
} else {
|
||||||
formatter.dateFormat = "MMMM yyyy"
|
formatter.dateFormat = "LLLL yyyy"
|
||||||
self.header = formatter.string(from: date)
|
self.header = formatter.string(from: date)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +50,10 @@ struct DateSection<T>: Differentiable, DifferentiableSection, Hashable where T:
|
|||||||
self.elements = items
|
self.elements = items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutating func append(_ element: T) {
|
||||||
|
self.elements.append(element)
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Differentiable
|
// MARK: - Differentiable
|
||||||
|
|
||||||
var differenceIdentifier: String {
|
var differenceIdentifier: String {
|
||||||
@ -60,7 +64,7 @@ struct DateSection<T>: Differentiable, DifferentiableSection, Hashable where T:
|
|||||||
return self.differenceIdentifier == source.differenceIdentifier
|
return self.differenceIdentifier == source.differenceIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Hasable
|
// MARK: - Hashable
|
||||||
|
|
||||||
static func == (lhs: DateSection<T>, rhs: DateSection<T>) -> Bool {
|
static func == (lhs: DateSection<T>, rhs: DateSection<T>) -> Bool {
|
||||||
return lhs.timestamp == rhs.timestamp && lhs.elements == rhs.elements
|
return lhs.timestamp == rhs.timestamp && lhs.elements == rhs.elements
|
||||||
|
|||||||
@ -5,19 +5,29 @@ struct Filter {
|
|||||||
var brand: String?
|
var brand: String?
|
||||||
var model: String?
|
var model: String?
|
||||||
var color: String?
|
var color: String?
|
||||||
|
var year: String?
|
||||||
var regions: [Int]?
|
var regions: [Int]?
|
||||||
var addedBy: AddedBy?
|
var addedBy: AddedBy?
|
||||||
|
var sortBy: SortParameter? = .updatedDate
|
||||||
|
var sortOrder: SortOrder? = .descending
|
||||||
var fromDate: Date?
|
var fromDate: Date?
|
||||||
var toDate: Date?
|
var toDate: Date?
|
||||||
|
var fromDateUpdated: Date?
|
||||||
|
var toDateUpdated: Date?
|
||||||
|
|
||||||
mutating func clear() {
|
mutating func clear() {
|
||||||
self.brand = nil
|
self.brand = nil
|
||||||
self.model = nil
|
self.model = nil
|
||||||
self.color = nil
|
self.color = nil
|
||||||
|
self.year = nil
|
||||||
self.regions = nil
|
self.regions = nil
|
||||||
self.addedBy = nil
|
self.addedBy = nil
|
||||||
|
self.sortBy = .addedDate
|
||||||
|
self.sortOrder = .descending
|
||||||
self.fromDate = nil
|
self.fromDate = nil
|
||||||
self.toDate = nil
|
self.toDate = nil
|
||||||
|
self.fromDateUpdated = nil
|
||||||
|
self.toDateUpdated = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func queryDictionary() -> [String: String] {
|
func queryDictionary() -> [String: String] {
|
||||||
@ -32,18 +42,33 @@ struct Filter {
|
|||||||
if let color = self.color {
|
if let color = self.color {
|
||||||
dict["color"] = color
|
dict["color"] = color
|
||||||
}
|
}
|
||||||
|
if let year = self.year {
|
||||||
|
dict["year"] = year
|
||||||
|
}
|
||||||
if let regions = self.regions {
|
if let regions = self.regions {
|
||||||
dict["regions"] = regions.map(String.init).joined(separator: ",")
|
dict["regions"] = regions.map(String.init).joined(separator: ",")
|
||||||
}
|
}
|
||||||
if let addedBy = self.addedBy {
|
if let addedBy = self.addedBy {
|
||||||
dict["addedBy"] = addedBy.rawValue
|
dict["addedBy"] = addedBy.rawValue
|
||||||
}
|
}
|
||||||
|
if let sortBy = self.sortBy {
|
||||||
|
dict["sortBy"] = sortBy.rawValue
|
||||||
|
}
|
||||||
|
if let sortOrder = self.sortOrder {
|
||||||
|
dict["sortOrder"] = sortOrder.rawValue
|
||||||
|
}
|
||||||
if let fromDate = self.fromDate {
|
if let fromDate = self.fromDate {
|
||||||
dict["fromDate"] = String(fromDate.timeIntervalSince1970)
|
dict["fromDate"] = String(fromDate.timeIntervalSince1970)
|
||||||
}
|
}
|
||||||
if let toDate = self.toDate {
|
if let toDate = self.toDate {
|
||||||
dict["toDate"] = String(toDate.timeIntervalSince1970)
|
dict["toDate"] = String(toDate.timeIntervalSince1970)
|
||||||
}
|
}
|
||||||
|
if let fromDateUpdated = self.fromDateUpdated {
|
||||||
|
dict["fromDateUpdated"] = String(fromDateUpdated.timeIntervalSince1970)
|
||||||
|
}
|
||||||
|
if let toDateUpdated = self.toDateUpdated {
|
||||||
|
dict["toDateUpdated"] = String(toDateUpdated.timeIntervalSince1970)
|
||||||
|
}
|
||||||
|
|
||||||
return dict
|
return dict
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
import Foundation
|
|
||||||
|
|
||||||
struct Region: Codable, Hashable {
|
|
||||||
var name: String
|
|
||||||
var codes: [Int]
|
|
||||||
|
|
||||||
static func == (lhs: Region, rhs: Region) -> Bool {
|
|
||||||
return lhs.name == rhs.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
10
AutoCat/Models/VehicleRegion.swift
Normal file
10
AutoCat/Models/VehicleRegion.swift
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
struct VehicleRegion: Codable, Hashable {
|
||||||
|
var name: String
|
||||||
|
var codes: [Int]
|
||||||
|
|
||||||
|
static func == (lhs: VehicleRegion, rhs: VehicleRegion) -> Bool {
|
||||||
|
return lhs.name == rhs.name
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -116,7 +116,7 @@ class Api {
|
|||||||
guard let json = resp as? [String: Any] else { return }
|
guard let json = resp as? [String: Any] else { return }
|
||||||
if let newToken = json["id_token"] as? String {
|
if let newToken = json["id_token"] as? String {
|
||||||
Settings.shared.user.firebaseIdToken = newToken
|
Settings.shared.user.firebaseIdToken = newToken
|
||||||
print("Token was successfully refresh to: \(newToken)")
|
//print("Token was successfully refresh to: \(newToken)")
|
||||||
}
|
}
|
||||||
if let newRefreshToken = json["refresh_token"] as? String {
|
if let newRefreshToken = json["refresh_token"] as? String {
|
||||||
Settings.shared.user.firebaseRefreshToken = newRefreshToken
|
Settings.shared.user.firebaseRefreshToken = newRefreshToken
|
||||||
@ -241,10 +241,14 @@ class Api {
|
|||||||
return self.makeEmptyGetRequest(api: "vehicles/colors")
|
return self.makeEmptyGetRequest(api: "vehicles/colors")
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func getRegions() -> Single<[Region]> {
|
public static func getRegions() -> Single<[VehicleRegion]> {
|
||||||
return self.makeEmptyGetRequest(api: "vehicles/regions")
|
return self.makeEmptyGetRequest(api: "vehicles/regions")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static func getYears() -> Single<[Int]> {
|
||||||
|
return self.makeEmptyGetRequest(api: "vehicles/years")
|
||||||
|
}
|
||||||
|
|
||||||
public static func add(event: VehicleEvent, to number: String) -> Single<Vehicle> {
|
public static func add(event: VehicleEvent, to number: String) -> Single<Vehicle> {
|
||||||
let body = ["number": AnyEncodable(number), "event": AnyEncodable(event)]
|
let body = ["number": AnyEncodable(number), "event": AnyEncodable(event)]
|
||||||
return self.makeBodyRequest(api: "events", body: body).map { (vehicle: Vehicle) -> Vehicle in
|
return self.makeBodyRequest(api: "events", body: body).map { (vehicle: Vehicle) -> Vehicle in
|
||||||
|
|||||||
@ -8,6 +8,7 @@ class RxSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource where I
|
|||||||
private var cellIdentifier: String
|
private var cellIdentifier: String
|
||||||
private var sections: [DateSection<Item>] = []
|
private var sections: [DateSection<Item>] = []
|
||||||
private var items: [Item] = []
|
private var items: [Item] = []
|
||||||
|
private var sortParam: SortParameter = .updatedDate
|
||||||
private(set) var pageToken: String? = nil
|
private(set) var pageToken: String? = nil
|
||||||
private(set) var count: Int? = nil
|
private(set) var count: Int? = nil
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ class RxSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource where I
|
|||||||
}
|
}
|
||||||
self.pageToken = data.pageToken
|
self.pageToken = data.pageToken
|
||||||
|
|
||||||
let newSections = self.items.groupedByDate()
|
let newSections = self.items.groupedByDate(type: self.sortParam)
|
||||||
let changeset = StagedChangeset(source: self.sections, target: newSections)
|
let changeset = StagedChangeset(source: self.sections, target: newSections)
|
||||||
self.tv.reload(using: changeset, with: .automatic) { newSects in
|
self.tv.reload(using: changeset, with: .automatic) { newSects in
|
||||||
self.sections = newSects
|
self.sections = newSects
|
||||||
@ -80,4 +81,8 @@ class RxSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource where I
|
|||||||
self.count = nil
|
self.count = nil
|
||||||
self.items = []
|
self.items = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setSortParameter(_ param: SortParameter) {
|
||||||
|
self.sortParam = param
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,12 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Added by" = "Добавлено";
|
"Added by" = "Добавлено";
|
||||||
|
|
||||||
|
/* sort by added time */
|
||||||
|
"added time" = "времени добавления";
|
||||||
|
|
||||||
|
/* No comment provided by engineer. */
|
||||||
|
"Added time" = "Время добавления";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Ads" = "Объявления";
|
"Ads" = "Объявления";
|
||||||
|
|
||||||
@ -40,6 +46,9 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"As text and photos" = "В виде текста и фотографий";
|
"As text and photos" = "В виде текста и фотографий";
|
||||||
|
|
||||||
|
/* sort order */
|
||||||
|
"ascending" = "по возростанию";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"AutoCat Account" = "Аккаунт в АвтоКот";
|
"AutoCat Account" = "Аккаунт в АвтоКот";
|
||||||
|
|
||||||
@ -112,6 +121,9 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Delete" = "Удалить";
|
"Delete" = "Удалить";
|
||||||
|
|
||||||
|
/* sort order */
|
||||||
|
"descending" = "по убыванию";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Description" = "Описание";
|
"Description" = "Описание";
|
||||||
|
|
||||||
@ -217,6 +229,9 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Number" = "Номер";
|
"Number" = "Номер";
|
||||||
|
|
||||||
|
/* sort order */
|
||||||
|
"Order" = "Порядок";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"OSAGO" = "ОСАГО";
|
"OSAGO" = "ОСАГО";
|
||||||
|
|
||||||
@ -322,15 +337,18 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Sign Out" = "Выйти";
|
"Sign Out" = "Выйти";
|
||||||
|
|
||||||
|
/* Header section. Noun. */
|
||||||
|
"Sort" = "Сортировка";
|
||||||
|
|
||||||
|
/* No comment provided by engineer. */
|
||||||
|
"Sort by" = "Сортировать по";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Steering wheel position" = "Положение руля";
|
"Steering wheel position" = "Положение руля";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"STS" = "СТС";
|
"STS" = "СТС";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
|
||||||
"Time range" = "Временной промежуток";
|
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"To" = "По";
|
"To" = "По";
|
||||||
|
|
||||||
@ -343,6 +361,12 @@
|
|||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Update" = "Обновить";
|
"Update" = "Обновить";
|
||||||
|
|
||||||
|
/* No comment provided by engineer. */
|
||||||
|
"Update time" = "Время обновления";
|
||||||
|
|
||||||
|
/* sort by updated time */
|
||||||
|
"updated time" = "времени обновления";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Vehicle region" = "Регион регистрации ТС";
|
"Vehicle region" = "Регион регистрации ТС";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user