r/iOSProgramming • • Sep 18 '26

Discussion It’s not that bad on Duo if it’s SwiftUI

No code changes for now. This is the first cold start.

Some other views require changes/fixes, especially where geometry is used.

149 Upvotes

46 comments sorted by

54

u/Bakk322 Sep 18 '26

That middle screen shot with the unbalanced sheet makes me uncomfortable

4

u/Anywhere_MusicPlayer Sep 19 '26

This is a custom `.sheet` component that supports dynamic resizing on both iPhone and iPad, and also looks great on iPad.
But yes, Duo will need a few fixes.

13

u/lsumoose Sep 19 '26

That middle screenshot is terrible.

2

u/PassTents Sep 18 '26

Yeah, OP is using a fake close button that looks really weird

4

u/Bakk322 Sep 18 '26

I mean everything is left aligned instead of centered on the sheet for some reason

1

u/PassTents Sep 18 '26

That's because the sheet has a vertical bar, but the custom close button isn't being put there. There's API to make the sheet full-width with a horizontal bar

2

u/Anarude Sep 19 '26

My sheets are also reserving trailing space by default.

1

u/Moudiz Sep 22 '26

Wdym fake close button? Last I checked, sheets didn’t have a native close button 🤔 Or do you mean a toolbar button to dismiss is real

1

u/PassTents Sep 22 '26

Originally I meant that it looked weird because it wasn't a glass toolbar button, so it's something custom that also isn't being positioned properly. There's toolbar buttons with the "cancellation" position, which look like standard system "X" buttons and get the proper placement automatically when used with a navigation container.

3

u/Anarude Sep 18 '26

Check what happens to your sheets when partially folded aka book mode

0

u/Anywhere_MusicPlayer Sep 18 '26

Same as fully unfolded, so didn’t screenshotted that.

4

u/Anarude Sep 18 '26

Weird, Apple’s videos suggested sheets would move into one half of the screen

3

u/th3suffering Sep 18 '26

It does, when i fold my sheets are automatically moving to half the screen.

0

u/Anywhere_MusicPlayer Sep 18 '26

Perhaps thats also what I should fix 😄

130

u/lap_felix Sep 18 '26

> if it’s SwiftUI

It's not the SwiftUI part that makes it easy to adapt to Duo, it's that you use Apple-provided components and navigation items and Apple has done the work already. Same applies for UIKit. If you stick with Apple's components, it's almost free.

13

u/SnowPudgy Sep 19 '26

My coworkers are going to utterly hate life this year...they pretty much overrode all of apples controls down to textfields and buttons for functionality already provided in the base classes....

6

u/808phone Sep 19 '26

I keep telling people that while custom controls etc look good today, wait until Apple changes things.

3

u/lap_felix Sep 20 '26

In my experience with UIKit it's the opposite. Custom controls are fine but different iOS versions can break the Apple controls (and finding workarounds is hard). I'm thinking of UIButton and UIStackView here, for instance (though lately they've both been very stable).

1

u/perfmode80 Oct 03 '26

Exactly. It's no different than an iPad app that has to adopt to various sizes, including running apps windowed.

1

u/jarjoura Sep 20 '26

Use Button(role: .close) and move it to the .toolbar {} and wrap the whole sheet in a NavigationStack {}. That will fix the layout so that looks even more standard.

1

u/Anywhere_MusicPlayer Sep 20 '26

That’s not that simple… I have custom themes…
You can try them in my app if you curious

1

u/jarjoura Sep 20 '26

Ah I see, imho, I wouldn't bother having custom themes for your import / share ui though since it could look jarring in other apps.

5

u/StrangeMonk Sep 18 '26

We’ve been rebuilding our 15 year old app with over 100M sessions a year . We still have about 25% UIKit (as you could expect, the oldest and most coupled and also most important parts). We booted it on the Duo Sim this morning and it’s just a wreck lol 

Looks like we have a busy couple of weeks 

7

u/morenos-blend Sep 19 '26

Well it’s on you, not UIKit

4

u/xSash_ UIKit Sep 18 '26

Its not just SwiftUI…

2

u/Dvass138 Sep 18 '26

If you build for iPad I assume it would work similar on duo

1

u/BogAndHooper Sep 19 '26

Does the front screen have a concept of portrait or landscape? What happens if your app locks a normal phone to landscape mode only?

1

u/mathiswrong Sep 19 '26

I agree. This was honestly one of the easier updates I’ve had to build because my binaries are all swift

1

u/juanda631 Sep 19 '26

my app got a new iphone duo support already!!!

1

u/Kelmantis Sep 19 '26

I'm more in the never really targeted iPad so everything looks a bit odd when fully unfolded

1

u/Appropriate-Green-12 Sep 18 '26

finna try it in a second

0

u/vossome-dad Sep 18 '26

Friends where are we finding the Duo — in Device Hub? I must be missing a step

4

u/Eatalian Sep 19 '26

You need Xcode 27.1, not 27.2

3

u/jwrsk Sep 19 '26

Sorry, maybe I misunderstand, you need an older Xcode?

2

u/Eatalian Sep 19 '26

This is gonna sound weird, but Xcode 27.1 is newer than Xcode 27.2.

2

u/[deleted] Sep 18 '26

[removed] — view removed comment

1

u/[deleted] Sep 18 '26

[removed] — view removed comment

1

u/AutoModerator Sep 18 '26

Hey /u/AR3MGA, unfortunately you have negative comment karma, so you can't post here. Your submission has been removed. DO NOT message the moderators; if you have negative comment karma, you cannot post here. We will not respond. Your karma may appear to be 0 or positive if your post karma outweighs your comment karma, but if your comment karma is negative, your comments will still be removed.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/[deleted] Sep 24 '26

[removed] — view removed comment

1

u/AutoModerator Sep 24 '26

Hey /u/Reasonable-Fennel236, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.