### Loading and Displaying Guide View in Objective-C Source: https://github.com/bupterambition/awesomeintroguideview/blob/master/README.md Demonstrates how to initialize and display the AwesomeIntroGuideView within viewDidLayoutSubviews, load guide data, and start the guide. Includes UICollectionViewDataSource methods and a lazy accessor for the guide view instance. ```Objective-C - (void)viewDidLayoutSubviews { if (self.coachMarksShown == NO && self.introduceArray.count) { [self.coachMarksView loadMarks:self.introduceArray]; [self.coachMarksView loadGuideImageUrl:introGuideImgUrl withPoint:(CGPoint){70,100} redirectURL:@"http://www.mogujie.com/" withFrequency:0]; [self.coachMarksView start]; } } #pragma mark - UICollectionViewDataSource - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 20; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; if (indexPath.row %5 == 0 && self.introduceArray.count <=3 && indexPath.row != 0) { [self.introduceArray addObject:cell]; }cell.backgroundColor = [UIColor colorWithRed:arc4random()%100/100. green:arc4random()%100/100. blue:arc4random()%100/100. alpha:arc4random()%100/100.]; return cell; } #pragma mark - Accessor - (AwesomeIntroGuideView *)coachMarksView { if (!_coachMarksView) { _coachMarksView = [[AwesomeIntroGuideView alloc] initWithFrame:[UIScreen mainScreen].bounds]; } return _coachMarksView; } ``` -------------------------------- ### Setting Up Guide View Callback Blocks in Objective-C Source: https://github.com/bupterambition/awesomeintroguideview/blob/master/README.md Shows how to define and assign callback blocks to the AwesomeIntroGuideView instance to receive notifications when the guide completes, is about to complete, or when navigating between coach marks. ```Objective-C - (void)setUpCoachMarksViewCallBack { self.coachMarksView = [[AwesomeIntroGuideView alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.coachMarksView.completionBlock = ^(AwesomeIntroGuideView *guideView){ NSLog(@"%@",guideView); }; self.coachMarksView.willCompletionBlock = ^(AwesomeIntroGuideView *guideView){ NSLog(@"%@",guideView); }; self.coachMarksView.didNavgateBlock = ^(AwesomeIntroGuideView *guideView, NSUInteger indedx) { NSLog(@"%@",guideView); }; self.coachMarksView.willNavgateBlock = ^(AwesomeIntroGuideView *guideView, NSUInteger indedx) { NSLog(@"%@",guideView); }; } #pragma mark - Accessor - (AwesomeIntroGuideView *)coachMarksView { if (!_coachMarksView) { _coachMarksView = [[AwesomeIntroGuideView alloc] initWithFrame:[UIScreen mainScreen].bounds]; _coachMarksView.loadType = AwesomeIntroLoad_Sync; } return _coachMarksView; } ``` -------------------------------- ### Initializing Guide View with Custom Coach Mark Frames in Objective-C Source: https://github.com/bupterambition/awesomeintroguideview/blob/master/README.md Illustrates how to create an array of dictionaries to define the position, size, caption, and shape for each individual coach mark, and then initialize the AwesomeIntroGuide view with this configuration. ```Objective-C - (void)viewDidLoad { [super viewDidLoad]; // ... // Setup coach marks NSArray *coachMarks = @[ @{ @"rect": [NSValue valueWithCGRect:(CGRect){{0,0},{45,45}}], @"caption": @"Helpful navigation menu" @"shape": @"circle" }, @{ @"rect": [NSValue valueWithCGRect:(CGRect){{10.0f,56.0f},{300.0f,56.0f}}], @"caption": @"Document your wedding by taking photos" @"shape": @"square" }, @{ @"rect": [NSValue valueWithCGRect:(CGRect){{10.0f,119.0f},{300.0f,56.0f}}], @"caption": @"Your wedding photo album" }, @{ @"rect": [NSValue valueWithCGRect:(CGRect){{10.0f,182.0f},{300.0f,56.0f}}], @"caption": @"View and manage your friends & family" }, @{ @"rect": [NSValue valueWithCGRect:(CGRect){{10.0f,245.0f},{300.0f,56.0f}}], @"caption": @"Invite friends to get more photos" }, @{ @"rect": [NSValue valueWithCGRect:(CGRect){{0.0f,410.0f},{320.0f,50.0f}}], @"caption": @"Keep your guests informed with your wedding details" } ]; AwesomeIntroGuide *coachMarksView = [[AwesomeIntroGuide alloc] initWithFrame:self.view.bounds coachMarks:coachMarks]; [self.view addSubview:coachMarksView]; [coachMarksView start]; } ``` -------------------------------- ### Install AwesomeIntroGuideView with CocoaPods - Ruby Source: https://github.com/bupterambition/awesomeintroguideview/blob/master/README.md To integrate AwesomeIntroGuideView into your iOS project using CocoaPods, add this line to your project's Podfile. After adding the line, run 'pod install' in your terminal from the project directory. ```Ruby pod 'AwesomeIntroGuideView' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.