watchOS 5 contentSafeAreaInsets always zero - watchkit

I might be missing something super obvious, but running an app compiled against watchOS 5 on the Apple Watch Series 4 simulator always results in the contentSafeAreaInsets and systemMinimumLayoutMargins returning zero (zero for left/right/top/bottom).
I've tried creating a sample project in case it was something weird in my app, but no luck.
The docs state:
The system’s built-in containers and controls automatically use the
content-safe area insets; however, if you build a custom user
interface with SpriteKit or SceneKit, you should check the
contentSafeAreaInsets and systemMinimumLayoutMargins, and lay out your
interface accordingly.
So I've tried adding a SceneKit scene to the Storyboard but that's had no effect, even when launching all permutations of the "full screen" and "fixed to screen edges" options enabled and disabled:
Edit: If I background and foreground the app the values are reported successfully, which makes me believe this could be a bug in watchOS if there's no workaround. It seems unreasonable to expect a user to background and foreground an app to get the correct behaviour.

Related

Use Autolayout Not Checked, Still get constraint errors

I do not use autolayout. My app is incredibly dynamic, in that users can drag fields onto a canvas to create forms. Therefore, I have developed my own routines to render my xibs on any device in either portrait or landscape. To do this, I make sure the Use Autolayout is not checked for the xib's view in the file inspector. In fact none of the boxes are checked (trait variations, safe area, etc). However, I continue to get constraint errors. Is this just a bug. My code works perfectly but it is quite annoying to get the plethora of warnings in the output window. This just started in the last release or two. I am using XCode 9.2 with a deployment target of iOS 11.

iOS 9 status bar appears below black bar

What is happening to my app in Xcode 7 / iOS 9?
The whole screen looks condensed, as if an iPhone 4S app is displaying on an iPhone 6. It looks normal in the iPhone 4S simulator.
I thought it was a problem with the auto layout constraints in the main storyboard, so I eventually deleted everything apart from the root view in the root view controller (blue screen), and there's still a problem with it.
I tried enabling size classes, thinking that this was the problem due to previously being disabled, but the result was the same.
Is anyone else getting this problem in their existing apps running in iOS 9?
Target>General>Launch Image Source>use asset
it will create new asset named BrandAsset, place your launch images over here. Create LaunchScreen.storyboard if already not existing and select it to Target>General>Launch Screen File.
Thanks for the answers. They pointed me in the right direction, as I wasn't aware it was anything to do with the launch screen.
I found out I had no LaunchScreen.storyboard file. Digging around in the docs led me onto this:
New projects are created with a launch screen storyboard file called
LaunchScreen.storyboard. Alternately, you can create a new launch
screen file using File > New, selecting the User Interface category,
and choosing a file type of Launch Screen.
It was weird that I had to do this, as I only started developing this app in iOS 8, and apparently this was a change in iOS 8. But with iOS 9 Apple are obviously getting more aggressive with deprecating incorrectly set up projects, and the consequences were that it was bug to my app.
The positive I guess, is that all of this forced me to at least create a launch image instead of having nothing.

Prevent Apple Watch from turning off the screen

I'm writing an extension for the Apple Watch which aim is to guide the user through a set of steps. I don't have the watch to test the extension but I need to be sure that the screen will remain always on until all the steps are completed.
Does anyone can tell me when Apple Watch display is turned off or if there any way to prevent the display from turning off (similar idleTimerDisabled from UIApplication in iOS)?
There is currently no way to programmatically prevent the display from being turned off. Otherwise, we can speculate that as long as the user is interacting with your app, the screen will remain on. Worst case, you'll receive a didDeactivate when the app is suspended and a willActivate when the user wakes it up to continue (assuming the Watch app isn't terminated in between).
As of watchOS 4 you can use this boolean to keep the display on, and this will rotate the UI when the arm is turned.
https://developer.apple.com/documentation/watchkit/wkextension/2868464-isautorotating
Consider HKWorkout.
it ensures that your app appears whenever the user checks their watch
https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings
It seems when the system is using the mic, it forces the screen to stay on — I’ve noticed this even in third party apps that allow sending voice messages. Here is the view that the user sees when screen idling is disabled in this way:
Note that this is a third party app and the screen didn’t turn off even after 2 full minutes!

