iOS Widget Extension not running iPhone Xr only - ios

My iOS app with SwiftUI widget extensions runs fine anywhere, except on iPhone Xr. The widgets have the following issue: both the simulator and real devices only show the blank user interface, or simply a white placeholder instead of the actual widget.
Also, the preview / snapshot while adding the widget to the home screen, does not show the example content, just a blank UI.
(While debugging it seems not a single function is being called. However widget debugging in the Simulator works horribly and breakpoints never seem to work. This is an entirely different issue but not point of this post.)
There are no errors in the console.
Xcode 14.2, iOS 16.2. The project is an ObjC project with SwiftUI extension. The extension uses location services and fetches data from a remote server. (I don't think this is relevant because it works correctly on other devices, but you never know.)
Does anyone have any idea on what's different about the iPhone Xr that makes it not wanting to load the widget?
The code consists of a TimelineProvider with placeholder(), getSnapshot() and getTimeline() functions in place. Again, it works on any device except iPhone Xr. Any ideas?

Related

Strange bug - Some elements are visible when I run app from Xcode, but not if I start running the app from device

Context: Native iOS app developed with Swift which manages external control units via bluetooth. I use Xcode Version 14.2, but it used to happen with older versions as well. Tested on devices with iOS 15 and 16.
In a specific section what the app has to do is:
take the data through the Bluetooth input and output
go to the outputs screen and present the outputs
from the outputs screen go to the inputs screen and show them
The problem is as follows.
If I take a physical iPhone and connect it to the Mac, then start the app from Xcode, everything works fine.
If, with the same iPhone, I start the app not from Xcode but with a tap from the iPhone screen, the app starts correctly, connects via Bluetooth, shows all the outputs correct, while for the inputs they are all correct except the last. The last one is never displayed, all the others are.
The main problem is that I don't know how to debug since it only happens when the app starts unlinked from Xcode. Does anyone know of other ways to troubleshoot the problem or have had similar problems and know of possible solutions?

Expo Go works fine on iPhone8 Sim. but stuck at splash screen on other simulators or my real iPhone 11

I simply cannot figure out what’s going on here—My app works great in the simulator when it is set to iPhone 8, but if I change to 11, or try to open it in the expo app on my real iPhone, it hangs at the splash screen.
I am loading a few images and fonts with the splash screen, but it works perfectly well in the simulator when it’s set to iPhone 8, and I have no idea why it doesn’t just work equally well on any device size.
Does anyone have any ideas why the behavior would be different?
Edit: update on my findings. I have narrowed the issue down to a check for isClientReady which is a Boolean I create during the Splash Screen loading to check for an existing session and if so, connect to the Stream chat service’s client. When I remove this, then the Splash screen continues to load for the other device sizes, but then it sets up a race condition where the app loads before the user is connected to Stream and I get an error. I may be able to circumvent this by throwing up a spinner wheel once past the loading screen to await the Stream client check, but I wanted to avoid multiple loading states when the app starts and hide it behind the splash screen.
Weirdly, this is not and has never been a problem when using the iPhone 8 simulator, it works perfectly. It seems to be a problem with all other phone sizes, though, and my real iPhone 11.
So the question still remains—does anyone know why the behavior would vary between two different types of simulator? I’m stumped.

UISegmentedControl not responding to interaction on Simulator

I have an interesting issue that I am trying to get some clarity on.
I have a UISegmentedControl on a view that works perfectly fine when deploying to a physical device (Switches indexes, valueChanged fires, customization set etc) but it doesn't work at all when testing on the Simulator.
When I say it doesn't work, I mean it shows up in the UI but you can't interact with it. The segments don't switch, the assigned action doesn't fire and so forth.
I am using Xcode 12.2 running on iPhone 11 sim running iOS 14.2. I've deployed to physical iPhone 11 and all works fine.
So, question is, is there a known issue with this control on simulator, have I encountered an Xcode bug, or am I just missing something basic?
NOTE: I've tried creating this in Storyboard and hooking up via an #IBOutlet as well as creating the full control programatically in Swift. The control shows up on simulator but can't be interacted with in both instances.

Objects showing in iPhone Sim but not iPad sim

Full disclosure: I'm very new to iOS development.
Using Xcode Version 7.2.1, Swift programming language, targeting 9.0
I have a very simple app. Universal. When running in simulator mode it works fine for any iphone chosen in the simulator. Everything shows up where it's supposed to etc.
When running it in iPad simulators, any of them, the only thing showing up is the navigation bar. All objects that are supposed to show up on the screen, are gone.
When debugging, the objects seem to get created alright.
Maybe there's something to be done in AppDelegate?
As I imagine this is a really noob problem I again like to emphasise that I'm grateful for any suggestions you may have.

Layout displacment on iOS 8.3

I am using INTEL XDK(1995) and Ionics to build HTML 5 application for Android and iOS.
Application runs like it should on Android devices and also on my iPhone 4 which has iOS 7.1.1
Application requires internet connection to load location of data and data it self and is then placed on device screen.
Here is the example how application looks like:
And this is example from the iPhone 6 and iOS 8.3:
It looks like that height isn't calculated properly. But it's interesting that buttons are placed correctly. Because they are also set by the height of the screen. But on some other device which is also iPhone 6 and has iOS 8.3 works like it should. Anyone knows what could make a difference on same device?
Please say if you need any more information.
I have managed to solve this problem. When I went to the client which had this problem, I discovered that splash screen didn't even show and instead it went directly to the application.
So I added init-dev.js file and called my starting AngularJS method from "ready" listener method.

Resources