Skip to content

Commit 933704f

Browse files
committed
Conversion to Swift 4.2 and fixed some compiler warnings.
1 parent 5c974c5 commit 933704f

File tree

11 files changed

+29
-27
lines changed

11 files changed

+29
-27
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>102</string>
22+
<string>105</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

IP Address WatchOS Extension/Interface.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
5050
* as separate instances of Interface.
5151
* - Returns: An array containing all network interfaces in your system.
5252
*/
53-
open static func allInterfaces() -> [Interface] {
53+
public static func allInterfaces() -> [Interface] {
5454
var interfaces : [Interface] = []
5555

5656
var ifaddrsPtr : UnsafeMutablePointer<ifaddrs>? = nil
@@ -73,7 +73,7 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
7373
* Returns a new Interface instance that does not represent a real network interface, but can be used for (unit) testing.
7474
* - Returns: An instance of Interface that does *not* represent a real network interface.
7575
*/
76-
open static func createTestDummy(_ name:String, family:Family, address:String, multicastSupported:Bool, broadcastAddress:String?) -> Interface
76+
public static func createTestDummy(_ name:String, family:Family, address:String, multicastSupported:Bool, broadcastAddress:String?) -> Interface
7777
{
7878
return Interface(name: name, family: family, address: address, netmask: nil, running: true, up: true, loopback: false, multicastSupported: multicastSupported, broadcastAddress: broadcastAddress)
7979
}
@@ -198,19 +198,19 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
198198
open var supportsMulticast: Bool { return multicastSupported }
199199

200200
/// Field `ifaddrs->ifa_name`.
201-
open let name : String
201+
public let name : String
202202

203203
/// Field `ifaddrs->ifa_addr->sa_family`.
204-
open let family : Family
204+
public let family : Family
205205

206206
/// Extracted from `ifaddrs->ifa_addr`, supports both IPv4 and IPv6.
207-
open let address : String?
207+
public let address : String?
208208

209209
/// Extracted from `ifaddrs->ifa_netmask`, supports both IPv4 and IPv6.
210-
open let netmask : String?
210+
public let netmask : String?
211211

212212
/// Extracted from `ifaddrs->ifa_dstaddr`. Not applicable for IPv6.
213-
open let broadcastAddress : String?
213+
public let broadcastAddress : String?
214214

215215
fileprivate let running : Bool
216216
fileprivate let up : Bool

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>102</string>
22+
<string>105</string>
2323
<key>UISupportedInterfaceOrientations</key>
2424
<array>
2525
<string>UIInterfaceOrientationPortrait</string>

IP Address.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@
275275
};
276276
AA343B7C1FEBF5D900CB6E03 = {
277277
CreatedOnToolsVersion = 9.2;
278+
LastSwiftMigration = 1010;
278279
ProvisioningStyle = Automatic;
279280
};
280281
AAE2351B1F91223400FB8E69 = {
281282
CreatedOnToolsVersion = 9.0;
283+
LastSwiftMigration = 1010;
282284
ProvisioningStyle = Automatic;
283285
SystemCapabilities = {
284286
com.apple.AccessWiFi = {
@@ -501,7 +503,7 @@
501503
PRODUCT_NAME = "${TARGET_NAME}";
502504
SDKROOT = watchos;
503505
SKIP_INSTALL = YES;
504-
SWIFT_VERSION = 4.0;
506+
SWIFT_VERSION = 4.2;
505507
TARGETED_DEVICE_FAMILY = 4;
506508
WATCHOS_DEPLOYMENT_TARGET = 4.2;
507509
};
@@ -519,7 +521,7 @@
519521
PRODUCT_NAME = "${TARGET_NAME}";
520522
SDKROOT = watchos;
521523
SKIP_INSTALL = YES;
522-
SWIFT_VERSION = 4.0;
524+
SWIFT_VERSION = 4.2;
523525
TARGETED_DEVICE_FAMILY = 4;
524526
WATCHOS_DEPLOYMENT_TARGET = 4.2;
525527
};
@@ -648,7 +650,7 @@
648650
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
649651
PRODUCT_BUNDLE_IDENTIFIER = "eu.trease.IP-Address";
650652
PRODUCT_NAME = "$(TARGET_NAME)";
651-
SWIFT_VERSION = 4.0;
653+
SWIFT_VERSION = 4.2;
652654
TARGETED_DEVICE_FAMILY = "1,2";
653655
};
654656
name = Debug;
@@ -665,7 +667,7 @@
665667
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
666668
PRODUCT_BUNDLE_IDENTIFIER = "eu.trease.IP-Address";
667669
PRODUCT_NAME = "$(TARGET_NAME)";
668-
SWIFT_VERSION = 4.0;
670+
SWIFT_VERSION = 4.2;
669671
TARGETED_DEVICE_FAMILY = "1,2";
670672
};
671673
name = Release;

