SKLoginViewController+guide.m 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // SKLoginViewController+guide.m
  3. // sikey comm
  4. //
  5. // Created by 刘振兴 on 2024/2/5.
  6. // Copyright © 2024 BaH Cy. All rights reserved.
  7. //
  8. #import "SKLoginViewController+guide.h"
  9. #import "SDCycleScrollView.h"
  10. #import "GuideCellView.h"
  11. @interface SKLoginViewController()<SDCycleScrollViewDelegate>
  12. @end
  13. @implementation SKLoginViewController (guide)
  14. - (void)createGuideView {
  15. return; //yama说去掉
  16. if([EUtil getShowGuideKey] != nil)
  17. return;
  18. [self.mGuideView setHidden:NO];
  19. [self initGuideTitle];
  20. [self initGuideItem];
  21. }
  22. - (void)initGuideTitle {
  23. UILabel* titleLabel = [self.mTitleStackView viewWithTag:10];
  24. UILabel* contentLabel = [self.mTitleStackView viewWithTag:11];
  25. [titleLabel setText:NSLocalizedString(@"Guide.Welcome.0", nil)];
  26. [contentLabel setText:NSLocalizedString(@"Guide.Welcome.1", nil)];
  27. [self.mGuideSkipButton setTitle:NSLocalizedString(@"Guide.Button", nil) forState:UIControlStateNormal];
  28. [self.mGuideSkipButton setTitle:NSLocalizedString(@"Guide.Button", nil) forState:UIControlStateSelected];
  29. }
  30. - (void)initGuideItem {
  31. SDCycleScrollView* view = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, self.mGuideItemView.frame.size.width, self.mGuideItemView.frame.size.height) delegate:self placeholderImage:nil];
  32. [view setBackgroundColor:[UIColor clearColor]];
  33. view.autoScroll = NO;
  34. view.infiniteLoop = NO;
  35. view.currentPageDotImage = [UIImage imageNamed:@"guide_dot_1"];
  36. view.pageDotImage = [UIImage imageNamed:@"guide_dot_0"];
  37. view.imageURLStringsGroup = @[@"", @""];
  38. [self.mGuideItemView addSubview:view];
  39. }
  40. - (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view {
  41. return [GuideCellView class];
  42. }
  43. - (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
  44. GuideCellView *myCell = (GuideCellView *)cell;
  45. [myCell setDatas:index];
  46. }
  47. /** 图片滚动回调 */
  48. - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index {
  49. [self.mGuideSkipButton setHidden:index == 0];
  50. }
  51. - (IBAction)skipAction:(id)sender {
  52. [EUtil setHasShownGuideKey];
  53. [self.mGuideView setHidden:YES];
  54. [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
  55. }
  56. @end