Decathlon / vitamin-ios

Decathlon Design System UI components for iOS & iPadOS applications
https://www.decathlon.design
Apache License 2.0
46 stars 14 forks source link

feat: SegmentedControl UIKit implementation #115

Closed daniel-dumortier closed 1 year ago

daniel-dumortier commented 1 year ago

Changes description

Implementation of Vitamin tab component for UIKit. It is a subclass of standard UISegmentedControl, with only customization of:

The PR also contains a VitaminTabsController that handles a common use case : display a VitaminTabs at the top of the screen, and a viewController below, depending on the tab selected

Context

UIKit part of #41

Checklist

Does this introduce a breaking change?

Screenshots

iPhone

Simulator Screen Shot - iPhone 8 - 2023-02-06 at 23 22 55

iPad

Simulator Screen Shot - iPad (9th generation) - 2023-02-06 at 23 23 59

Other information

I named the component VitaminTab, but I wonder if it should not been named VitaminSegmentedControl, that would be more understandable by iOS developers.

SimonLeclercq commented 1 year ago

Hey @daniel-dumortier, Feel free to discuss with @florentlotthepro about the component name. Keep in mind that we want to stay as close as possible to the developer's experience of the platform. On the Design side, this component is named segmented control.

SimonLeclercq commented 1 year ago

@daniel-dumortier I'm not able to find the bitrise link 🤔 Can you help me? 😎

daniel-dumortier commented 1 year ago

@SimonLeclercq the showcase has not been built yet, that's why you can't find the link ;) Since I added a new feature on this branch following @florentlotthepro 's suggestion (in short, a generic screen that handles the display of other sub-screens depending on the segment selected), I wait for other code owners technical review before submitting it to you (to ensure it is clean on a code point of view)

daniel-dumortier commented 1 year ago

@SimonLeclercq The build is available, you can find the link on Slack

daniel-dumortier commented 1 year ago

@SimonLeclercq Honestly, I do not really get what you mean by horizontal shift, but for info, I just styled the native SegmentedControl component (with custom font, size, colors, and shadow), thus I do not have any way to shift or move the labels in the segmented control. I just let iOS place them inside the component.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

SimonLeclercq commented 1 year ago

Ok so no problem 👍 thanks for feedback !