Adjust your app’s behavior and filter incoming notifications based on the user's Focus settings.

Posts under Focus tag

11 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

SwiftUI app runs differently on hardware platforms
I have a simple SwiftUI app that has a picker, textfield and several buttons. It is using a Enum as a focus state for the various controls. When I compile and run it on Mac Studio desktop it works as expected: Picker has initial focus, Selection in Picker changes focus to TextField, Tab key moves through buttons; last button resets to Picker However when I run the exact same app on MacBook Pro (same version of MacOS, 14.5) it does not work at all as expected. Instead: Initial focus is set to TextField, Tab does not change the focus, Clicking on last button resets focus to TextField rather than Picker The content view code: enum FFocus: Hashable { case pkNames case btnAssign case tfValue case btn1 case btn2 case noFocus } struct PZParm: Identifiable { var id = 0 var name = "" } struct ContentView: View { @State var psel:Int = 0 @State var tfVal = "Testing" @FocusState var hwFocus:FFocus? var body: some View { VStack { Text("Hardware Test").font(.title2) PPDefView(bSel: $psel) .focused($hwFocus, equals: .pkNames) TextField("testing", text:$tfVal) .frame(width: 400) .focused($hwFocus, equals: .tfValue) HStack { Button("Button1", action: {}) .frame(width: 150) .focused($hwFocus, equals: .btn1) Button("Button2", action: { tfVal = "" hwFocus = .tfValue }) .frame(width: 150) .focused($hwFocus, equals: .btn2) Button("New", action: { tfVal = "" hwFocus = .pkNames }) .frame(width: 150) .focused($hwFocus, equals: .btnAssign) } } .padding() // handle picker change .onChange(of: psel, { if psel > 0 {hwFocus = .tfValue} }) .onAppear(perform: {hwFocus = .pkNames}) } } #Preview { ContentView() } struct PPDefView: View { @Binding var bSel:Int // test defs let pzparms:[PZParm] = [ PZParm.init(id:1, name:"Name1"), PZParm.init(id:2, name:"Name2") ] // var body:some View { Picker(selection: $bSel, label: Text("Puzzle Type")) { ForEach(pzparms) {Text($0.name)} }.frame(width: 250) } }
3
0
238
2w
Cannot add Focus Filter
I added a SetFocusFilterIntent to my project, but when I try to add the Focus Filter, the "add" button is disabled. I want to know why I cannot add a Focus Filter. I tried the same implementation of SetFocusFilterIntent in an empty project, and it works as expected.
0
0
193
Apr ’24
Focus Modes on Watch
I have had issue with sleep focus on my watch 8 since late in the iOS 16/ WatchOS 9 betas. I opened a feedback in Oct 2023 when 10.1 betas. When sleep focus is on the watch shows it's active and did not alert but it still works like normal. It used to go dark and I could tap the screen to see the time and press the crown to exit from that mode to use it. I wish this would be fixed. I'm tried of having to use theater mode with I go do bed. The light of the watch is
1
0
321
Feb ’24
Watch OS Sleep Focus
I have noticed since later 9.x betas that sleep focus no long switches the watch to just a clock. In the past, when sleep focus is turned on, my screen would go blank and if I tapped the screen the time would appear. if I held the crown in, it would "unlock" from time display only and allow me to use my watch. Since this has started I have posted in the feedback app starting in 10.1. Now I have to set my watch into Theater mode every night so that the screen is off and not lighting up the room. After each new beta release I update my feedback. Any idea if anyone has seen my feedback?
2
0
402
Jan ’24
Enhancing 3rd Party Alarm Clock Apps on iOS: A Call for More Flexibility and User Control
Hello Apple Community, I am writing to discuss a limitation I’ve encountered with third-party alarm clock apps on iOS. As it stands, these apps are unable to function like the native Clock app, primarily due to the restrictions imposed by the operating system. Currently, third-party alarm apps rely on standard local notifications, which fire once and then cease. This means that if a user misses the initial notification, there’s no backup mechanism to ensure they are alerted. This is a significant drawback for users who rely on these apps to manage their time effectively. Moreover, some apps have found a workaround by playing a silent sound in the background to keep the app active. However, this method is not only against Apple’s guidelines but also drains the device’s battery life. I propose that Apple consider allowing third-party apps to push notifications from the background in an alarm style, with clear permissions granted by the user. This would enable users to clearly define acceptable notifications and specify an alarm-like display, providing a more personalized and effective alarm experience. By implementing this change, Apple could greatly enhance the functionality and user-friendliness of third-party alarm clock apps, ultimately benefiting the end-users and developers alike. Because this alarm feature is so important for productivity and quick responses to critical events or triggers I'm trying to see how some concepts could be reimagined if we had a little more flexibility. Apple iOS has a feature called StandBy mode that activates when an iPhone is charging and positioned on its side. This feature can be thought of as a kind of smart display for your iPhone that offers fast access to different screens of glanceable information. Always-On Display: StandBy mode can keep the display on even when the phone is locked, which is useful for an alarm app. Users can glance at the time without having to unlock their phone w/ Low-Light Adaptation Customizable Screens: StandBy mode consists of screens that can be accessed by swiping horizontally on your iPhone’s display. This could allow an alarm app to display additional information, such as route, or weather warnings. Interactive Widgets: The widget screen in StandBy mode is interactive and customizable. I look forward to hearing your thoughts on this matter. Best regards, Phil Cutting
1
2
664
Jan ’24
AVCaptureDevice.FocusMode cannot be set in iPhone15
We are developing an app which uses AVCaptureSession. Here is a part of my code: if context.config.basic_settings.auto_focus == 1 { // 自動フォーカス device.focusMode = AVCaptureDevice.FocusMode.continuousAutoFocus completion() } else { device.focusMode = AVCaptureDevice.FocusMode.locked var _lenspos = Float(context.config.basic_settings.lens_position) ?? 0.5 if _lenspos > 1.0 { _lenspos = 1.0 } if _lenspos < 0.0 { _lenspos = 0.0 } device.setFocusModeLocked(lensPosition: _lenspos, completionHandler: { (time) in completion() }) } This code can successfully set focus mode to autofoucs or manual focus and also can set lens position perfectly if we use iPhone13 or iPhone14. But If we use iPhone15, this code cannot set the focus mode or lensposition. We also tried with different iPhone15 devices, but the result is always the same(fails to set focus). And also used different iPhone13 and iPhone14 devices. But these iPhones can set the focus correctly everytime. Is it a bug of iPhone15? Or is there anything that I can do about the issue?
2
0
546
Jan ’24
Adding accessibility to an existing application (Parental Control)
We are developing a parental control system. The application is written with .NET Xamarin for the framework version 4.8. The Mac version is addressed anything down to Mac OS 10.9, Maverick The application is running in the menu bar only and will fire a dialog, but the application does not have a real main window. We are currently adopting the applications to accessibility and 2 issues : during installation we need to elevate the account, the resulting "enter admin password"-dialog (system dialog) is not gaining focus, and as such is not getting a voice over help. when ever alert is shown, the focus is not pushed to the alert. (basically the same as also not getting voice over help)
0
0
377
Nov ’23
tvos: change focused color of UIButton
How to change default white color of tvos swift UIButton focus selection? override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { if let nextFocusedView = context.nextFocusedView { playAllOutlet.backgroundColor = UIColor.red shuffleBtnOutlet.backgroundColor = UIColor.green } if let previousFocusView = context.previouslyFocusedView { playAllOutlet.backgroundColor = UIColor.red shuffleBtnOutlet.backgroundColor = UIColor.green } } But background when button is focused is still white
1
1
646
Nov ’23
Read sleep schedule
Hi Is there a way to read the sleep schedule i have set in either the health or clock apps? I found a few posts on here asking the same thing and the responce was always either no or just no responce but they are all from over 2 years ago so im not sure if something has changed since then. Up untill recently i was using a shortcuts automation to get the data but a recent update started excluding the sleep schedule alarm from the list that the shortcuts app can pull from the clock app. I dont want historical data, just when the alarm is set to go off next. I was using it to turn my lights on dim half an hour before the alarm goes off without having to set the schedule in 2 places. I have an annoyingly inconsistent morning schedule. Thanks
1
0
631
Oct ’23
No Add Button on Settings > Focus Page
I’m trying to follow the instructions for creating a new Focus on my iPhone 13 Pro Max (running iOS 17.0 (Developer Beta (21A5326a))). I do not see an Add button (blue +) in the upper right side of the page that lists my current Focus options. I have a total of ten options set up and I want to add another. Here is a screenshot of what I see:
0
0
398
Sep ’23