I follow this post to implement a UIPopoverBackgroundView
. I checked the UIPopoverBackgroundView
class, I think I have implemented all required functions and variables, but the error still persist when running .
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIPopoverBackgroundView setArrowOffset:] must be implemented by subclassers.'
import UIKit
class CustomPopoverBackground: UIPopoverBackgroundView {
override func layoutSubviews() {
super.layoutSubviews()
}
override var arrowOffset: CGFloat {
get {
return 0.0
}
set {
super.arrowOffset = newValue
}
}
override var arrowDirection: UIPopoverArrowDirection {
get {
return UIPopoverArrowDirection.Up
}
set {
super.arrowDirection = newValue
}
}
override class func contentViewInsets() -> UIEdgeInsets {
return UIEdgeInsetsMake(10, 10, 10, 10)
}
override class func arrowBase() -> CGFloat {
return 2.0
}
override class func arrowHeight() -> CGFloat {
return 2.0
}
}
Where did I wrong? What is setArrowOffset
, I didn't find it in the class of UIPopoverBackgroundView
or UIPopoverBackgroundViewMethods
protocol.