Blog for Custom UILabel Effects.
let strokeTextAttributes = [
NSAttributedStringKey.strokeColor : UIColor.red,
NSAttributedStringKey.foregroundColor : UIColor.white,
NSAttributedStringKey.strokeWidth : -4.0,
NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 30)]
as [NSAttributedStringKey : Any]
//Making outline here
labelOutLine.attributedText = NSMutableAttributedString(string: “Your outline text”, attributes: strokeTextAttributes)
let attributedString = NSMutableAttributedString(string: “Your UnderLine text”)
attributedString.addAttribute(NSAttributedStringKey.underlineStyle, value: NSUnderlineStyle.styleSingle.rawValue, range: NSRange(location: 0, length: attributedString.length))
//Underline effect here
labelUnderLine.attributedText = attributedString