Hoşgeldin. Soru sormak veya cevaplamak için hemen üye ol.
0 oy
273 kez görüntülendi
ios development kategorisinde tarafından
if let attributes: AnyObject = [
            NSForegroundColorAttributeName: UIColor.white,
            NSFontAttributeName: UIFont(name: "AvenirNext-Bold", size: 16)!
            ] as AnyObject? {
                self.navigationController?.navigationBar.titleTextAttributes = attributes as? [String : AnyObject]
        }

Şimdi yukarıdaki ilk satırda şu uyarı geliyor:

Non-optional expression of type 'AnyObject' used in a check for optionals

Nasıl düzeltebilirim? Teşekkürler.

1 cevap

+1 oy
tarafından
tarafından seçilmiş
 
En İyi Cevap
let attributes: [String:AnyObject] = [ 
NSForegroundColorAttributeName: UIColor.white, 
NSFontAttributeName: UIFont(name: "AvenirNext-Bold", size: 16)!
]
self.navigationController?.navigationBar.titleTextAttributes = attributes
tarafından

Teşekkür ederim Yasin üstadım

...