12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- //
- // SKLoginViewController+guide.m
- // sikey comm
- //
- // Created by 刘振兴 on 2024/2/5.
- // Copyright © 2024 BaH Cy. All rights reserved.
- //
- #import "SKLoginViewController+guide.h"
- #import "SDCycleScrollView.h"
- #import "GuideCellView.h"
- @interface SKLoginViewController()<SDCycleScrollViewDelegate>
- @end
- @implementation SKLoginViewController (guide)
- - (void)createGuideView {
- return; //yama说去掉
- if([EUtil getShowGuideKey] != nil)
- return;
- [self.mGuideView setHidden:NO];
- [self initGuideTitle];
- [self initGuideItem];
- }
- - (void)initGuideTitle {
- UILabel* titleLabel = [self.mTitleStackView viewWithTag:10];
- UILabel* contentLabel = [self.mTitleStackView viewWithTag:11];
-
- [titleLabel setText:NSLocalizedString(@"Guide.Welcome.0", nil)];
- [contentLabel setText:NSLocalizedString(@"Guide.Welcome.1", nil)];
-
- [self.mGuideSkipButton setTitle:NSLocalizedString(@"Guide.Button", nil) forState:UIControlStateNormal];
- [self.mGuideSkipButton setTitle:NSLocalizedString(@"Guide.Button", nil) forState:UIControlStateSelected];
- }
- - (void)initGuideItem {
- SDCycleScrollView* view = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, self.mGuideItemView.frame.size.width, self.mGuideItemView.frame.size.height) delegate:self placeholderImage:nil];
- [view setBackgroundColor:[UIColor clearColor]];
- view.autoScroll = NO;
- view.infiniteLoop = NO;
- view.currentPageDotImage = [UIImage imageNamed:@"guide_dot_1"];
- view.pageDotImage = [UIImage imageNamed:@"guide_dot_0"];
- view.imageURLStringsGroup = @[@"", @""];
- [self.mGuideItemView addSubview:view];
- }
- - (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view {
- return [GuideCellView class];
- }
- - (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
- GuideCellView *myCell = (GuideCellView *)cell;
- [myCell setDatas:index];
- }
- /** 图片滚动回调 */
- - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index {
- [self.mGuideSkipButton setHidden:index == 0];
- }
- - (IBAction)skipAction:(id)sender {
- [EUtil setHasShownGuideKey];
- [self.mGuideView setHidden:YES];
- [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
- }
- @end
|