Custom-Shaped Switch in iOS Apps

Alisa "Foxicorn" Nekrasova
The Startup
Published in
4 min readNov 18, 2020

--

Once I got a rather simple-looking task from a regular client of mine: he needed to make a screen for an iOS app with several switches. The switch was long and thin. It was different from both the UISwitch, which has size 51x31 points, and the Material switch, which is more flexible in size, but the thumb is bigger than the track.

Switches from client’s design

I found many solutions on GitHub, but they were either modifications of existing UISwitch, or variations of Material switch. Other options didn’t look like switches at all.

I’ll give some references, in case you’re looking for something different:

  • AIFlatSwitch — the switch looks more like an animated checkbox.
  • MJMaterialSwitch —an iOS implementation of the Android Material Switch.
  • LabelSwitch — the closest switch to what I was looking for. Longer than the standard one, with text on top. Unfortunately, it didn’t work when I tested it.
  • TTSwitch — a very old switch, circular or rectangular.
  • PWSwitch — an animated flat switch with a rather interesting design.
  • Paper Switch —a standard iOS switch, but with an interesting effect on its superview.
  • TKSwitcherCollection — a whole collection of different switch components.
  • SwiftySwitch — a…

--

--

Alisa "Foxicorn" Nekrasova
The Startup

Game and software developer with more than 17 years of experience. Freelancer, writer, author of the book “Swift Recipes for iOS Developers”.