WatchKit Menu Items Not Displaying

I'm in Xcode 6.2 Beta 3 (Build 6C101), I've added a menu and two menu items to my Interface Controller, and created IBActions for both. I've given them titles and images, but when I run the app nothing displays.
I've read
https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Menus.html
and can't see anything about need to show menu items programatically - what am I missing?
You do not need to present the menu programmatically. The only thing you need to do is wire each button to IBActions in your Watch app extension.
The most likely issue is caching of the previous Watch app storyboard. Do a clean build and try again.
Finally, as you likely know WatchKit menus only display on a "force press". They cannot be used for the main interface of the Watch app. In the Simulator, a click and hold with the mouse will simulate a force press, and the animation will make it clear when you have done one, even in contexts where it doesn't do anything.
This was solution for me- Go to Hardware->Touch Pressure->Deep Press then try tap on watch simulator.
I have recently encountered this issue on a real device, although the menu was working as expected on the watch simulator. In my case, the problem was in SF Symbol that I've used as an image.
Everything was fixed after replacing it with an image from the assets catalogue.

Flex - invisible text until mouse pointer moves outside textInput

We have an application running flex sdk 4.5 and have recently encountered an issue with textInput fields which we have not been able to reproduce on our end for the better part of a month now.
Here are the symptoms:
Users opens an input form which contains several input fields (combo boxes, calendars, text inputs, etc)
User clicks inside a text field
Users types (obviously!)
** Nothing appears in the text input - we have validators on some of these fields and they do kick in properly (ie. user sees red box around textInput disappearing)
User moves cursor outside of text input field and text appears
Give or take, this is the test case we've been provided. We have been unable to reproduce this and I'm reaching out to see if anybody has heard of issues like this in the past.
They are running our flex application in the following environment:
Windows XP SP3
IE 7.0.5730.13 (locale = en-gb)
Flash Player 10.3.181.14
Upgrading either of these components is not an option. Installing the flash player debugger is not an option either.
Now we've setup a pc exactly the same way as they have on their end and still haven't reproduced. So we're really stuck at this point :)
Any suggestion is greatly appreciated. I'll provide any additional info needed.
-Marc
Feb. 2nd 2012 - Update
As I noted in my comment reply to shaun, it seems our customer was more or less precise in their description of the issue. We ran a webex session with them this morning and actually saw the issues first hand.
Here's what happens:
- User loads our application via its url
- User is able to input data and pretty much do any function for a 'random' time period
- All of a sudden, the issues start (there are more symptoms than just the one I originally mentioned):
1. Users type in text input fields and they won't see the text appear until they move the cursor out of / into any other component (could be entering an hbox, exiting a text input field, etc)
2. Combo boxes behave more or less the same. They can drop them down, but then the mouse wheel no longer refreshes the list. It actually scrolls in the background, but until the user moves the mouse, the list does not refresh
3. We also communicate between the server and client via an amf channel. The events make it to the client, but again, they won't see the screen refresh until they move their cursor.
So basically, the application still seems to work, but the screen is no longer refreshing. Could it be something to do with an invalidate / update of the display list that doesn't kick in? We'd like to get them to install the debugger version of FP, but that doesn't seem to be an option.
Another thing to keep in mind: they have a VERY bad internet connection. They average around 1-1.5mbps (megabits) which is enough for our app, but I just thought I'd let you know.
We learned that they also use a Citrix presentation layer to deploy IE 7 to the end users. We've received confirmation from the end user that even if they launch IE on their workstation (not through citrix), they get the issue also.
Another note is that we've seen no errors in our web server, jboss or application logs...
So that's the update I've got... anyone have more thoughts on this? We've more or less discarded the fonts being an issue at this point since the issue affects more than just 'fonts'. Is everything on the screen not updating anymore.

Resources