| | |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import "TargetConditionals.h" |
| | | |
| | | #if !TARGET_OS_TV |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /*! |
| | | @typedef FBSDKTooltipViewArrowDirection enum |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @abstract |
| | | Passed on construction to determine arrow orientation. |
| | | /** |
| | | FBSDKTooltipViewArrowDirection enum |
| | | |
| | | Passed on construction to determine arrow orientation. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKTooltipViewArrowDirection) |
| | | { |
| | | /*! View is located above given point, arrow is pointing down. */ |
| | | /** View is located above given point, arrow is pointing down. */ |
| | | FBSDKTooltipViewArrowDirectionDown = 0, |
| | | /*! View is located below given point, arrow is pointing up. */ |
| | | /** View is located below given point, arrow is pointing up. */ |
| | | FBSDKTooltipViewArrowDirectionUp = 1, |
| | | }; |
| | | } NS_SWIFT_NAME(FBTooltipView.ArrowDirection); |
| | | |
| | | /*! |
| | | @typedef FBSDKTooltipColorStyle enum |
| | | /** |
| | | FBSDKTooltipColorStyle enum |
| | | |
| | | @abstract |
| | | Passed on construction to determine color styling. |
| | | Passed on construction to determine color styling. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKTooltipColorStyle) |
| | | { |
| | | /*! Light blue background, white text, faded blue close button. */ |
| | | /** Light blue background, white text, faded blue close button. */ |
| | | FBSDKTooltipColorStyleFriendlyBlue = 0, |
| | | /*! Dark gray background, white text, light gray close button. */ |
| | | /** Dark gray background, white text, light gray close button. */ |
| | | FBSDKTooltipColorStyleNeutralGray = 1, |
| | | }; |
| | | } NS_SWIFT_NAME(FBTooltipView.ColorStyle); |
| | | |
| | | /*! |
| | | @class FBSDKTooltipView |
| | | /** |
| | | |
| | | @abstract |
| | | Tooltip bubble with text in it used to display tips for UI elements, |
| | | Tooltip bubble with text in it used to display tips for UI elements, |
| | | with a pointed arrow (to refer to the UI element). |
| | | |
| | | @discussion |
| | | |
| | | |
| | | The tooltip fades in and will automatically fade out. See `displayDuration`. |
| | | */ |
| | | NS_SWIFT_NAME(FBTooltipView) |
| | | @interface FBSDKTooltipView : UIView |
| | | |
| | | /*! |
| | | @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. |
| | | |
| | | @discussion Set this to zero to make the display permanent until explicitly dismissed. |
| | | /** |
| | | Gets or sets the amount of time in seconds the tooltip should be displayed. |
| | | Set this to zero to make the display permanent until explicitly dismissed. |
| | | Defaults to six seconds. |
| | | */ |
| | | @property (nonatomic, assign) CFTimeInterval displayDuration; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the color style after initialization. |
| | | |
| | | @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. |
| | | /** |
| | | Gets or sets the color style after initialization. |
| | | Defaults to value passed to -initWithTagline:message:colorStyle:. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKTooltipColorStyle colorStyle; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the message. |
| | | /** |
| | | Gets or sets the message. |
| | | */ |
| | | @property (nonatomic, copy) NSString *message; |
| | | @property (nonatomic, copy, nullable) NSString *message; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
| | | /** |
| | | Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
| | | */ |
| | | @property (nonatomic, copy) NSString *tagline; |
| | | @property (nonatomic, copy, nullable) NSString *tagline; |
| | | |
| | | /*! |
| | | @abstract |
| | | Designated initializer. |
| | | /** |
| | | Designated initializer. |
| | | |
| | | @param tagline First part of the label, that will be highlighted with different color. Can be nil. |
| | | |
| | |
| | | |
| | | @param colorStyle Color style to use for tooltip. |
| | | |
| | | @discussion |
| | | |
| | | |
| | | If you need to show a tooltip for login, consider using the `FBSDKLoginTooltipView` view. |
| | | |
| | | |
| | | @see FBSDKLoginTooltipView |
| | | */ |
| | | - (instancetype)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBSDKTooltipColorStyle)colorStyle; |
| | | - (instancetype)initWithTagline:(nullable NSString *)tagline |
| | | message:(nullable NSString *)message |
| | | colorStyle:(FBSDKTooltipColorStyle)colorStyle; |
| | | |
| | | /*! |
| | | @abstract |
| | | Show tooltip at the top or at the bottom of given view. |
| | | /** |
| | | Show tooltip at the top or at the bottom of given view. |
| | | Tooltip will be added to anchorView.window.rootViewController.view |
| | | |
| | | @param anchorView view to show at, must be already added to window view hierarchy, in order to decide |
| | | where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - |
| | | tooltip will be shown at the bottom of it) |
| | | |
| | | @discussion |
| | | |
| | | |
| | | Use this method to present the tooltip with automatic positioning or |
| | | use -presentInView:withArrowPosition:direction: for manual positioning |
| | | If anchorView is nil or has no window - this method does nothing. |
| | | */ |
| | | - (void)presentFromView:(UIView *)anchorView; |
| | | |
| | | /*! |
| | | @abstract |
| | | Adds tooltip to given view, with given position and arrow direction. |
| | | /** |
| | | Adds tooltip to given view, with given position and arrow direction. |
| | | |
| | | @param view View to be used as superview. |
| | | |
| | |
| | | @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or |
| | | down (message bubble is above the arrow). |
| | | */ |
| | | - (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBSDKTooltipViewArrowDirection)arrowDirection; |
| | | - (void)presentInView:(UIView *)view |
| | | withArrowPosition:(CGPoint)arrowPosition |
| | | direction:(FBSDKTooltipViewArrowDirection)arrowDirection |
| | | NS_SWIFT_NAME(present(in:arrowPosition:direction:)); |
| | | |
| | | /*! |
| | | @abstract |
| | | Remove tooltip manually. |
| | | /** |
| | | Remove tooltip manually. |
| | | |
| | | @discussion |
| | | |
| | | |
| | | Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. |
| | | */ |
| | | - (void)dismiss; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
| | | |
| | | #endif |