Warning: Undefined array key "ssba_bar_buttons" in /home/www/igomobile/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 598
Warning: Undefined array key "ssba_bar_buttons" in /home/www/igomobile/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 598
Warning: Undefined array key "ssba_bar_buttons" in /home/www/igomobile/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 598
Warning: Undefined array key "ssba_bar_buttons" in /home/www/igomobile/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 598
Warning: Undefined array key "ssba_bar_buttons" in /home/www/igomobile/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 598
To save NSAttributedString string into text file we convert first NSAttributedString into Data and afterwards save Data as usual into a text file:
do {
let rtfData = try attributedText.data(from: .init(location: 0, length: attributedText.length), documentAttributes: [.documentType: NSAttributedString.DocumentType.rtf])
try rtfData.write(to: fileURL, options: .atomic)
} catch {
print(error)
}