Questions tagged [uiswitch]

You use the UISwitch class to create and manage the On/Off buttons which can be seen in iOS, for example, in the preferences (Settings) for such services as Airplane Mode. These objects are known as switches. The UISwitch class declares a property and a method to control its on/off state. As with UISlider, when the user manipulates the switch control a UIControlEventValueChanged event is generated, which results in the control sending an action message.

A UISwitch lets the user turn an option on and off in iOS. UISwitches used throughout the Settings app to let a user quickly toggle a specific setting.

Switches do not need a delegate to function properly; their parent view controller can define their behavior without implementing any delegate protocols.

You can customize the appearance of the switch by changing the color used to tint the switch when it is on or off.

Reference Link : UISwitch Document

For more information about appearance and behavior configuration, see Switches

954 questions
-3
votes
1 answer

Disable Screen in iOS app?

I wanted to know if it is possible to disable a specific screen from appearing if the user slides a switch in a settings menu?
Alderp
  • 23
  • 2
-3
votes
2 answers

Objective-C UISwitch change state of another UISwitch

Could anyone please show me how I can make one UISwitch affect the state of another UISwitch? Thanks! B.
user3333936
  • 1
  • 1
  • 2
-4
votes
1 answer

Weird behavior of the UISwitch

My Switch animation stuck somewhere between on and off. It happens after the switch goes out of screen bounds (The switch is inside the table view cell). I don't face this issue if I don't let the cell to go out of the screen bounds. I've set…
Roma Kavinskyi
  • 268
  • 4
  • 12
-4
votes
2 answers

use a switch to change background color in XCode

I'm essentially brand new to developing iOS in XCode, so this is probably a really simply question. I want to know how I can change the background color of my View Controller using a simple switch- in other words, how do I make it so that when a…
sirwhirlwind
  • 1
  • 1
  • 4
-4
votes
2 answers

Creating my custom UISwitch

i am looking for a solution to customize a UISwitch the desigred looks lie this : how would you managed it?
orthehelper
  • 4,009
  • 10
  • 40
  • 67
-4
votes
2 answers

why function doesn't return true?

I have a function that checks to see if the UISwitch in the parameter is switched on, if it is, then it will return true. I have an if statement that checks if the function returns true, if it is in fact true, it should nslog, but it doesnt. Any…
Josue Espinosa
  • 5,009
  • 16
  • 47
  • 81
-4
votes
1 answer

Creating a simple interface like settings (ios)

I'm trying to create the same interface as in the screenshot: https://i.stack.imgur.com/MqRtR.png This is my first application I've got running uiswitch, navigation bar and default background settings. How to create a cell with the text on the left…
-5
votes
2 answers

Switch control to toggle isHidden

I have an app with two switch controls to hide or show some textfield depending on their state on or off. The problem is the first switch seems to control the second one. If the first switch is off, the second switch is off also. I would like them…
John
  • 1
  • 3
-6
votes
2 answers

How to get boolean value from switch state?

I want to get the current Boolean of the switch. how to do that in swift4 ? @IBOutlet weak var switch_1: UISwitch! var switch1_state: Bool = swich_1.get ???
user9212972
  • 39
  • 2
  • 8
1 2 3
63
64