IP Address/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1515
var window: UIWindow?
1616

1717

18-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1919
// Override point for customization after application launch.
2020
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
2121

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: 102 (12a85e9)" 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: 105 (5c974c5)" 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: 101 (25a1a74)" 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: 104 (5c974c5)" 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/DNSlookup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717

1818
public class DNSLookup {
19-
open static func lookup(_ hostname: String) -> String {
19+
public static func lookup(_ hostname: String) -> String {
2020
var address:String = ""
2121
let host = CFHostCreateWithName(nil,hostname as CFString).takeRetainedValue()
2222
CFHostStartInfoResolution(host, .addresses, nil)
@@ -33,7 +33,7 @@ public class DNSLookup {
3333
return (address)
3434
}
3535

36-
open static func reverseLookup(_ ip: String) -> String {
36+
public static func reverseLookup(_ ip: String) -> String {
3737

3838
/*
3939
var sin = sockaddr_in(

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>102</string>
20+
<string>105</string>
2121
<key>ITSAppUsesNonExemptEncryption</key>
2222
<false/>
2323
<key>LSRequiresIPhoneOS</key>

IP Address/Interface.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
5050
* as separate instances of Interface.
5151
* - Returns: An array containing all network interfaces in your system.
5252
*/
53-
open static func allInterfaces() -> [Interface] {
53+
public static func allInterfaces() -> [Interface] {
5454
var interfaces : [Interface] = []
5555

5656
var ifaddrsPtr : UnsafeMutablePointer<ifaddrs>? = nil
@@ -73,7 +73,7 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
7373
* Returns a new Interface instance that does not represent a real network interface, but can be used for (unit) testing.
7474
* - Returns: An instance of Interface that does *not* represent a real network interface.
7575
*/
76-
open static func createTestDummy(_ name:String, family:Family, address:String, multicastSupported:Bool, broadcastAddress:String?) -> Interface
76+
public static func createTestDummy(_ name:String, family:Family, address:String, multicastSupported:Bool, broadcastAddress:String?) -> Interface
7777
{
7878
return Interface(name: name, family: family, address: address, netmask: nil, running: true, up: true, loopback: false, multicastSupported: multicastSupported, broadcastAddress: broadcastAddress)
7979
}
@@ -198,19 +198,19 @@ public class Interface : CustomStringConvertible, CustomDebugStringConvertible {
198198
open var supportsMulticast: Bool { return multicastSupported }
199199

200200
/// Field `ifaddrs->ifa_name`.
201-
open let name : String
201+
public let name : String
202202

203203
/// Field `ifaddrs->ifa_addr->sa_family`.
204-
open let family : Family
204+
public let family : Family
205205

206206
/// Extracted from `ifaddrs->ifa_addr`, supports both IPv4 and IPv6.
207-
open let address : String?
207+
public let address : String?
208208

209209
/// Extracted from `ifaddrs->ifa_netmask`, supports both IPv4 and IPv6.
210-
open let netmask : String?
210+
public let netmask : String?
211211

212212
/// Extracted from `ifaddrs->ifa_dstaddr`. Not applicable for IPv6.
213-
open let broadcastAddress : String?
213+
public let broadcastAddress : String?
214214

215215
fileprivate let running : Bool
216216
fileprivate let up : Bool

0 commit comments

Comments
 (0)