Created
November 6, 2018 16:08
-
-
Save fermoya/445115183c5a71cffe597064a20e665e to your computer and use it in GitHub Desktop.
Markdown
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
/** | |
Initializes a new Show Case View. | |
- Parameter target: The bar button that's targeted and whose feature is intended to be exaplained | |
- Parameter label: *Optional*, an identifier for the show case | |
- Remark: From iOS 11 onwards, the target must be a custom bar button item, that is, it must have been created by using *init(customView: UIView?)* constructor. If not so, it'll return *nil* | |
- Note: The show case arrow direction will always point upwards | |
*/ | |
public init?(target: UIBarButtonItem, label: String? = nil) { | |
let targetViewUnwrapped = target.customView ?? (target.value(forKey: "view") as? UIView) | |
guard let targetView = targetViewUnwrapped else { return nil } | |
self.target = targetView | |
self.arrowDirection = .up | |
self.label = label | |
super.init(frame: CGRect.zero) | |
isBarButton = true | |
shouldWhitenScreenshot = true | |
setUp() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment