Swift
xxxxxxxxxx
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let image = UIImage(named: "no_image-128.png")
let button = UIButton()
button.frame = CGRect(x: 10, y: 100, width: 100, height: 100)
button.setBackgroundImage(image, for: UIControl.State.normal)
button.addTarget(self, action:#selector(self.imageButtonTapped(_:)), for: .touchUpInside)
self.view.addSubview(button)
}
@objc func imageButtonTapped(_ sender:UIButton!)
{
print("My image button tapped")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
Linux - How to Install anc-api-tools
Linux - How to Install curvedns
Python - Check if a Number is Positive, Negative or 0
Linux - How to Install zenmap
C - Count Number of Digits in an Integer
C++ - Check Whether a Number is Prime or Not
JavaScript - Check Whether a String Starts and Ends With Certain Characters
C - Find Largest Number Using Dynamic Memory Allocation
Kotlin - Reverse a Number
Kotlin - Round a Number to n Decimal Places
Linux - How to Install zfs-test
C++ - Check Leap Year
Linux - How to Install xbitmaps
Linux - How to Install zstd
Kotlin - Find Factorial of a Number
Python - Writing Excel (XLSX) Files
Java - Reverse a Number
Java - Create Pyramid and Pattern
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month