TapAuthResult.h 813 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // TapAuthResult.h
  3. // TapCommonSDK
  4. //
  5. // Created by 黄驿峰 on 2022/1/27.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <TapCommonSDK/TapAuthAccessToken.h>
  9. typedef NS_ENUM(NSInteger, TapAuthResultType) {
  10. TapAuthResultTypeSuccess,
  11. TapAuthResultTypeCancel,
  12. TapAuthResultTypeError,
  13. };
  14. NS_ASSUME_NONNULL_BEGIN
  15. @interface TapAuthResult : NSObject
  16. @property (nonatomic, assign, readonly) TapAuthResultType type;
  17. @property (nonatomic, strong, nullable, readonly) TapAuthAccessToken *token;
  18. @property (nonatomic, strong, nullable, readonly) NSError *error;
  19. + (instancetype)successWithToken:(TapAuthAccessToken *)token;
  20. + (instancetype)failWithError:(NSError *)error;
  21. + (instancetype)cancel;
  22. + (instancetype)new NS_UNAVAILABLE;
  23. - (instancetype)init NS_UNAVAILABLE;
  24. @end
  25. NS_ASSUME_NONNULL_END