Missing/Broken features in SwiftUI [List]

Hi guys, as many of you (I think), I have been busy learning SwiftUI as fast as I can. In my case for a new app I want to develop for personal purposes and probably for an App Store release.


In my (small) learning journey I have found a few things that SwiftUI is missing or just not working, but since there is not too much information yet I wanted to make a simple thread with all the things I have found at the moment. This can be useful for anyone who is learning SwiftUI or wants to check current SwiftUI status.


I promise to add my findings here and update this post as fast as I can.

Feel free to mention every feature you think is important to have in the list, any features you think is not a bug or broken/missing feature, or any solution you may find to one of this mentioned problems.


Ps: I know we have Xcode release notes but many of the current bugs of SwiftUI are not mentioned there.


SwiftUI missing/broken features (as of beta 3):


  • Can’t remove rows separator from List
  • Can’t push or pop without navigationView
  • Can’t display a modal in full screen (only in the new style)
  • No dismiss modal programatically available (environment safe keypath maybe is the correct solution?)
  • Custom Fonts are sometimes not rendered correctly on Xcode Previews (A little bit fixed in Beta 3 but still buggy)
  • Code Completion in some places is not working (haven’t found a specific way to reproduce the bug consistently but definitely happens)
  • Pinch to Zoom is not working in Xcode Previews
  • Switching between files that have or not have a cambas may cause the cambas to remain open
  • No way to remove the accessory item of a navigationLink inside a List
  • Cant hide navigation bar from NavigationView (There is a new modifier called navigationBarHidden but when the next view is pushed, the navigationBar returns. The modifier only works for the first view not pushed ones)
  • Cant add a custom navigation bar to NavigationView
  • Colors in foregroundColor modifier are not updating in Previews correctly. Sometimes they work but most of the time is the same black color (Working better in beta 3 but some objects including navigationView are still having problems)
  • TextFields do not have a way of setting their keyboard type.
  • TextFields do not have the equivalent of UIKit beginFirstResponder and resignFirstResponder. That means there is no way of programatically setting or removing the focus from a text field.
  • SecureField does not have a way of knowing when the field became active, or inactive (TextField does have onEditChange, but SecureField does not).
  • Popovers as of beta3 seem to be broken.
  • Slider seems broken in Beta 3. No longer increment by Stride
  • .onAppear and .onDisappear are not firing during navigation transitions
  • TextFields are not resized properly when multiline text is used


Solved problems

  • Forms are not available (Now available in Beta 2)
  • Published property wrapper is not fully functional (Available since Beta 2 in Xcode projects. Playgrounds not working)
  • Colors added directly to the xcassets are not working in dark mode (Working in beta 3)
  • LaunchScreen is sometimes stuck with old layouts (happens to me only in SwiftUI projects sometimes) (Working in Beta 3)
  • There is no simple way to change the main view background color (Use background modifier, see answer 3)

Replies

Updating for beta 3

New finding, to add a background color for the main View just use the background modifier with a Color parameter. Since Color can have modifiers applied, apply a frame modifier with the values you need. In my case, a width of your screen width and a height of your screen height


Something like this

.background(Color.blue.frame(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height))

Nice of you to create the list. If you accept suggestions for inclusion:


  • TextFields do not have a way of setting their keyboard type.
  • TextFields do not have the equivalent of UIKit beginFirstResponder and resignFirstResponder. That means there is no way of programatically setting or removing the focus from a text field.
  • SecureField does not have a way of knowing when the field became active, or inactive (TextField does have onEditChange, but SecureField does not).
  • Popovers as of beta3 seem to be broken.

I can't seem to re-activate a modal after dismissing it with a swipe down gesture (Not sure if this is related to "No dismiss modal programatically available", apologies if it is).


Force-quitting the app makes the modal available again.

Thanks guys, I'm going to update the original post with your suggestions

Can you share some code of how you're doing this defn?

Slider seems broken in Beta 3. No longer increment by Stride. In the following example, incrementing by 0.1 instead of 0.5


```

Slider(value: $game.score, from: 0.0, through: game.maxScore, by: 0.5)

```

Updating with your suggestion...

You forgot to close the parentheses after 'blue'.


This doesn't work well on a grouped list. The list still shows a gray background. I even tried a ZStack, with the bottom a solid color. No go.


There needs to be a way to specifically change the color of a list or a group list. I don't think that exists now, so please add that to the list.

Also, .onAppear and .onDisappear are not firing during navigation transitions. .onAppear is firing but not when going back. .onDisappear is not firing on navigation transitions.

TextFields are not resized properly when multiline text is used. As a result, some lines at the bottom are clipped from view. The number of lines clipped at the bottom appears to be quite random.

Added, thanks

Beta 4 is now live, I'm downloading and will try everything as soon as I can

Hi Juan,

I tried beta 4, there are 4 problems.

  • Can’t remove rows when peform onDelete modifier of ForEeach
  • Can’t show modal at 2nd times after 1st showing it via presentation modifier (in beta 4, it was called sheet modifier)
  • No way to show keyboard type ,such as decimal pad.
  • Can't find a better way when clicked actionsheet then navigate to anather way.



Thanks

Thanks for the collection. Here is an item from https://forums.developer.apple.com/thread/119541. This is still broken in beta 5 and in Apple's tututorial.


• Use of multiple buttons in a List row does not work