algolia / instantsearch-ios

⚡️ A library of widgets and helpers to build instant-search applications on iOS.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/ios/
Apache License 2.0
591 stars 55 forks source link

Expose text field background / foreground colors to enable dark mode support #234

Open msmollin opened 1 year ago

msmollin commented 1 year ago

Summary

The text field background and foreground color for the main search bar component is not dark mode aware, so this PR exposes them for 3rd party developers to override and customize.

Result

The Xcode project in this repository seems to require special local configuration in order to build from the project file, so I opened the Package.swift file and made sure the changes built using the package declarations (which it did).

Also I made a minor update to specify the generic type of the button label in order to satisfy Swift's compiler in Xcode 13.4.1 which could not figure out the Button's label type. If you find this unnecessary I'm happy to remove it.

VladislavFitz commented 1 year ago

Hi @msmollin , Thank you for your contribution.

The Xcode project in this repository seems to require special local configuration

The Xcode project file is there only for Carthage support, you did right using the Package.swift file.

I made a minor update to specify the generic type of the button label in order to satisfy Swift's compiler in Xcode 13.4.1 which could not figure out the Button's label type.

I have no issue in Xcode 13.4.1. Did you try it on another machine?

Could you also provide a snippet of how you consider to use these parameters in a real SwiftUI view? I suppose you might add these new parameters to initializer with default values to ensure a better developer experience.