0

I am trying to do a POC on giving varied look to my app based on focus settings (like work, personal)

I followed this video in from WWDC 2022 https://developer.apple.com/videos/play/wwdc2022/10121/#:~:text=Focus%20was%20introduced%20in%20iOS,Focus%20or%20a%20custom%20Focus. And tried the same.

Its supposed show the App/Custom filter in the focus settings (in settings app) as given below.

This is a screenshot from WWDC 2022

But, my app is not shown in the focus filter settings.

Using iPad for testing this and its in iOS 16 beta.

Is there anything I missed. I do not see much help elsewhere.

Code

import AppIntents
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
     ExampleTestyFocusFilter().donate()
        
    }

}

struct ExampleTestyFocusFilter : SetFocusFilterIntent
{
 
    typealias IntentPerformResultType = IntentResult<Void,Void,Void>
    
  
    @Parameter(title: "Use Dark Mode", default: false)
    var alwaysUseDarkMode: Bool

    @Parameter(title: "Status Message")
    var status: String?

    static var title: LocalizedStringResource = "Set account, status & look"
       static var description: LocalizedStringResource? = """
           Select an account, set your status, and configure
           the look of Example Chat App.
       """
    

    var displayRepresentation: DisplayRepresentation {
        var titleList: [LocalizedStringResource] = [], subtitleList: [String] = []

        if let status = self.status {
            titleList.append("Status")
            subtitleList.append(status)
        }
        titleList.append("Look")
    
        let title = LocalizedStringResource("Set \(titleList, format: .list(type: .and))")
        let subtitle = LocalizedStringResource("\(subtitleList.formatted())")

        return DisplayRepresentation(title: title, subtitle: subtitle)
    }
  
   
    func perform() async throws -> IntentPerformResultType {
        
   //code
        return .finished
    }
 
    
    }
riyaz
  • 1,093
  • 1
  • 8
  • 21

1 Answers1

1

Please run the project in Xcode 14 beta 3. Had the same issue in beta 1 and now it was working fine for me.