Skip to content

Commit c228f40

Browse files
Steve TreaseSteve Trease
authored andcommitted
added startup debugging messages
1 parent a4864f6 commit c228f40

File tree

7 files changed

+102
-2
lines changed

7 files changed

+102
-2
lines changed

IP Address/AppDelegate.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,38 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1616

1717
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
19+
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
20+
21+
print ("device uuid ", (UIDevice.current.identifierForVendor?.uuidString)!)
22+
23+
let appName: String = (Bundle.main.infoDictionary?["CFBundleName"] as? String)!
24+
let versionNumber: String = (Bundle.main.infoDictionary?["CFBundleVersion"] as? String)!
25+
print ("\(appName) (\(versionNumber))")
26+
27+
switch (application.applicationState) {
28+
case .active:
29+
print ("didFinishLaunchingWithOptions - active")
30+
case .inactive:
31+
print ("didFinishLaunchingWithOptions - inactive")
32+
case .background:
33+
print ("didFinishLaunchingWithOptions - background")
34+
}
35+
1936
return true
2037
}
38+
39+
40+
func applicationWillEnterForeground(application: UIApplication) {
41+
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
42+
print ("applicationWillEnterForeground")
43+
}
44+
45+
46+
func applicationDidBecomeActive(application: UIApplication) {
47+
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
48+
print ("applicationDidBecomeActive")
49+
}
50+
2151

2252
func applicationWillResignActive(_ application: UIApplication) {
2353
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

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: 7 (0572618)" 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: 9 (a4864f6)" 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"/>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F71b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina4_0" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10+
</dependencies>
11+
<scenes>
12+
<!--View Controller-->
13+
<scene sceneID="EHf-IW-A2E">
14+
<objects>
15+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
16+
<layoutGuides>
17+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
18+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
19+
</layoutGuides>
20+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21+
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
22+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23+
<subviews>
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 8 (a4864f6)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
25+
<rect key="frame" x="132.5" y="527" width="55.5" height="21"/>
26+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
27+
<nil key="textColor"/>
28+
<nil key="highlightedColor"/>
29+
</label>
30+
</subviews>
31+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
32+
<constraints>
33+
<constraint firstItem="yhA-lX-4Of" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="0ld-gi-EPw"/>
34+
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="yhA-lX-4Of" secondAttribute="bottom" constant="20" id="CH1-jU-hiL"/>
35+
</constraints>
36+
</view>
37+
</viewController>
38+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
39+
</objects>
40+
<point key="canvasLocation" x="52.5" y="375"/>
41+
</scene>
42+
</scenes>
43+
</document>

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>7</string>
20+
<string>9</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
2323
<key>UILaunchStoryboardName</key>

build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

updateBuildVersionNumber.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/bin/sh
2+
3+
BUILD=`cat ./build`
4+
5+
echo "build:" $BUILD
6+
7+
PLB=/usr/libexec/PlistBuddy
8+
9+
for DELIVERABLE in "IP Address"
10+
do
11+
PLIST="$DELIVERABLE/Info.plist"
12+
$PLB -c "Set :CFBundleVersion $BUILD" "$PLIST"
13+
done

updateSplashScreen.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/bin/sh
2+
3+
LAST_BUILD=0
4+
LAST_BUILD=`cat ./build`
5+
NEW_BUILD=$(($LAST_BUILD + 1))
6+
GIT=`git rev-parse --short HEAD`
7+
8+
echo $NEW_BUILD > build
9+
echo "build:" $NEW_BUILD $GIT
10+
11+
PLB=/usr/libexec/PlistBuddy
12+
13+
sed -i bak -e "/userLabel=\"APP_VERSION\"/s/text=\"[^\"]*\"/text=\"Build: $NEW_BUILD \($GIT\)\"/" "IP Address"/Base.lproj/LaunchScreen.storyboard

0 commit comments

Comments
 (0)