fluentui-apple icon indicating copy to clipboard operation
fluentui-apple copied to clipboard

Add SwiftUI support to Fluent UI

Open chadradams opened this issue 2 years ago • 6 comments

Platform

  • [X] iOS
  • [X] macOS

Describe the feature that you would like added

In order to support newer iOS / macOS / visionOS platforms, SwiftUI support will be vital.

What component or utility would this be added to

All existing supported components.

Have you discussed this feature with our team, and if so, who

Not at this time.

Additional context/screenshots

Reference in the docs about lack of support.

image

chadradams avatar Dec 11 '23 15:12 chadradams

I think some components do have SwiftUI versions. See Avatar docs here.

If you would like SwiftUI support for some particular component, please feel free to highlight that.

imthath-m avatar Jan 24 '24 02:01 imthath-m

@imthath-m Avatar does have it, I might recommend some core controls for SwiftUI: Button, TextField, Label, & Searchbar those would be excellent starter controls to start moving to SwiftUI.

chadradams avatar Jan 24 '24 16:01 chadradams

One aspect that we are trying to keep in mind is that, based on past experimentation, SwiftUI components add significantly to the binary size of the Fluent UI module. This is something that various clients have pushed back against (rightly, in my opinion).

So before we start adding SwiftUI variants of our components, I think we want to take some time and consider our approach to modularization and pay-for-play consumption of the library. This could take many approaches, including potentially a fully separate SwiftUI library from our existing (mostly) UIKit one.

mischreiber avatar Jan 29 '24 22:01 mischreiber

All valid points Mike, but at some point for the library to still be worthwhile, will be Swift UI compatibility. Apple is very intent on moving everyone to Swift UI. Even Vision OS doesn't even include UI Kit libraries. Even the current look of Office on Vision Pro looks mostly void of Fluent using only icons (possibly ported from the React library).

image

chadradams avatar Jan 29 '24 23:01 chadradams

@mischreiber Thanks for the info.

I've seen this modularization being mentioned in some other places as well but can't find any progress towards to it. What steps are being taken to achieve it and where can find more info about it?

By the way, I'm already almost done with adding SwiftUI button #1960. It adds about 150kb to the module.

imthath-m avatar Jan 30 '24 06:01 imthath-m

Even Vision OS doesn't even include UI Kit libraries.

Not to focus too tightly on this, but UIKit is fully supported on visionOS. Apple even has a WWDC video for getting started on porting UIKit apps to SwiftUI: Meet UIKit for spatial computing.

mischreiber avatar Feb 01 '24 21:02 mischreiber