Legacy Segmented Control style?

iOS 13+ have a different UISegmented view than 7-12, and I don't like the way it appears in my app. Can I enable some legacy style or make it appear like it did before?

Accepted Reply

partially solved by compiling with Xcode 10, not the best way to go about it, but i don't plan to upload my app to the app store. also seems to bring most features from iOS 12 into 13, like the classic 3d touch, and outlined switches. delighted with the result!

Replies

What don't you like ? Rounded corners ?
If so, could you try to subclass UISegmentedControl as follows:
Code Block
class SquareSegmentedControl: UISegmentedControl {
override func layoutSubviews() {
super.layoutSubviews()
layer.cornerRadius = 0
for view in self.subviews {
view.roundCorners(corners: UIRectCorner.allCorners, radius: 0)
}
}
}

If there are other points which cause problem, have a look here.
https ://medium. com/flawless-app-stories/ios-13-uisegmentedcontrol-3-important-changes-d3a94fdd6763
If that's not enough, you could define your complete custom segmentedControl.

But note that unless you have a compelling reason to do so, it's not a great idea to go against standard control design. Very rapidly, your app will look outdated and surprise the users.
partially solved by compiling with Xcode 10, not the best way to go about it, but i don't plan to upload my app to the app store. also seems to bring most features from iOS 12 into 13, like the classic 3d touch, and outlined switches. delighted with the result!