Skip to content

Commit 2be4862

Browse files
committed
Print WiFi data used under SSID.
1 parent 5ef72c0 commit 2be4862

File tree

8 files changed

+38
-17
lines changed

8 files changed

+38
-17
lines changed

IP Address WatchOS Extension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>116</string>
22+
<string>120</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

IP Address WatchOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>116</string>
22+
<string>120</string>
2323
<key>UISupportedInterfaceOrientations</key>
2424
<array>
2525
<string>UIInterfaceOrientationPortrait</string>

IP Address/Base.lproj/LaunchScreen.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2222
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 116 (9c4e889)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 120 (5ef72c0)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
2525
<rect key="frame" x="132.5" y="527" width="55.5" height="21"/>
2626
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2727
<nil key="textColor"/>

IP Address/Base.lproj/LaunchScreen.storyboardbak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2222
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 115 (9c4e889)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 119 (5ef72c0)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
2525
<rect key="frame" x="132.5" y="527" width="55.5" height="21"/>
2626
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2727
<nil key="textColor"/>

IP Address/Base.lproj/Main.storyboard

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
33
<device id="retina5_5" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.9"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
99
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
1010
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1111
</dependencies>
@@ -21,14 +21,25 @@
2121
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="aXX-aH-RTQ">
2222
<rect key="frame" x="0.0" y="20" width="414" height="706"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ssid" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="anq-wf-6bz" userLabel="ssid Label">
25-
<rect key="frame" x="0.0" y="0.0" width="414" height="31.333333333333332"/>
26-
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
27-
<nil key="textColor"/>
28-
<nil key="highlightedColor"/>
29-
</label>
24+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Em2-RW-9y7">
25+
<rect key="frame" x="0.0" y="0.0" width="414" height="40.666666666666664"/>
26+
<subviews>
27+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ssid" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="anq-wf-6bz" userLabel="ssid Label">
28+
<rect key="frame" x="0.0" y="0.0" width="414" height="20.333333333333332"/>
29+
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
30+
<nil key="textColor"/>
31+
<nil key="highlightedColor"/>
32+
</label>
33+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="wifi" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IDt-2P-CEV">
34+
<rect key="frame" x="0.0" y="20.333333333333336" width="414" height="20.333333333333336"/>
35+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
36+
<nil key="textColor"/>
37+
<nil key="highlightedColor"/>
38+
</label>
39+
</subviews>
40+
</stackView>
3041
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="ATv-ck-YdY">
31-
<rect key="frame" x="0.0" y="31.333333333333314" width="414" height="623.33333333333348"/>
42+
<rect key="frame" x="0.0" y="40.666666666666686" width="414" height="614"/>
3243
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
3344
<prototypes>
3445
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="4Ib-w1-KsL" detailTextLabel="3gV-GT-tPw" style="IBUITableViewCellStyleValue1" id="wGa-uZ-JhJ">
@@ -121,6 +132,11 @@
121132
</subviews>
122133
</stackView>
123134
</subviews>
135+
<constraints>
136+
<constraint firstItem="Em2-RW-9y7" firstAttribute="leading" secondItem="aXX-aH-RTQ" secondAttribute="leading" id="8Z8-Y3-EX2"/>
137+
<constraint firstItem="Em2-RW-9y7" firstAttribute="centerX" secondItem="aXX-aH-RTQ" secondAttribute="centerX" id="BSa-WS-R4q"/>
138+
<constraint firstAttribute="trailing" secondItem="Em2-RW-9y7" secondAttribute="trailing" id="XV8-3y-lmp"/>
139+
</constraints>
124140
</stackView>
125141
</subviews>
126142
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -139,6 +155,7 @@
139155
<outlet property="linkLayerfilterSwitch" destination="6Ys-Jh-a0y" id="eEf-5X-skh"/>
140156
<outlet property="ssidLabel" destination="anq-wf-6bz" id="8Db-Q6-CKW"/>
141157
<outlet property="tableView" destination="ATv-ck-YdY" id="aCH-cM-tuT"/>
158+
<outlet property="wifiUsageLabel" destination="IDt-2P-CEV" id="NOr-vb-n5b"/>
142159
</connections>
143160
</viewController>
144161
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>

IP Address/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundleShortVersionString</key>
1818
<string>1.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>116</string>
20+
<string>120</string>
2121
<key>ITSAppUsesNonExemptEncryption</key>
2222
<false/>
2323
<key>LSRequiresIPhoneOS</key>

IP Address/ViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
1818
@IBOutlet var IPv6filterSwitch: UISwitch!
1919
@IBOutlet var linkLayerfilterSwitch: UISwitch!
2020
@IBOutlet var ssidLabel: UILabel!
21+
@IBOutlet var wifiUsageLabel: UILabel!
2122

2223

2324
private var interfaces = Interface.allInterfaces()
@@ -30,6 +31,8 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
3031

3132
ssidLabel.text = "none"
3233
ssidLabel.textColor = .lightGray
34+
wifiUsageLabel.text = ""
35+
wifiUsageLabel.textColor = .lightGray
3336

3437
// setup pull to refresh
3538
refresher = UIRefreshControl()
@@ -140,8 +143,9 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
140143
}
141144
}
142145

146+
let formatter = ByteCountFormatter()
143147
let dataUsed = DataUsage.getDataUsage()
144-
print ("WiFi: ", dataUsed.wifiReceived + dataUsed.wifiSent)
145-
print ("Cellular:", dataUsed.wirelessWanDataReceived + dataUsed.wirelessWanDataSent)
148+
let wifiUsedString = formatter.string(fromByteCount: Int64(dataUsed.wifiReceived + dataUsed.wifiSent))
149+
wifiUsageLabel.text = wifiUsedString
146150
}
147151
}

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
116
1+
120

0 commit comments

Comments
 (0)