Skip to content

Instantly share code, notes, and snippets.

Created May 25, 2015 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e506d57f2d6531c9ee92 to your computer and use it in GitHub Desktop.
Save anonymous/e506d57f2d6531c9ee92 to your computer and use it in GitHub Desktop.
// 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