UserProtocolViewController.m 919 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // UserProtocolViewController.m
  3. // XenonSDK
  4. //
  5. // Created by SAGESSE on 2019/5/29.
  6. // Copyright © 2019 SAGESSE. All rights reserved.
  7. //
  8. #import "XenonSDK.h"
  9. #import "UserProtocolViewController.h"
  10. @interface UserProtocolViewController ()
  11. @end
  12. @implementation UserProtocolViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/userPrivacyProtocol/UserProtocol.zip", XSNetwork.baseURL]];;
  16. if (url == nil) {
  17. return;
  18. }
  19. [self.view layoutIfNeeded];
  20. self.contentTextView.contentInset = UIEdgeInsetsZero;
  21. dispatch_async(dispatch_get_global_queue(0, 0), ^{
  22. NSString* str = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  23. dispatch_async(dispatch_get_main_queue(), ^{
  24. self.contentTextView.text = str;
  25. });
  26. });
  27. }
  28. @end