Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

change font of substring swift

let longestWordRange = (longString as NSString).range(of: longestWord)

let attributedString = NSMutableAttributedString(string: longString, attributes: [NSAttributedStringKey.font : UIFont.systemFont(ofSize: 20)])

attributedString.setAttributes([NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 20), NSAttributedStringKey.foregroundColor : UIColor.red], range: longestWordRange)
Comment

PREVIOUS NEXT
Code Example
Swift :: closure swift 
Swift :: swift push view controller programmatically 
Swift :: swift convert base64 string to data 
Swift :: swift add width height constraint to view without a lot of code 
Swift :: power swift 
Swift :: swift calendar components 
Swift :: swift create uinavigationcontroller programmatically 
Swift :: HOW TO KNOW IPHONE BETTRY CHARGE IN SWIFTUI 
Swift :: transform string to url swift 
Swift :: add shadow to specific corner of UIView with shadow swift 6 site:stackoverflow.com 
Swift :: simple alert swifti 
Swift :: swift remove value dictionary 
Swift :: convert uiimage to swiftui image 
Swift :: type String and int swift addition 
Swift :: Swift Bitwise AND Operator 
Swift :: Swift Closure Parameters 
Swift :: while loop in swift 
Swift :: swift array map example 
Swift :: swift wait until condition is true 
Swift :: Swift enums with rawValue 
Swift :: set time programmatically swift 
Swift :: multiline comment in swift 
Swift :: implement swift protocol in kotlin 
Swift :: Swift Bitwise NOT Operator 
Swift :: change button image tint color swift 
Swift :: selenium lfor loops 
Swift :: swift truncate a float 
Swift :: Swift Deinitialization 
Swift :: swift await async 
Ruby :: create rails app with postgres 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =