Skip to content

Commit e055966

Browse files
committed
Pull to refresh now updates SSID.
If not SSD then "none" displayed in light grey.
1 parent 911de29 commit e055966

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
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>80</string>
22+
<string>89</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>80</string>
22+
<string>89</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: 80 (ef0a1cd)" 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: 89 (911de29)" 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: 79 (ef0a1cd)" 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: 88 (911de29)" 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/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>80</string>
20+
<string>89</string>
2121
<key>ITSAppUsesNonExemptEncryption</key>
2222
<false/>
2323
<key>LSRequiresIPhoneOS</key>

IP Address/ViewController.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,14 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
2828
super.viewDidLoad()
2929
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
3030

31+
ssidLabel.text = "none"
32+
ssidLabel.textColor = .lightGray
33+
3134
// setup pull to refresh
3235
refresher = UIRefreshControl()
3336
tableView.addSubview(refresher)
3437
refresher.attributedTitle = NSAttributedString (string: "Pull to refresh")
3538
refresher.addTarget(self, action: #selector(refreshSortAndFilterData), for: .valueChanged)
36-
37-
if let interfaces = CNCopySupportedInterfaces() {
38-
for i in 0..<CFArrayGetCount(interfaces){
39-
let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces, i)
40-
let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
41-
let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString)
42-
43-
if let unsafeInterfaceData = unsafeInterfaceData as? Dictionary<AnyHashable, Any> {
44-
ssidLabel.text = unsafeInterfaceData["SSID"] as? String
45-
}
46-
}
47-
}
4839

4940
refreshSortAndFilterData()
5041
}
@@ -131,9 +122,22 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
131122
}
132123

133124

134-
135125
print (interfaces.count)
136126
tableView.reloadData()
137127
refresher.endRefreshing()
128+
129+
ssidLabel.text = "none"
130+
if let interfaces = CNCopySupportedInterfaces() {
131+
for i in 0..<CFArrayGetCount(interfaces){
132+
let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces, i)
133+
let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
134+
let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString)
135+
136+
if let unsafeInterfaceData = unsafeInterfaceData as? Dictionary<AnyHashable, Any> {
137+
ssidLabel.text = unsafeInterfaceData["SSID"] as? String
138+
ssidLabel.textColor = .black
139+
}
140+
}
141+
}
138142
}
139143
}

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
80
1+
89

0 commit comments

Comments
 (0)