Created
May 25, 2015 12:15
-
-
Save anonymous/e506d57f2d6531c9ee92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swift içinde oluşturduğum RTF dosyamı şu şekilde viewDidLoad'da çağırıyorum: | |
if let rtfPath = NSBundle.mainBundle().URLForResource("Hayati", withExtension: "rtf") { | |
var error: NSError? | |
let attributedStringWithRtf = NSAttributedString(fileURL: rtfPath, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType], documentAttributes: nil, error: &error) | |
println(error?.localizedDescription) | |
self.hayatiTextView.attributedText = attributedStringWithRtf | |
} | |
// Daha sonra oluşturduğum IBOutlet slider ile Font boyutunu değiştirmek istiyorum: | |
func fontSizeChanged(sender: UISlider){ | |
//Ancak burada fontboyutu büyümesine rağmen RTF dosyamdaki bold, italik gibi özellikler kaybolarak RTF dosyasındaki yazım düz text haline geliyor. | |
hayatiTextView.font = UIFont(name: hayatiTextView.font.fontName, size: CGFloat(sender.value)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment