Top "Uikit" questions

UIKit (not to be confused with the front-end framework GetUIKit) is the object-oriented framework that is responsible for most of the iOS user interface.

How to sleep for few milliseconds in swift 2.2?

please anyone tell me how to use sleep() for few milliseconds in swift 2.2? while (true){ print("sleep for 0.002 seconds.") sleep(0.002) // …

swift uikit sleep
UIView.animateWithDuration swift loop animation

In ViewController.Swift I managed to make a box animate from one point to another. I thought it would be …

ios swift uikit core-animation uiviewanimation
Changing the background color of a UIAlertView?

I want to change the background color of my UIAlertView, but this doesn't appear to have a color attribute.

iphone objective-c cocoa-touch uikit uialertview
UISegmentedControl change number of segments programmatically

Is there a way to change the number of segments programmatically?

ios uikit uisegmentedcontrol
How to change the colors of a segment in a UISegmentedControl in iOS 13?

A UISegmentedControl has a new appearance in iOS 13 and existing code to alter the colors of the segmented control no …

ios uikit uisegmentedcontrol ios13
How can I reset the NSUserDefaults data in the iPhone simulator?

I've added NSUserDefaults data retrieval to my app, which is pretty nice. But for testing I would like to reset …

iphone ios cocoa-touch uikit nsuserdefaults
UIButton title alignment and multiline support

How do I set the title of a UIButton to be left-aligned, and how can I show multiple lines of …

iphone ios cocoa-touch uikit uibutton
What is the best way to remove all subviews from you self.view?

I was thinking maybe something like this might work: for (UIView* b in self.view.subviews) { [b removeFromSuperview]; } I want …

iphone objective-c ios uikit
How do I prevent a button's background image from stretching?

I'm allocating a UIButtonTypeCustom UIButton to a UIView with a background image that is smaller than the button's frame. Reason …

ios cocoa-touch uiimageview uibutton uikit
Disable the interactive dismissal of presented view controller

iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet) for modally presented view controllers… …and we can …

ios uiviewcontroller uikit modalviewcontroller ios13