Objective-C
UIImage *btnImage = [UIImage imageNamed:@"image.png"];
[btnTwo setImage:btnImage forState:UIControlStateNormal];
Swift 5.1
let btnImage = UIImage(named: "image")
btnTwo.setImage(btnImage , for: .normal)
More Related Contents:
- Proper way to exit iPhone application?
- How to get device make and model on iOS?
- How do I URL encode a string
- Save images in NSUserDefaults?
- Detect current device with UI_USER_INTERFACE_IDIOM() in Swift
- UIButton Image + Text IOS
- How can I click a button behind a transparent UIView?
- Detect iOS device type
- How do you add an action to a button programmatically in xcode
- How can I programmatically get the MAC address of an iphone
- How to hide UINavigationBar 1px bottom line
- Firebase query – Find item with child that contains string
- UIScrollView not scrolling
- iOS detect if user is on an iPad
- What’s the best way to find the user’s Documents directory on an iPhone?
- iOS app error – Can’t add self as subview
- How can I set the title of a UIButton as left-aligned?
- Change iPhone UISlider bar image
- How can I save an image to the camera roll?
- How to draw a “speech bubble” on an iPhone?
- PDF search on the iPhone
- Positioning MKMapView to show multiple annotations at once
- Volunteermatch API Objective C
- UITableView and UIView with keyboardWillShow
- Why Safari shows “No Inspectable Applications” during remote debugging with iOS 6 device?
- UISlider that snaps to a fixed number of steps (like Text Size in the iOS 7 Settings app)
- What is the difference between UIApplication.sharedApplication.delegate.window and UIApplication.sharedApplication.keyWindow?
- Prevent scrolling in a MKMapView, also when zooming
- How do I calculate the UILabel height dynamically [duplicate]
- How to use HTTP Live Streaming protocol in iPhone SDK 3.0