UISegmentedcontrol - toggle like radio buttons

Anyone know if this can be done (I’ll write a custom class if necesary)
I need this to work like the Tabpanel bar does… right now it just changes the text color and I want the whole selection to remain selected/highlighted until another segment is tapped

NOT for Xojo, but Swift (I’ll even take an ObjC solution :slight_smile: )

isMomentary set to false ?

yup

Turns out I had created such a control about a year ago for a previous AppleTV project. It works as is on iPhone/iPad, just need to adapt the code to work for macOS so I can create a consistent UI.

This one even had the ability to put option “badges” on each segment :slight_smile:x

The light green is current selected, the gold is “the cursor” (will only appear on an ATV app, other wise its just the light green one)

1 Like

If anyone is interested… I have a single module that creates this controls for all Apple Platforms (except Watch)

All colors, fonts, sizes, etc are completely customizable (unlike the standard UISegmentedcontrol)
The default colors match the style used in iOS/tvOS

This doesn’t support icons …but it will be something I will probably add soon

There are two subclasses… one creates a Horizontal like the segmented control
the other is vertical like a drop down menu

Here are examples using Default settings. and this code

let mySeg =  dsMENUBAR_V(frame:CGRect(x:100,y:300,width:200,height:144))
mySeg.addButton("Card Faces")
mySeg.addButton("Card Backs")
mySeg.addButton("Backgrounds")
parent.addSubview(mySeg)

y

1 Like