Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit 31f69eb

Browse files
dokun1stevemart
authored andcommitted
last changes before shipping v1.1 (#81)
1 parent 2e4b5e9 commit 31f69eb

File tree

6 files changed

+49
-18
lines changed

6 files changed

+49
-18
lines changed

iOS/rainbow/Config/Info.plist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.1</string>
2121
<key>CFBundleVersion</key>
22-
<string>1</string>
22+
<string>2</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>NSAppTransportSecurity</key>
@@ -28,9 +28,7 @@
2828
<true/>
2929
</dict>
3030
<key>NSCameraUsageDescription</key>
31-
<string>WatsonML can't see very well without a camera!</string>
32-
<key>NSMicrophoneUsageDescription</key>
33-
<string>WatsonML requires the use of a microphone for using the camera.</string>
31+
<string>To play WatsonML, we require the use of your device camera.</string>
3432
<key>UIAppFonts</key>
3533
<array>
3634
<string>IBMPlexSans-Bold.ttf</string>

iOS/rainbow/Controller/AvatarAPI/AvatarClient.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import Foundation
1010
import UIKit
11+
import SVProgressHUD
1112

1213
struct UserAvatar: Codable {
1314
var name: String
@@ -30,6 +31,11 @@ class AvatarClient {
3031

3132
static func getRandomAvatar(completion: @escaping (_ avatar: UserAvatar?, _ error: Error?) -> Void) {
3233
let request = RestRequest(method: .get, url: "https://avatar-rainbow.mybluemix.net/new", containsSelfSignedCert: false)
34+
// request.circuitParameters = CircuitParameters(timeout: 30, fallback: { _, _ in
35+
// DispatchQueue.main.async {
36+
// SVProgressHUD.showError(withStatus: "Could not get avatar")
37+
// }
38+
// })
3339
request.responseObject { (response: RestResponse<UserAvatar>) in
3440
DispatchQueue.main.async {
3541
switch response.result {

iOS/rainbow/Controller/Camera/CameraController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class CameraController: LuminaViewController {
201201
}
202202

203203
private func promptForLatestModel() {
204-
let alert = UIAlertController.init(title: "Load New Visual Model", message: "This will attempt to download a file that is between 15-20 MBs. Do you want to continue?", preferredStyle: .alert)
204+
let alert = UIAlertController.init(title: "Load New Visual Model", message: "A new recognition model is available, and requires a download of 15-20 MB. Would you like to improve your gameplay?", preferredStyle: .alert)
205205
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
206206
let okAction = UIAlertAction(title: "Download", style: .default) { _ in
207207
UIApplication.shared.isNetworkActivityIndicatorVisible = true

iOS/rainbow/Controller/Leaderboard/ParticipantViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class ParticipantViewController: UIViewController {
1919
@IBOutlet weak var nowPlayingLabel: UILabel?
2020

2121
override func viewDidAppear(_ animated: Bool) {
22-
ScoreEntry.ServerCalls.getCount { count, error in
22+
ScoreEntry.ServerCalls.getCount { count, _ in
2323
DispatchQueue.main.async {
2424
if let count = count {
25-
self.nowPlayingLabel?.text = "Now Playing: \(count.totalUsers) players"
25+
self.nowPlayingLabel?.text = "\(count.totalUsers) Players"
2626
}
2727
}
2828
}

iOS/rainbow/Controller/MainTabBarController.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ class MainTabBarController: UITabBarController {
1414
override func viewDidLoad() {
1515
super.viewDidLoad()
1616
NotificationCenter.default.addObserver(self, selector: #selector(MainTabBarController.deviceRegistrationComplete(notification:)), name: Notification.Name("viva-ml-device-token-registered"), object: nil)
17-
SVProgressHUD.show(withStatus: "Preparing WatsonML...")
17+
do {
18+
_ = try ScoreEntry.ClientPersistence.get()
19+
} catch {
20+
// if there are any issues finding an existing users, this is the only reason we need to show this
21+
SVProgressHUD.show(withStatus: "Preparing WatsonML...")
22+
}
1823
}
1924

2025
@objc func deviceRegistrationComplete(notification: Notification) {

iOS/rainbow/View/Base.lproj/Main.storyboard

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,23 +411,45 @@
411411
<constraint firstAttribute="width" constant="300" id="Xzi-Uu-zF5"/>
412412
</constraints>
413413
</stackView>
414-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Now Playing: --" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YRX-QD-BPb">
415-
<rect key="frame" x="37" y="504" width="300" height="41"/>
414+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NU5-8T-sZZ">
415+
<rect key="frame" x="37" y="505" width="300" height="50"/>
416+
<subviews>
417+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Now Playing:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" translatesAutoresizingMaskIntoConstraints="NO" id="aAM-4w-jTk">
418+
<rect key="frame" x="0.0" y="5" width="136" height="40"/>
419+
<constraints>
420+
<constraint firstAttribute="height" constant="40" id="4KD-B0-vLb"/>
421+
<constraint firstAttribute="width" constant="136" id="wpF-9X-Xad"/>
422+
</constraints>
423+
<fontDescription key="fontDescription" name="IBMPlexSans-Bold" family="IBM Plex Sans" pointSize="22"/>
424+
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
425+
<nil key="highlightedColor"/>
426+
</label>
427+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="----" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YRX-QD-BPb">
428+
<rect key="frame" x="144" y="4" width="148" height="42"/>
429+
<fontDescription key="fontDescription" name="IBMPlexSans-Medium" family="IBM Plex Sans" pointSize="22"/>
430+
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
431+
<nil key="highlightedColor"/>
432+
</label>
433+
</subviews>
434+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
416435
<constraints>
417-
<constraint firstAttribute="width" constant="300" id="JHk-a1-XgN"/>
418-
<constraint firstAttribute="height" constant="41" id="Xjb-A6-yus"/>
436+
<constraint firstItem="YRX-QD-BPb" firstAttribute="top" secondItem="NU5-8T-sZZ" secondAttribute="top" constant="4" id="Bm7-k6-iIF"/>
437+
<constraint firstItem="aAM-4w-jTk" firstAttribute="leading" secondItem="NU5-8T-sZZ" secondAttribute="leading" id="GSc-Ex-M2q"/>
438+
<constraint firstItem="YRX-QD-BPb" firstAttribute="leading" secondItem="aAM-4w-jTk" secondAttribute="trailing" constant="8" id="HPm-3T-Lnk"/>
439+
<constraint firstItem="aAM-4w-jTk" firstAttribute="top" secondItem="NU5-8T-sZZ" secondAttribute="top" constant="5" id="UcV-9e-YL9"/>
440+
<constraint firstAttribute="height" constant="50" id="V8H-8U-DUE"/>
441+
<constraint firstAttribute="trailing" secondItem="YRX-QD-BPb" secondAttribute="trailing" constant="8" id="jpA-Kg-r0r"/>
442+
<constraint firstAttribute="width" constant="300" id="tTu-sp-xQd"/>
443+
<constraint firstAttribute="bottom" secondItem="YRX-QD-BPb" secondAttribute="bottom" constant="4" id="xPM-ya-Eut"/>
419444
</constraints>
420-
<fontDescription key="fontDescription" name="IBMPlexSans-Medium" family="IBM Plex Sans" pointSize="22"/>
421-
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
422-
<nil key="highlightedColor"/>
423-
</label>
445+
</view>
424446
</subviews>
425447
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
426448
<constraints>
427-
<constraint firstItem="YRX-QD-BPb" firstAttribute="top" secondItem="j0j-Xz-mVk" secondAttribute="bottom" id="LxJ-jb-4N5"/>
428449
<constraint firstItem="j0j-Xz-mVk" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="UOR-p1-HKe"/>
429-
<constraint firstItem="YRX-QD-BPb" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="VJL-lW-Qcs"/>
450+
<constraint firstItem="NU5-8T-sZZ" firstAttribute="top" secondItem="j0j-Xz-mVk" secondAttribute="bottom" constant="1.5" id="f6J-WK-gVt"/>
430451
<constraint firstItem="j0j-Xz-mVk" firstAttribute="centerY" secondItem="1X2-xn-izW" secondAttribute="centerY" id="g7a-uH-OOf"/>
452+
<constraint firstItem="NU5-8T-sZZ" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="wx0-L1-TNZ"/>
431453
</constraints>
432454
<viewLayoutGuide key="safeArea" id="Yqv-hy-23R"/>
433455
</view>

0 commit comments

Comments
 (0)