1
public protocol NavigationBarNormalStyle {
var titleView: UIToolbar! {get}
var rightButton: UIButton? {get}
}
public extension NavigationBarNormalStyle where Self == UIViewController {
var titleView:UIToolbar {
var titleViewBar = UIToolbar(frame: CGRect(x: 0.0, y: 0.0, width:Self.view.width, height: 44))
titleViewBar.barTintColor = UIColor.whiteColor()
Self.view.addSubview(titleViewBar)
}
}
Self.view.width
是錯誤的...如何使用VC的財產?擴展協議如何使用的有關的UIViewController的UIViewController的財產