skip to Main Content

Value of type 'UIView?' has no member 'titleLabel' – Ios swift

I am trying to specify custom font for admob native ads CTA button. But I'm getting this error. Value of type 'UIView?' has no member 'titleLabel' ListTileNativeAdFactory: class ListTileNativeAdFactory : FLTNativeAdFactory { ... ... (nativeAdView.callToActionView as? UIButton)?.setTitle(nativeAd.callToAction, for: .normal) nativeAdView.callToActionView.titleLabel.font…

VIEW QUESTION

UIButton titleLabel has padding – Ios swift

UIButton title label has top and bottom padding, I want to remove padding. Set UIButton content mode did not work. Here is my code lazy var button: UIButton = { let button = UIButton(type: .custom) button.translatesAutoresizingMaskIntoConstraints = false button.setTitleColor(ThemeColor.red, for:…

VIEW QUESTION

Swift show price depends on Locale – Ios swift

I am getting a string value that represents a price. I want to convert it to another string with specific precision and format it according to a current device Locale. Decimal(string: "123,4567", locale: NSLocale.current)?.formatted(.number.precision(.fractionLength(precision))) This code works for the german…

VIEW QUESTION
Back To Top
Search