button sizetofit not working swift
class ResizableButton: UIButton {
override var intrinsicContentSize: CGSize {
let imageViewWidth = imageView?.frame.width ?? 0.0
let labelSize = titleLabel?.sizeThatFits(CGSize(width: frame.width, height: .greatestFiniteMagnitude)) ?? .zero
let desiredButtonSize = CGSize(width: labelSize.width + titleEdgeInsets.left + titleEdgeInsets.right + imageViewWidth, height: labelSize.height + titleEdgeInsets.top + titleEdgeInsets.bottom)
return desiredButtonSize
}
}
Also in Swift:
- number of characters in a string swift
- core data save
- enum from raw value swift
- swift date difference in days
- add shadow to UIButton swift
- alertdialog flutter
- disable commit editing style swift
- center text swiftui
- how do i have countdown timer in swift stackoverflow
- swift completion handler
- guard let swift
- duplicate modifier swiftui error
- swipe right to delete swiftui
- swift uiview add tap gesture
- check google ads sdk version swift
- screen recorder swift
- uilabel.text from array string
- swift 5 progress bar height
- Module compiled with Swift 5.3 cannot be imported by the Swift 5.3.1 compiler
- changing color of background swift
- one line if statement swift
- remove back button from navigation bar swift
- swift 5 only the day number from date
- generate hmac swift