Skip to content

Commit

Permalink
fix crash when showing traffic monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdiimrz committed Jul 17, 2021
1 parent 5e4aa86 commit e83bfa3
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Sources/NetShears/Extension/UIStoryBoard+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
4 changes: 2 additions & 2 deletions Sources/NetShears/UI/Cells/ActionableTableViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="ActionableTableViewCell" id="hnf-hX-ryf" customClass="ActionableTableViewCell" customModule="Wormholy" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="ActionableTableViewCell" id="hnf-hX-ryf" customClass="ActionableTableViewCell" customModule="NetShears">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="hnf-hX-ryf" id="P0J-Zx-FWR">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4S6-rN-Zhf" customClass="NSLabel" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4S6-rN-Zhf" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="8" y="0.0" width="359" height="44"/>
<constraints>
<constraint firstAttribute="height" priority="750" constant="44" id="pYN-bO-gZx"/>
Expand Down
26 changes: 6 additions & 20 deletions Sources/NetShears/UI/Cells/RequestCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="RequestCell" id="A3c-1c-xAq" customClass="RequestCell" customModule="Divar" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="RequestCell" id="A3c-1c-xAq" customClass="RequestCell" customModule="NetShears">
<rect key="frame" x="0.0" y="0.0" width="432" height="146"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
Expand All @@ -27,14 +27,14 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="top" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="qYn-tG-enh">
<rect key="frame" x="0.0" y="0.0" width="80" height="130"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="METHOD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hvP-NF-g2J" customClass="NSLabel" customModule="Divar" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="METHOD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hvP-NF-g2J" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="0.0" y="0.0" width="66.5" height="40.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CODE" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jmr-Ta-RoN" customClass="NSLabel" customModule="Divar" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="54" height="41"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CODE" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jmr-Ta-RoN" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="0.0" y="44.5" width="42" height="41"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand All @@ -50,7 +50,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="duration" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wzf-5k-iHI" customClass="NSLabel" customModule="Divar" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="duration" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wzf-5k-iHI" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="0.0" y="89.5" width="57" height="40.5"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
Expand All @@ -61,7 +61,7 @@
<constraint firstAttribute="width" constant="80" id="Sd8-Uy-wXT"/>
</constraints>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="https://jsonplaceholder.typicode.com/wrongURL/" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="70z-Jd-XUy" customClass="WHLabel" customModule="Divar" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="https://jsonplaceholder.typicode.com/wrongURL/" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="70z-Jd-XUy" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="84" y="0.0" width="332" height="130"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -96,20 +96,6 @@
<point key="canvasLocation" x="204.80000000000001" y="16.191904047976013"/>
</collectionViewCell>
</objects>
<designables>
<designable name="70z-Jd-XUy">
<size key="intrinsicContentSize" width="333.5" height="18"/>
</designable>
<designable name="Wzf-5k-iHI">
<size key="intrinsicContentSize" width="57" height="18"/>
</designable>
<designable name="hvP-NF-g2J">
<size key="intrinsicContentSize" width="66.5" height="18"/>
</designable>
<designable name="jmr-Ta-RoN">
<size key="intrinsicContentSize" width="54" height="30"/>
</designable>
</designables>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
4 changes: 2 additions & 2 deletions Sources/NetShears/UI/Cells/TextTableViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell opaque="NO" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="187" id="KGk-i7-Jjw" customClass="TextTableViewCell" customModule="Wormholy" customModuleProvider="target">
<tableViewCell opaque="NO" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="187" id="KGk-i7-Jjw" customClass="TextTableViewCell" customModule="NetShears">
<rect key="frame" x="0.0" y="0.0" width="320" height="187"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="187"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Sg-a4-E3f" customClass="NSTextView" customModuleProvider="target">
<textView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Sg-a4-E3f" customClass="NSTextView" customModule="NetShears">
<rect key="frame" x="8" y="8" width="304" height="171"/>
<string key="text">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.</string>
<color key="textColor" systemColor="labelColor"/>
Expand Down
8 changes: 4 additions & 4 deletions Sources/NetShears/UI/Flow.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--Requests-->
<scene sceneID="bMY-jK-aiL">
<objects>
<viewController storyboardIdentifier="RequestsViewController" automaticallyAdjustsScrollViewInsets="NO" id="hrW-Yh-eEJ" customClass="RequestsViewController" customModule="Divar" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="RequestsViewController" automaticallyAdjustsScrollViewInsets="NO" id="hrW-Yh-eEJ" customClass="RequestsViewController" customModule="NetShears" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="NrO-gO-tFr">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down Expand Up @@ -44,7 +44,7 @@
</view>
<navigationItem key="navigationItem" title="Requests" id="0te-N4-NBT"/>
<connections>
<outlet property="collectionView" destination="v4V-Us-h8K" id="gOb-1m-oHE"/>
<outlet property="collectionView" destination="v4V-Us-h8K" id="3Av-Rc-GCi"/>
<segue destination="oCq-W9-inr" kind="show" identifier="showRequestDetailVC" id="CHW-0s-7Ks"/>
</connections>
</viewController>
Expand All @@ -55,7 +55,7 @@
<!--Request Detail View Controller-->
<scene sceneID="JaV-AO-yRE">
<objects>
<viewController storyboardIdentifier="RequestDetailViewController" automaticallyAdjustsScrollViewInsets="NO" id="oCq-W9-inr" customClass="RequestDetailViewController" customModule="Divar" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="RequestDetailViewController" automaticallyAdjustsScrollViewInsets="NO" id="oCq-W9-inr" customClass="RequestDetailViewController" customModule="NetShears" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="dxP-Gd-tGS">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down Expand Up @@ -95,7 +95,7 @@
<!--Body Detail View Controller-->
<scene sceneID="FPQ-PL-XiD">
<objects>
<viewController storyboardIdentifier="BodyDetailViewController" automaticallyAdjustsScrollViewInsets="NO" id="S40-LP-XSy" customClass="BodyDetailViewController" customModule="Divar" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="BodyDetailViewController" automaticallyAdjustsScrollViewInsets="NO" id="S40-LP-XSy" customClass="BodyDetailViewController" customModule="NetShears" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="k01-uv-JVw">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down
6 changes: 3 additions & 3 deletions Sources/NetShears/UI/RequestDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 1 addition & 2 deletions Sources/NetShears/UI/RequestListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/NetShears/UI/Sections/RequestTitleSectionView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view opaque="NO" contentMode="scaleToFill" id="iN0-l3-epB" customClass="RequestTitleSectionView" customModule="Wormholy" customModuleProvider="target">
<view opaque="NO" contentMode="scaleToFill" id="iN0-l3-epB" customClass="RequestTitleSectionView" customModule="NetShears">
<rect key="frame" x="0.0" y="0.0" width="375" height="37"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gYL-JN-u4T">
<rect key="frame" x="0.0" y="0.0" width="375" height="37"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a4W-hf-6YA" customClass="NSLabel" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a4W-hf-6YA" customClass="NSLabel" customModule="NetShears">
<rect key="frame" x="16" y="8" width="343" height="21"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="MVr-Es-NpE"/>
Expand Down
Loading

0 comments on commit e83bfa3

Please sign in to comment.