RASingleton.m 565 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // RASingleton.m
  3. // iShop
  4. //
  5. // Created by Rui Zhang on 12/18/23.
  6. //
  7. #import "RASingleton.h"
  8. @implementation RASingleton
  9. #pragma mark - Method
  10. + (instancetype)sharedInstance {
  11. static RASingleton *singleton = nil;
  12. static dispatch_once_t onceToken;
  13. dispatch_once(&onceToken, ^{
  14. singleton = [[RASingleton alloc] init];
  15. // [[NSNotificationCenter defaultCenter] addObserver:singleton selector:@selector(handleLogin:) name:User_LoginOK_Notification object:nil];
  16. });
  17. return singleton;
  18. }
  19. @end