Complete first version of Project 37

This commit is contained in:
CypherPoet 2019-03-08 05:39:12 -05:00
parent 9f4d3e00cd
commit 2a3a04455c
3 changed files with 23 additions and 5 deletions

View File

@ -66,6 +66,7 @@ extension InterfaceController: WCSessionDelegate {
Whenever the watch recieves a message from the phone, it will tap the wearer's wrist
*/
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
print("Watch `didReceiveMessage` called")
WKInterfaceDevice().play(.click)
}
}

View File

@ -59,6 +59,24 @@ class HomeViewController: UIViewController {
backgroundMusic?.play()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let instructions = """
Please ensure your Apple Watch is configured correctly. On your iPhone, \
launch Apple's 'Watch' configuration app then choose General > Wake Screen.
On that screen, please disable Wake Screen On Wrist Raise, then select \
Wake For 70 Seconds. On your Apple Watch, please swipe up on your watch \
face and enable Silent Mode. You're done!
"""
let alertController = UIAlertController(title: "Adjust your settings", message: instructions, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default))
present(alertController, animated: true)
}
// MARK: - Methods
@ -83,7 +101,7 @@ class HomeViewController: UIViewController {
cardViewController.frontImageView.image = cardImage
// if the new card is a star, mark is as "correct"
if cardImage.accessibilityIdentifier == "star" {
if cardImage.accessibilityIdentifier == "Star" {
cardViewController.isCorrect = true
}
@ -163,8 +181,7 @@ class HomeViewController: UIViewController {
guard let touch = touches.first else { return }
if let touchedCard = card(from: touch) {
// if isForceTouchEnabled && touch.force == touch.maximumPossibleForce {
if true {
if isForceTouchEnabled && touch.force == touch.maximumPossibleForce {
touchedCard.frontImageView.image = UIImage(named: "cardStar")
touchedCard.isCorrect = true
}

View File

@ -60,8 +60,8 @@
| 34 | 🎮<br>[Four in a Row](/34-gamekit-four-in-a-row) | GameplayKit AI, GKGameModel, GKGameModelPlayer, GKGameModelUpdate, AI Heuristics, NSCopying, GKMinmaxStrategist | ✅ |
| 35 | 🛠<br>[Random Numbers](/35-random-numbers) | Int.random(in:), Float.random(in:), Double.random(in:), CGFloat.random(in:), Bool.random(), arc4random(), GKRandomSource.sharedRandom(), GKLinearCongruentialRandomSource, GKMersenneTwisterRandomSource, GKARC4RandomSource, GKRandomDistribution, GKShuffledDistribution, GKGaussianDistribution, Fisher-Yates Algorithm, arrayByShufflingObjects(in:), the importance of being able to seed the source of randomness 🌱| ✅ |
| 36 | 🎮<br>[Crashy Plane](/36-crashy-plane) | scale modes, parallax scrolling, SpriteKit Physics, SKPhysicsContactDelegate, SKPhysicsBody, SKAudioNode, managing game state with enums, restarting entire game scenes | ✅ |
| 37 | 🎮<br>[WatchKit ESP Tester](/37-watchkit-game-esp-tester) | View Controller containment, WatchKit Extensions, 3D Touch, CAEmitterLayer, CAGradientLayer, @IBDesignable, @IBInspectable, transition(with:), WCSession, WKInterfaceLabel, WKInterfaceButton | 🚧 |
| 38 | 🛠<br>[Github Commits (Core Data)](/38-githubcommits) | NSFetchRequest, NSManagedObject, NSPredicate, NSSortDescriptor, NSFetchedResultsController, ISO8601DateFormatter | 🔴 |
| 37 | 🎮<br>[WatchKit ESP Tester](/37-watchkit-game-esp-tester) | View Controller containment, WatchKit Extensions, 3D Touch, CAEmitterLayer, CAGradientLayer, @IBDesignable, @IBInspectable, transition(with:), WCSession, WKInterfaceLabel, WKInterfaceButton, WCSessionDelegate overrides, passing messages between a phone and a paired watch | ✅ |
| 38 | 🛠<br>[Github Commits (Core Data)](/38-githubcommits) | NSFetchRequest, NSManagedObject, NSPredicate, NSSortDescriptor, NSFetchedResultsController, ISO8601DateFormatter | 🚧 |
| 39 | 🛠<br>[Unit testing with XCTest](/39-swift-unit-tests) | XCTest, `filter()`, Test-Driven Development, Functional Programming, XCTestCase, Setting a Baseline, NSCountedSet, XCUIApplication(), XCUIElementQuery, UI Test Recording | 🔴 |