'iOS API for enable / disable focus mode

Apple introduced focus modes in iOS 15: https://www.apple.com/newsroom/2021/06/ios-15-brings-powerful-new-features-to-stay-connected-focus-explore-and-more/

Is it possible to enable or disable one of these focus modes programmatically in an app?

Any help will be appreciated.



Solution 1:[1]

There is no API to set focus modes; This is something that the user controls, not apps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paulw11