Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

create button with icon swift

button.setImage(UIImage(systemName: "search"), for: .normal)
Comment

swift create custom button with icon programmatically

let googleView = UIView()
googleView.layer.backgroundColor = UIColor.white.cgColor
googleView.frame = CGRect(x: 30, y: 100, width: view.bounds.width - 60, height: 50)
googleView.layer.cornerRadius = googleView.frame.height / 2
let googleButton = UIView()
googleButton.frame = CGRect(x: googleView.layer.cornerRadius, y: 0, width: googleView.frame.width - 2 * googleView.layer.cornerRadius, height: 50
let googleImage = UIImageView(image: UIImage(named: "googleLogo"))
googleImage.frame = CGRect(x: 0, y: 10, width: 30, height: 30)
googleButton.addSubview(googleImage)
let googleLabel = UILabel()
googleLabel.frame = CGRect(x: googleImage.frame.maxX, y: 10, width: 1000, height: 30)
googleLabel.text = "   Sign up with Google"
googleLabel.font = UIFont.boldSystemFont(ofSize: 17)
googleLabel.sizeToFit()
googleLabel.center.y = googleImage.center.y
googleButton.addSubview(googleLabel)
googleButton.frame.size.width = googleLabel.frame.maxX
googleButton.center.x = googleView.frame.width / 2
googleView.addSubview(googleButton)
let googleTap = UITapGestureRecognizer(target: self, action: #selector(googleLogin))
googleView.isUserInteractionEnabled = true
googleView.addGestureRecognizer(googleTap)
view.addSubview(googleView)


  [1]: https://i.stack.imgur.com/HaZyU.png
Comment

PREVIOUS NEXT
Code Example
Swift :: how can i find range of a string in another string swift 
Swift :: convert image to base64 swift Ui 
Swift :: case insensitive multiple word search swift 
Swift :: swiftui tabview background color 
Swift :: how to Not bool bindng swiftui 
Swift :: reprobate 
Swift :: deselect all cell in collectionview 
Swift :: swift show title on navigation bar programmatically 
Swift :: Function Inside Swift Struct 
Swift :: swift int max 
Swift :: How to remove the last item from an array in swift 
Swift :: ios get notification payload 
Swift :: swift firebase realtime db class 
Swift :: Modifying Value Types from Method Swift 
Swift :: how to limit ui field in ios 
Swift :: UINavigationBar turns black 
Swift :: Swift Computed Property In Extension 
Swift :: swift singleton 
Swift :: enums With Raw Values Swift 
Swift :: Swift Bitwise NOT Operator 
Swift :: flow ios swift kotlin 
Swift :: Blinking effect on UILabel 
Swift :: add placeholder to code snippets xcode 
Swift :: swift 5 cancel or end block operation 
Swift :: Swift Difference between Two Sets 
Swift :: cifilter image preserve orientation 
Ruby :: ruby lowercase 
Ruby :: rails generate migration array default value 
Ruby :: ruby if dates is in range 
Ruby :: ruby trim spaces 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =