SwiftUI/Native Apple Development Discussion

1 readers
1 users here now

Discussion about all things SwiftUI-related. Get help with a bug in your code, ask about a new API you want to learn, show off your awesome work, etc.

founded 1 year ago
1
 
 

How do you get screenshots with the proper status bar on iOS 16-17?

I've been ready to submit my app to the App Store for weeks, but I've been putting it off because I can't figure out how to modify the simulators' status bars to get the Apple-recommended layout.

I've followed various tutorials to update the simulators, but it seems that it's not possible on current iOS versions, and my app's minimum deployment is higher than when it quit working.

At this point, I've got a flow setup to easily get all screenshots I need without status bars. Is there any way to automate adding the proper toolbar to the screenshots, or will I need to manually edit every single picture?

#SwiftUI

2
 
 

I know that probably sounds weird, but let me explain.

I have a scroll view with custom shapes that are dynamically sized. The goal is to have some of those shapes, the ones on one side of the scroll view, basically be see-through to reveal the contents of a large gradient underneath. Therefore, as the shapes scroll up or down the view, their background would change as they move over the gradient.

However, the rest of the scroll view, including the other shapes and the blank areas in between, should not be see-through but instead have the default system background color. The other issue I've run into is that the gradient must not be visible until content is loaded in so you don't see the gradient flash in the little in-between time.

Currently, I have the scroll view itself having the gradient as the background. With a combination of adjusting my shapes to use even/odd filling, making my see-through shapes transparent, and adding "background covers" on all sides of the shapes, I almost have the desired results.

Problems:
The background is exposed when the list is dragged down.
The gradient does not continue off the screen, so the see-through messages disappear before the opaque messages. This is especially problematic for the production environment because of semi-transparent bars on the top and the bottom, meaning I can't extend the gradient unless I keep it covered in the safe areas.
In production, the scroll view content does not load immediately but has an opacity transition on appear. So, the gradient flashes as the content loads.

2 and 3 I may be able to tinker with and find a solution. I haven't spent much time trying yet. But, I'm thinking I may be approaching this problem in a less-than-optimal way. The ideal situation would be to have a gradient the size of the device height that is only visible through a particular view on top of it while being unexposed in all other situations.

Here's a brief code example.

Also, I considered actively calculating the gradient's appearance on the shapes as they scroll based on their scroll position, but my gut tells me performance will be an issue with that.

3
 
 

When I navigate backward (like swiping the view from the left), I want to be able to drag it back from the right to move to that previous view. Sort of like an undo stack.
I asked this question on StackOverflow and the solution there works, but doesn't feel "native": I want the full dragging-of-the-view effect just like in the native navigation.
Is it possible to use NavigationStack or other existing views to solve that?

4
 
 

See video here. I couldn’t get kbin to accept the video, so it’s on Imgur.

5
 
 

This is another huge year of updates, delivering many highly requested features such as advanced scroll view effects, container relative sizing, and even Metal shaders.

6
 
 

I hope this isn't regarded as spam but I saw that it's allowed to post about your app once every seven days or something. So I hope this is ok, as it's SwiftUI related.

My app "Kolibri for SwiftUI" is written entirely in SwiftUI and also is FOR SwiftUI. As the title says, you can draw vector designs and the app generates the code. So you can use it in your projects.

And in the latest update I included an animation editor. You can animate your designs and again, it generates the SwiftUI code automatically.

Oh and it's for iPhone, iPad and macOS.

I'm looking for more users and more feedback and suggestions especially. I want to keep making the app better, it's still pretty "new".

Thanks!

Sandro

Website: https://noidentity.ch/kolibri/

Some images and stuff
https://noidentity.ch/wp-content/uploads/2023/04/Simulator-Screenshot-iPad-Pro-12.9-inch-6th-generation-2023-04-24-at-14.17.15-2048x1535.png

https://noidentity.ch/wp-content/uploads/2023/04/4-2048x1280.jpg