FBSDKLoginTooltipView.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  2. //
  3. // You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
  4. // copy, modify, and distribute this software in source code or binary form for use
  5. // in connection with the web services and APIs provided by Facebook.
  6. //
  7. // As with any software that integrates with the Facebook platform, your use of
  8. // this software is subject to the Facebook Developer Principles and Policies
  9. // [http://developers.facebook.com/policy/]. This copyright notice shall be
  10. // included in all copies or substantial portions of the software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  14. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  15. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  16. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. #import <UIKit/UIKit.h>
  19. #import <FBSDKLoginKit/FBSDKTooltipView.h>
  20. @protocol FBSDKLoginTooltipViewDelegate;
  21. /**
  22. Represents a tooltip to be displayed next to a Facebook login button
  23. to highlight features for new users.
  24. The `FBSDKLoginButton` may display this view automatically. If you do
  25. not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods
  26. as appropriate and customize behavior via `FBSDKLoginTooltipViewDelegate` delegate.
  27. By default, the `FBSDKLoginTooltipView` is not added to the superview until it is
  28. determined the app has migrated to the new login experience. You can override this
  29. (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES.
  30. */
  31. @interface FBSDKLoginTooltipView : FBSDKTooltipView
  32. /** the delegate */
  33. @property (nonatomic, weak) id<FBSDKLoginTooltipViewDelegate> delegate;
  34. /** if set to YES, the view will always be displayed and the delegate's
  35. `loginTooltipView:shouldAppear:` will NOT be called. */
  36. @property (nonatomic, assign) BOOL forceDisplay;
  37. @end
  38. /**
  39. @protocol
  40. The `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event
  41. notifications from `FBSDKLoginTooltipView` objects.
  42. */
  43. @protocol FBSDKLoginTooltipViewDelegate <NSObject>
  44. @optional
  45. /**
  46. Asks the delegate if the tooltip view should appear
  47. @param view The tooltip view.
  48. @param appIsEligible The value fetched from the server identifying if the app
  49. is eligible for the new login experience.
  50. Use this method to customize display behavior.
  51. */
  52. - (BOOL)loginTooltipView:(FBSDKLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible;
  53. /**
  54. Tells the delegate the tooltip view will appear, specifically after it's been
  55. added to the super view but before the fade in animation.
  56. @param view The tooltip view.
  57. */
  58. - (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView *)view;
  59. /**
  60. Tells the delegate the tooltip view will not appear (i.e., was not
  61. added to the super view).
  62. @param view The tooltip view.
  63. */
  64. - (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView *)view;
  65. @end