Skip to content

Commit

Permalink
Require watchOS 6 for assist
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Nov 7, 2023
1 parent 8958a85 commit bdfeed7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PromiseKit
import Shared
import WatchKit

@available(watchOS 6, *)
class AssistInterfaceController: WKInterfaceController {
@IBOutlet private var chatTable: WKInterfaceTable!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enum AssistMicRowControllerStates {
case standard, loading, inProgress
}

@available(watchOS 6, *)
final class AssistMicRowController: NSObject {
@IBOutlet private var button: WKInterfaceButton!
var action: (() -> Void)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct AssistRowControllerData {
}
}

@available(watchOS 6, *)
final class AssistRowController: NSObject {
@IBOutlet private var titleLabel: WKInterfaceLabel!
@IBOutlet private var rowGroup: WKInterfaceGroup!
Expand Down
9 changes: 7 additions & 2 deletions Sources/Extensions/Watch/InterfaceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class InterfaceController: WKInterfaceController {
case watchAssistComplicationNotification = "watch-assist-complication"
}

@IBOutlet var tableView: WKInterfaceTable!
@IBOutlet var noActionsLabel: WKInterfaceLabel!
@IBOutlet private weak var microphoneIconGroup: WKInterfaceGroup!
@IBOutlet private weak var tableView: WKInterfaceTable!
@IBOutlet private weak var noActionsLabel: WKInterfaceLabel!

private var notificationObserver: NSObjectProtocol?

Expand Down Expand Up @@ -42,6 +43,10 @@ class InterfaceController: WKInterfaceController {
}

private func setupAssistObserver() {
guard #available(watchOS 6, *) else {
microphoneIconGroup.setHidden(true)
return
}
notificationObserver = NotificationCenter.default.addObserver(
forName: .init(Constants.watchAssistComplicationNotification.rawValue),
object: nil,
Expand Down
1 change: 1 addition & 0 deletions Sources/WatchApp/Base.lproj/Interface.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<label alignment="center" verticalAlignment="center" text="No actions configured. Configure actions on your phone to dismiss this message." textAlignment="center" numberOfLines="10" id="rFf-ux-R1e"/>
</items>
<connections>
<outlet property="microphoneIconGroup" destination="sk5-SP-icl" id="f3a-PM-rFP"/>
<outlet property="noActionsLabel" destination="rFf-ux-R1e" id="NKi-TH-3oN"/>
<outlet property="tableView" destination="wzm-z7-qRv" id="vZo-SJ-Vm2"/>
</connections>
Expand Down

0 comments on commit bdfeed7

Please sign in to comment.