How to set multi line Large title in navigation bar? ( New feature of iOS 11)

Based in @krunal answer, this is working for me: extension UIViewController { func setupNavigationMultilineTitle() { guard let navigationBar = self.navigationController?.navigationBar else { return } for sview in navigationBar.subviews { for ssview in sview.subviews { guard let label = ssview as? UILabel else { break } if label.text == self.title { label.numberOfLines = 0 label.lineBreakMode = … Read more

Tap on a part of text of UILabel

#swift 4.2 Please find the solution here for getting specific text action of Label. Label declaration @IBOutlet weak var lblTerms: UILabel! Set attributed text to the label let text = “Please agree for Terms & Conditions.” lblTerms.text = text self.lblTerms.textColor = UIColor.white let underlineAttriString = NSMutableAttributedString(string: text) let range1 = (text as NSString).range(of: “Terms & … Read more

changing the text color of a UILabel

The question was already answered for the OP, but for the sake of other people who come here trying to change a label’s text color, use the textColor property: Swift myLabel.textColor = UIColor.red // or .red Objective-C myLabel.textColor = [UIColor redColor];

How to change an UILabel/UIFont’s letter spacing?

From iOS 6 you can use NSAttributedString in UILabel. In attributed string you can use attribute NSKernAttributeName to set letter spacing NSMutableAttributedString* attrStr = [[NSMutableAttributedString alloc] initWithString: @”Test test test test “]; [attrStr addAttribute:NSKernAttributeName value:@(4.0) range:NSMakeRange(0, attrStr.length)]; UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 300, 300, 100)]; label.attributedText = attrStr;

Fit text in UILabel

I think you just need to add this: label.adjustsFontSizeToFitWidth = YES; label.minimumFontSize = 0; Then the text will automatically resize to fit the label. Note however that this will only really work if the label.numberOfLines = 1, so that the text is on a single line. If you need the text to wrap onto multiple … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)