From e83bfa3f1240d12c6a0a305f9b619cdd3a151483 Mon Sep 17 00:00:00 2001 From: Mehdi Mirzaie Date: Sat, 17 Jul 2021 18:59:40 +0430 Subject: [PATCH] fix crash when showing traffic monitor --- .../Extension/UIStoryBoard+Extension.swift | 2 +- .../UI/Cells/ActionableTableViewCell.xib | 4 +-- Sources/NetShears/UI/Cells/RequestCell.xib | 26 +++++-------------- .../NetShears/UI/Cells/TextTableViewCell.xib | 4 +-- Sources/NetShears/UI/Flow.storyboard | 8 +++--- .../UI/RequestDetailViewController.swift | 6 ++--- .../UI/RequestListViewController.swift | 3 +-- .../UI/Sections/RequestTitleSectionView.xib | 4 +-- Sources/NetShears/Utils/NSHelper.swift | 2 +- 9 files changed, 22 insertions(+), 37 deletions(-) diff --git a/Sources/NetShears/Extension/UIStoryBoard+Extension.swift b/Sources/NetShears/Extension/UIStoryBoard+Extension.swift index b2d29d1..17e7c65 100644 --- a/Sources/NetShears/Extension/UIStoryBoard+Extension.swift +++ b/Sources/NetShears/Extension/UIStoryBoard+Extension.swift @@ -9,6 +9,6 @@ import UIKit extension UIStoryboard { static var NetShearsStoryBoard: UIStoryboard { - return UIStoryboard(name: "Flow", bundle: Bundle.NetShearsBundle) + return UIStoryboard(name: "Flow", bundle: Bundle.module) } } diff --git a/Sources/NetShears/UI/Cells/ActionableTableViewCell.xib b/Sources/NetShears/UI/Cells/ActionableTableViewCell.xib index e0192cc..8fed870 100644 --- a/Sources/NetShears/UI/Cells/ActionableTableViewCell.xib +++ b/Sources/NetShears/UI/Cells/ActionableTableViewCell.xib @@ -9,14 +9,14 @@ - + - - - - - - - - - - - - - - - diff --git a/Sources/NetShears/UI/Cells/TextTableViewCell.xib b/Sources/NetShears/UI/Cells/TextTableViewCell.xib index c3216d6..1126e55 100644 --- a/Sources/NetShears/UI/Cells/TextTableViewCell.xib +++ b/Sources/NetShears/UI/Cells/TextTableViewCell.xib @@ -11,14 +11,14 @@ - + - + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. diff --git a/Sources/NetShears/UI/Flow.storyboard b/Sources/NetShears/UI/Flow.storyboard index 09632fe..ddfcf8d 100644 --- a/Sources/NetShears/UI/Flow.storyboard +++ b/Sources/NetShears/UI/Flow.storyboard @@ -12,7 +12,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -95,7 +95,7 @@ - + diff --git a/Sources/NetShears/UI/RequestDetailViewController.swift b/Sources/NetShears/UI/RequestDetailViewController.swift index a560d9b..fafefea 100644 --- a/Sources/NetShears/UI/RequestDetailViewController.swift +++ b/Sources/NetShears/UI/RequestDetailViewController.swift @@ -41,9 +41,9 @@ final class RequestDetailViewController: UIViewController, ShowLoaderProtocol { tableView.estimatedRowHeight = 100.0 tableView.rowHeight = UITableView.automaticDimension - tableView.register(UINib(nibName: "TextTableViewCell", bundle: Bundle.NetShearsBundle), forCellReuseIdentifier: "TextTableViewCell") - tableView.register(UINib(nibName: "ActionableTableViewCell", bundle: Bundle.NetShearsBundle), forCellReuseIdentifier: "ActionableTableViewCell") - tableView.register(UINib(nibName: "RequestTitleSectionView", bundle: Bundle.NetShearsBundle), forHeaderFooterViewReuseIdentifier: "RequestTitleSectionView") + tableView.register(UINib(nibName: "TextTableViewCell", bundle: Bundle.module), forCellReuseIdentifier: "TextTableViewCell") + tableView.register(UINib(nibName: "ActionableTableViewCell", bundle: Bundle.module), forCellReuseIdentifier: "ActionableTableViewCell") + tableView.register(UINib(nibName: "RequestTitleSectionView", bundle: Bundle.module), forHeaderFooterViewReuseIdentifier: "RequestTitleSectionView") } override func didReceiveMemoryWarning() { diff --git a/Sources/NetShears/UI/RequestListViewController.swift b/Sources/NetShears/UI/RequestListViewController.swift index c3e6fba..e01fc61 100644 --- a/Sources/NetShears/UI/RequestListViewController.swift +++ b/Sources/NetShears/UI/RequestListViewController.swift @@ -12,7 +12,6 @@ import UIKit class RequestsViewController: UIViewController, ShowLoaderProtocol { @IBOutlet weak var collectionView: UICollectionView! - @IBOutlet weak var request: UICollectionView! private var filteredRequests: [NetShearsRequestModel] = Storage.shared.requests @@ -39,7 +38,7 @@ class RequestsViewController: UIViewController, ShowLoaderProtocol { } private func registerNibs() { - collectionView?.register(UINib(nibName: String(describing: RequestCell.self), bundle: Bundle.NetShearsBundle), forCellWithReuseIdentifier: requestCellIdentifier) + collectionView?.register(UINib(nibName: String(describing: RequestCell.self), bundle: Bundle.module), forCellWithReuseIdentifier: requestCellIdentifier) } // MARK: - Search diff --git a/Sources/NetShears/UI/Sections/RequestTitleSectionView.xib b/Sources/NetShears/UI/Sections/RequestTitleSectionView.xib index 3c44833..2390fc3 100644 --- a/Sources/NetShears/UI/Sections/RequestTitleSectionView.xib +++ b/Sources/NetShears/UI/Sections/RequestTitleSectionView.xib @@ -11,14 +11,14 @@ - + -