diff --git a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 6d33410..0aab7da 100644
--- a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -8,7 +8,7 @@
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
@@ -17,7 +17,7 @@
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
+
+
+
+
diff --git a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist
index 7cd6e44..322f075 100644
--- a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -14,21 +14,21 @@
isShown
orderHint
- 3
+ 2
Eureka (Playground) 2.xcscheme
isShown
orderHint
- 4
+ 3
Eureka (Playground).xcscheme
isShown
orderHint
- 2
+ 1
GettingStarted (Playground) 1.xcscheme
@@ -70,42 +70,42 @@
isShown
orderHint
- 10
+ 8
Rx (Playground) 1.xcscheme
isShown
orderHint
- 6
+ 5
Rx (Playground) 2.xcscheme
isShown
orderHint
- 7
+ 6
Rx (Playground).xcscheme
isShown
orderHint
- 5
+ 4
SwiftDate (Playground) 1.xcscheme
isShown
orderHint
- 8
+ 9
SwiftDate (Playground) 2.xcscheme
isShown
orderHint
- 9
+ 10
SwiftDate (Playground) 3.xcscheme
@@ -133,7 +133,7 @@
isShown
orderHint
- 1
+ 7
SuppressBuildableAutocreation
diff --git a/AutoCat/Controllers/CheckController.swift b/AutoCat/Controllers/CheckController.swift
index 974a61b..a34bcb4 100644
--- a/AutoCat/Controllers/CheckController.swift
+++ b/AutoCat/Controllers/CheckController.swift
@@ -98,8 +98,8 @@ class CheckController: UIViewController, UITableViewDelegate, UITextFieldDelegat
self.number.resignFirstResponder()
self.number.text = nil
self.check.isEnabled = false
- IHProgressHUD.show()
+ IHProgressHUD.show()
self.check(number: numberNormalized, action: .receiveAndSend).subscribe { vehicle in
self.updateDetailController(with: vehicle)
IHProgressHUD.dismiss()
diff --git a/AutoCat/ThirdParty/IHProgressHUD/IHProgressHUD.swift b/AutoCat/ThirdParty/IHProgressHUD/IHProgressHUD.swift
index 3d4d66c..0e3ff45 100755
--- a/AutoCat/ThirdParty/IHProgressHUD/IHProgressHUD.swift
+++ b/AutoCat/ThirdParty/IHProgressHUD/IHProgressHUD.swift
@@ -881,6 +881,11 @@ public class IHProgressHUD : UIView {
windowLevelSupported = win.windowLevel >= UIWindow.Level.normal && win.windowLevel <= maxSupportedWindowLevel
let windowKeyWindow = win.isKeyWindow
+ print("=====================================")
+ print("windowOnMainScreen: \(windowOnMainScreen)")
+ print("windowIsVisible: \(windowIsVisible)")
+ print("windowLevelSupported: \(windowLevelSupported)")
+ print("windowKeyWindow: \(windowKeyWindow)")
if windowOnMainScreen && windowIsVisible && windowLevelSupported && windowKeyWindow {
return win
diff --git a/AutoCat/Utils/RxRealmDataSource.swift b/AutoCat/Utils/RxRealmDataSource.swift
index 901a42d..f31b12d 100644
--- a/AutoCat/Utils/RxRealmDataSource.swift
+++ b/AutoCat/Utils/RxRealmDataSource.swift
@@ -22,17 +22,19 @@ class RealmSectionedDataSource- : NSObject, UITableViewDataSource where
case .initial:
self.sections = self.data.groupedByDate()
self.tv.reloadData()
- case .update(_, let deletions, let insertions, let modifications):
- print("Deletions: \(deletions.count), Insertions: \(insertions.count), Modifications: \(modifications.count)")
- let newSections = self.data.groupedByDate()
- let diff = newSections.difference(from: self.sections)
-
+ case .update(_, let deletions, let insertions, let modifications):
self.tv.beginUpdates()
let delPaths = deletions.map(self.indexPath)
- self.tv.deleteRows(at: delPaths, with: .automatic)
- //diff.filter { if case .remove = $0 }
+ self.tv.deleteRows(at: deletions.map(self.indexPath), with: .automatic)
+ if let delPath = delPaths.first, self.sections[delPath.section].items.count == 1 {
+ self.tv.deleteSections(IndexSet(integer: delPath.section), with: .automatic)
+ }
self.sections = self.data.groupedByDate()
- self.tv.insertRows(at: insertions.map(self.indexPath), with: .automatic)
+ let insPaths = insertions.map(self.indexPath)
+ if let insPath = insPaths.first, self.sections[insPath.section].items.count == 1 {
+ self.tv.insertSections(IndexSet(integer: insPath.section), with: .automatic)
+ }
+ self.tv.insertRows(at: insPaths, with: .automatic)
self.tv.reloadRows(at: modifications.map(self.indexPath), with: .automatic)
self.tv.endUpdates()
case .error(let err):