text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```objective-c // // YNPageTableView.m // YNPageViewController // // Created by ZYN on 2018/7/14. // #import "YNPageTableView.h" @interface YNPageTableView () <UIGestureRecognizerDelegate> @end @implementation YNPageTableView - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageTableView.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
97
```objective-c // // YNPageScrollView.h // YNPageViewController // // Created by ZYN on 2018/4/22. // #import <UIKit/UIKit.h> @interface YNPageScrollView : UIScrollView @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageScrollView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
50
```objective-c // // YNPageScrollMenuView.h // YNPageViewController // // Created by ZYN on 2018/4/22. // #import <UIKit/UIKit.h> @class YNPageConfigration; @protocol YNPageScrollMenuViewDelegate <NSObject> @optional /// item - (void)pagescrollMenuViewItemOnClick:(UIButton *)label index:(NSInteger)index; /// Add - (void)pagescrollMenuViewAddButtonAction:(UIButton *)button; @end @interface YNPageScrollMenuView : UIView /// + @property (nonatomic, strong) UIButton *addButton; /// @property (nonatomic, strong) NSMutableArray *titles; + (instancetype)new UNAVAILABLE_ATTRIBUTE; - (instancetype)init UNAVAILABLE_ATTRIBUTE; /** YNPageScrollMenuView @param frame @param titles @param configration @param delegate @param currentIndex */ + (instancetype)pagescrollMenuViewWithFrame:(CGRect)frame titles:(NSMutableArray *)titles configration:(YNPageConfigration *)configration delegate:(id<YNPageScrollMenuViewDelegate>)delegate currentIndex:(NSInteger)currentIndex; - (void)updateTitle:(NSString *)title index:(NSInteger)index; - (void)updateTitles:(NSArray *)titles; - (void)adjustItemPositionWithCurrentIndex:(NSInteger)index; - (void)adjustItemWithProgress:(CGFloat)progress lastIndex:(NSInteger)lastIndex currentIndex:(NSInteger)currentIndex; - (void)selectedItemIndex:(NSInteger)index animated:(BOOL)animated; - (void)adjustItemWithAnimated:(BOOL)animated; - (void)adjustItemAnimate:(BOOL)animated; /// () - (void)reloadView; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageScrollMenuView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
360
```objective-c // // YNPageHeaderScrollView.m // YNPageViewController // // Created by ZYN on 2018/5/25. // #import "YNPageHeaderScrollView.h" @interface YNPageHeaderScrollView () <UIScrollViewDelegate> @end @implementation YNPageHeaderScrollView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.delegate = self; self.showsVerticalScrollIndicator = NO; self.showsHorizontalScrollIndicator = NO; } return self; } - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [scrollView setContentOffset:CGPointMake(0, 0) animated:NO]; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageHeaderScrollView.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
147
```objective-c // // YNPageScrollMenuView.m // YNPageViewController // // Created by ZYN on 2018/4/22. // #import "YNPageScrollMenuView.h" #import "YNPageConfigration.h" #import "YNPageScrollView.h" #import "UIView+YNPageExtend.h" #define kYNPageScrollMenuViewConverMarginX 5 #define kYNPageScrollMenuViewConverMarginW 10 @interface YNPageScrollMenuView () /// line @property (nonatomic, strong) UIView *lineView; /// @property (nonatomic, strong) UIView *converView; /// ScrollView @property (nonatomic, strong) YNPageScrollView *scrollView; /// @property (nonatomic, strong) UIView *bottomLine; /// @property (nonatomic, strong) YNPageConfigration *configration; /// @property (nonatomic, weak) id<YNPageScrollMenuViewDelegate> delegate; /// index @property (nonatomic, assign) NSInteger lastIndex; /// index @property (nonatomic, assign) NSInteger currentIndex; /// items @property (nonatomic, strong) NSMutableArray<UIButton *> *itemsArrayM; /// item @property (nonatomic, strong) NSMutableArray *itemsWidthArraM; @end @implementation YNPageScrollMenuView #pragma mark - Init Method + (instancetype)pagescrollMenuViewWithFrame:(CGRect)frame titles:(NSMutableArray *)titles configration:(YNPageConfigration *)configration delegate:(id<YNPageScrollMenuViewDelegate>)delegate currentIndex:(NSInteger)currentIndex { frame.size.height = configration.menuHeight; frame.size.width = configration.menuWidth; YNPageScrollMenuView *menuView = [[YNPageScrollMenuView alloc] initWithFrame:frame]; menuView.titles = titles; menuView.delegate = delegate; menuView.configration = configration ?: [YNPageConfigration defaultConfig]; menuView.currentIndex = currentIndex; menuView.itemsArrayM = @[].mutableCopy; menuView.itemsWidthArraM = @[].mutableCopy; [menuView setupSubViews]; return menuView; } #pragma mark - Private Method - (void)setupSubViews { self.backgroundColor = self.configration.scrollViewBackgroundColor; [self setupItems]; [self setupOtherViews]; } - (void)setupItems { if (self.configration.buttonArray.count > 0 && self.titles.count == self.configration.buttonArray.count) { [self.configration.buttonArray enumerateObjectsUsingBlock:^(UIButton * _Nonnull itemButton, NSUInteger idx, BOOL * _Nonnull stop) { [self setupButton:itemButton title:self.titles[idx] idx:idx]; }]; } else { [self.titles enumerateObjectsUsingBlock:^(id _Nonnull title, NSUInteger idx, BOOL * _Nonnull stop) { UIButton *itemButton = [UIButton buttonWithType:UIButtonTypeCustom]; [self setupButton:itemButton title:title idx:idx]; }]; } } - (void)setupButton:(UIButton *)itemButton title:(NSString *)title idx:(NSInteger)idx { itemButton.titleLabel.font = self.configration.selectedItemFont; [itemButton setTitleColor:self.configration.normalItemColor forState:UIControlStateNormal]; [itemButton setTitle:title forState:UIControlStateNormal]; itemButton.tag = idx; [itemButton addTarget:self action:@selector(itemButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; [itemButton sizeToFit]; [self.itemsWidthArraM addObject:@(itemButton.yn_width)]; [self.itemsArrayM addObject:itemButton]; [self.scrollView addSubview:itemButton]; } - (void)setupOtherViews { self.scrollView.frame = CGRectMake(0, 0, self.configration.showAddButton ? self.yn_width - self.yn_height : self.yn_width, self.yn_height); [self addSubview:self.scrollView]; if (self.configration.showAddButton) { self.addButton.frame = CGRectMake(self.yn_width - self.yn_height, 0, self.yn_height, self.yn_height); [self addSubview:self.addButton]; } /// item __block CGFloat itemX = 0; __block CGFloat itemY = 0; __block CGFloat itemW = 0; __block CGFloat itemH = self.yn_height - self.configration.lineHeight; [self.itemsArrayM enumerateObjectsUsingBlock:^(UIButton * _Nonnull button, NSUInteger idx, BOOL * _Nonnull stop) { if (idx == 0) { itemX += self.configration.itemLeftAndRightMargin; }else{ itemX += self.configration.itemMargin + [self.itemsWidthArraM[idx - 1] floatValue]; } button.frame = CGRectMake(itemX, itemY, [self.itemsWidthArraM[idx] floatValue], itemH); }]; CGFloat scrollSizeWidht = self.configration.itemLeftAndRightMargin + CGRectGetMaxX([[self.itemsArrayM lastObject] frame]); if (scrollSizeWidht < self.scrollView.yn_width) {// itemX = 0; itemY = 0; itemW = 0; CGFloat left = 0; for (NSNumber *width in self.itemsWidthArraM) { left += [width floatValue]; } left = (self.scrollView.yn_width - left - self.configration.itemMargin * (self.itemsWidthArraM.count-1)) * 0.5; /// if (self.configration.aligmentModeCenter && left >= 0) { [self.itemsArrayM enumerateObjectsUsingBlock:^(UIButton * button, NSUInteger idx, BOOL * _Nonnull stop) { if (idx == 0) { itemX += left; }else{ itemX += self.configration.itemMargin + [self.itemsWidthArraM[idx - 1] floatValue]; } button.frame = CGRectMake(itemX, itemY, [self.itemsWidthArraM[idx] floatValue], itemH); }]; self.scrollView.contentSize = CGSizeMake(left + CGRectGetMaxX([[self.itemsArrayM lastObject] frame]), self.scrollView.yn_height); } else { /// /// if (!self.configration.scrollMenu) { [self.itemsArrayM enumerateObjectsUsingBlock:^(UIButton * button, NSUInteger idx, BOOL * _Nonnull stop) { itemW = self.scrollView.yn_width / self.itemsArrayM.count; itemX = itemW *idx; button.frame = CGRectMake(itemX, itemY, itemW, itemH); }]; self.scrollView.contentSize = CGSizeMake(CGRectGetMaxX([[self.itemsArrayM lastObject] frame]), self.scrollView.yn_height); } else { self.scrollView.contentSize = CGSizeMake(scrollSizeWidht, self.scrollView.yn_height); } } } else { /// scrollViewwidth self.scrollView.contentSize = CGSizeMake(scrollSizeWidht, self.scrollView.yn_height); } CGFloat lineX = [(UIButton *)[self.itemsArrayM firstObject] yn_x]; CGFloat lineY = self.scrollView.yn_height - self.configration.lineHeight; CGFloat lineW = [[self.itemsArrayM firstObject] yn_width]; CGFloat lineH = self.configration.lineHeight; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { ///Line lineX = [(UIButton *)[self.itemsArrayM firstObject] yn_x] + ([[self.itemsArrayM firstObject] yn_width] - ([self.itemsWidthArraM.firstObject floatValue])) / 2; lineW = [self.itemsWidthArraM.firstObject floatValue]; } /// conver if (self.configration.showConver) { self.converView.frame = CGRectMake(lineX - kYNPageScrollMenuViewConverMarginX, (self.scrollView.yn_height - self.configration.converHeight - self.configration.lineHeight) * 0.5, lineW + kYNPageScrollMenuViewConverMarginW, self.configration.converHeight); [self.scrollView insertSubview:self.converView atIndex:0]; } /// bottomline if (self.configration.showBottomLine) { self.bottomLine = [[UIView alloc] init]; self.bottomLine.backgroundColor = self.configration.bottomLineBgColor; self.bottomLine.frame = CGRectMake(self.configration.bottomLineLeftAndRightMargin, self.yn_height - self.configration.bottomLineHeight, self.scrollView.yn_width - 2 * self.configration.bottomLineLeftAndRightMargin, self.configration.bottomLineHeight); self.bottomLine.layer.cornerRadius = self.configration.bottomLineCorner; [self insertSubview:self.bottomLine atIndex:0]; } if (self.configration.showScrollLine) { self.lineView.frame = CGRectMake(lineX - self.configration.lineLeftAndRightAddWidth + self.configration.lineLeftAndRightMargin, lineY - self.configration.lineBottomMargin, lineW + self.configration.lineLeftAndRightAddWidth * 2 - 2 * self.configration.lineLeftAndRightMargin, lineH); self.lineView.layer.cornerRadius = self.configration.lineCorner; [self.scrollView addSubview:self.lineView]; } if (self.configration.itemMaxScale > 1) { ((UIButton *)self.itemsArrayM[self.currentIndex]).transform = CGAffineTransformMakeScale(self.configration.itemMaxScale, self.configration.itemMaxScale); } [self setDefaultTheme]; [self selectedItemIndex:self.currentIndex animated:NO]; } - (void)setDefaultTheme { UIButton *currentButton = self.itemsArrayM[self.currentIndex]; /// if (self.configration.itemMaxScale > 1) { currentButton.transform = CGAffineTransformMakeScale(self.configration.itemMaxScale, self.configration.itemMaxScale); } /// currentButton.selected = YES; [currentButton setTitleColor:self.configration.selectedItemColor forState:UIControlStateNormal]; currentButton.titleLabel.font = self.configration.selectedItemFont; /// if (self.configration.showScrollLine) { self.lineView.yn_x = currentButton.yn_x - self.configration.lineLeftAndRightAddWidth + self.configration.lineLeftAndRightMargin; self.lineView.yn_width = currentButton.yn_width + self.configration.lineLeftAndRightAddWidth *2 - self.configration.lineLeftAndRightMargin * 2; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { /// Line self.lineView.yn_x = currentButton.yn_x + ([currentButton yn_width] - ([self.itemsWidthArraM[currentButton.tag] floatValue])) / 2 - self.configration.lineLeftAndRightAddWidth - self.configration.lineLeftAndRightAddWidth; self.lineView.yn_width = [self.itemsWidthArraM[currentButton.tag] floatValue] + self.configration.lineLeftAndRightAddWidth *2; } } /// if (self.configration.showConver) { self.converView.yn_x = currentButton.yn_x - kYNPageScrollMenuViewConverMarginX; self.converView.yn_width = currentButton.yn_width +kYNPageScrollMenuViewConverMarginW; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { ///conver self.converView.yn_x = currentButton.yn_x + ([currentButton yn_width] - ([self.itemsWidthArraM[currentButton.tag] floatValue])) / 2 - kYNPageScrollMenuViewConverMarginX; self.converView.yn_width = [self.itemsWidthArraM[currentButton.tag] floatValue] + kYNPageScrollMenuViewConverMarginW; } } self.lastIndex = self.currentIndex; } - (void)adjustItemAnimate:(BOOL)animated { UIButton *lastButton = self.itemsArrayM[self.lastIndex]; UIButton *currentButton = self.itemsArrayM[self.currentIndex]; [UIView animateWithDuration:animated ? 0.3 : 0 animations:^{ /// if (self.configration.itemMaxScale > 1) { lastButton.transform = CGAffineTransformMakeScale(1, 1); currentButton.transform = CGAffineTransformMakeScale(self.configration.itemMaxScale, self.configration.itemMaxScale); } /// [self.itemsArrayM enumerateObjectsUsingBlock:^(UIButton * obj, NSUInteger idx, BOOL * _Nonnull stop) { obj.selected = NO; [obj setTitleColor:self.configration.normalItemColor forState:UIControlStateNormal]; obj.titleLabel.font = self.configration.itemFont; if (idx == self.itemsArrayM.count - 1) { currentButton.selected = YES; [currentButton setTitleColor:self.configration.selectedItemColor forState:UIControlStateNormal]; currentButton.titleLabel.font = self.configration.selectedItemFont; } }]; /// if (self.configration.showScrollLine) { self.lineView.yn_x = currentButton.yn_x - self.configration.lineLeftAndRightAddWidth + self.configration.lineLeftAndRightMargin; self.lineView.yn_width = currentButton.yn_width + self.configration.lineLeftAndRightAddWidth * 2 - 2 * self.configration.lineLeftAndRightMargin; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) {//Line self.lineView.yn_x = currentButton.yn_x + ([currentButton yn_width] - ([self.itemsWidthArraM[currentButton.tag] floatValue])) / 2 - self.configration.lineLeftAndRightAddWidth;; self.lineView.yn_width = [self.itemsWidthArraM[currentButton.tag] floatValue] + self.configration.lineLeftAndRightAddWidth *2; } } /// if (self.configration.showConver) { self.converView.yn_x = currentButton.yn_x - kYNPageScrollMenuViewConverMarginX; self.converView.yn_width = currentButton.yn_width +kYNPageScrollMenuViewConverMarginW; if (!self.configration.scrollMenu&&!self.configration.aligmentModeCenter&&self.configration.lineWidthEqualFontWidth) { /// conver self.converView.yn_x = currentButton.yn_x + ([currentButton yn_width] - ([self.itemsWidthArraM[currentButton.tag] floatValue])) / 2 - kYNPageScrollMenuViewConverMarginX; self.converView.yn_width = [self.itemsWidthArraM[currentButton.tag] floatValue] +kYNPageScrollMenuViewConverMarginW; } } self.lastIndex = self.currentIndex; }completion:^(BOOL finished) { [self adjustItemPositionWithCurrentIndex:self.currentIndex]; }]; } #pragma mark - Public Method - (void)updateTitle:(NSString *)title index:(NSInteger)index { if (index < 0 || index > self.titles.count - 1) return; if (title.length == 0) return; [self reloadView]; } - (void)updateTitles:(NSArray *)titles { if (titles.count != self.titles.count) return; [self reloadView]; } - (void)adjustItemPositionWithCurrentIndex:(NSInteger)index { if (self.scrollView.contentSize.width != self.scrollView.yn_width + 20) { UIButton *button = self.itemsArrayM[index]; CGFloat offSex = button.center.x - self.scrollView.yn_width * 0.5; offSex = offSex > 0 ? offSex : 0; CGFloat maxOffSetX = self.scrollView.contentSize.width - self.scrollView.yn_width; maxOffSetX = maxOffSetX > 0 ? maxOffSetX : 0; offSex = offSex > maxOffSetX ? maxOffSetX : offSex; [self.scrollView setContentOffset:CGPointMake(offSex, 0) animated:YES]; } } - (void)adjustItemWithProgress:(CGFloat)progress lastIndex:(NSInteger)lastIndex currentIndex:(NSInteger)currentIndex { self.lastIndex = lastIndex; self.currentIndex = currentIndex; if (lastIndex == currentIndex) return; UIButton *lastButton = self.itemsArrayM[self.lastIndex]; UIButton *currentButton = self.itemsArrayM[self.currentIndex]; /// if (self.configration.itemMaxScale > 1) { CGFloat scaleB = self.configration.itemMaxScale - self.configration.deltaScale * progress; CGFloat scaleS = 1 + self.configration.deltaScale * progress; lastButton.transform = CGAffineTransformMakeScale(scaleB, scaleB); currentButton.transform = CGAffineTransformMakeScale(scaleS, scaleS); } if (self.configration.showGradientColor) { /// [self.configration setRGBWithProgress:progress]; UIColor *norColor = [UIColor colorWithRed:self.configration.deltaNorR green:self.configration.deltaNorG blue:self.configration.deltaNorB alpha:1]; UIColor *selColor = [UIColor colorWithRed:self.configration.deltaSelR green:self.configration.deltaSelG blue:self.configration.deltaSelB alpha:1]; [lastButton setTitleColor:norColor forState:UIControlStateNormal]; [currentButton setTitleColor:selColor forState:UIControlStateNormal]; } else{ if (progress > 0.5) { lastButton.selected = NO; currentButton.selected = YES; [lastButton setTitleColor:self.configration.normalItemColor forState:UIControlStateNormal]; [currentButton setTitleColor:self.configration.selectedItemColor forState:UIControlStateNormal]; currentButton.titleLabel.font = self.configration.selectedItemFont; } else if (progress < 0.5 && progress > 0){ lastButton.selected = YES; [lastButton setTitleColor:self.configration.selectedItemColor forState:UIControlStateNormal]; lastButton.titleLabel.font = self.configration.selectedItemFont; currentButton.selected = NO; [currentButton setTitleColor:self.configration.normalItemColor forState:UIControlStateNormal]; currentButton.titleLabel.font = self.configration.itemFont; } } if (progress > 0.5) { lastButton.titleLabel.font = self.configration.itemFont; currentButton.titleLabel.font = self.configration.selectedItemFont; } else if (progress < 0.5 && progress > 0){ lastButton.titleLabel.font = self.configration.selectedItemFont; currentButton.titleLabel.font = self.configration.itemFont; } CGFloat xD = 0; CGFloat wD = 0; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { xD = currentButton.titleLabel.yn_x + currentButton.yn_x -( lastButton.titleLabel.yn_x + lastButton.yn_x ); wD = currentButton.titleLabel.yn_width - lastButton.titleLabel.yn_width; } else { xD = currentButton.yn_x - lastButton.yn_x; wD = currentButton.yn_width - lastButton.yn_width; } /// if (self.configration.showScrollLine) { if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { /// Line self.lineView.yn_x = lastButton.yn_x + ([lastButton yn_width] - ([self.itemsWidthArraM[lastButton.tag] floatValue])) / 2 - self.configration.lineLeftAndRightAddWidth + xD *progress; self.lineView.yn_width = [self.itemsWidthArraM[lastButton.tag] floatValue] + self.configration.lineLeftAndRightAddWidth *2 + wD *progress; } else { self.lineView.yn_x = lastButton.yn_x + xD *progress - self.configration.lineLeftAndRightAddWidth + self.configration.lineLeftAndRightMargin; self.lineView.yn_width = lastButton.yn_width + wD *progress + self.configration.lineLeftAndRightAddWidth *2 - 2 * self.configration.lineLeftAndRightMargin; } } /// if (self.configration.showConver) { self.converView.yn_x = lastButton.yn_x + xD *progress - kYNPageScrollMenuViewConverMarginX; self.converView.yn_width = lastButton.yn_width + wD *progress + kYNPageScrollMenuViewConverMarginW; if (!self.configration.scrollMenu && !self.configration.aligmentModeCenter && self.configration.lineWidthEqualFontWidth) { /// cover self.converView.yn_x = lastButton.yn_x + ([lastButton yn_width] - ([self.itemsWidthArraM[lastButton.tag] floatValue])) / 2 - kYNPageScrollMenuViewConverMarginX + xD *progress; self.converView.yn_width = [self.itemsWidthArraM[lastButton.tag] floatValue] + kYNPageScrollMenuViewConverMarginW + wD *progress; } } } - (void)selectedItemIndex:(NSInteger)index animated:(BOOL)animated { self.currentIndex = index; [self adjustItemAnimate:animated]; } - (void)adjustItemWithAnimated:(BOOL)animated { if (self.lastIndex == self.currentIndex) return; [self adjustItemAnimate:animated]; } #pragma mark - Lazy Method - (UIView *)lineView { if (!_lineView) { _lineView = [[UIView alloc]init]; _lineView.backgroundColor = self.configration.lineColor; } return _lineView; } - (UIView *)converView { if (!_converView) { _converView = [[UIView alloc] init]; _converView.layer.backgroundColor = self.configration.converColor.CGColor; _converView.layer.cornerRadius = self.configration.coverCornerRadius; _converView.layer.masksToBounds = YES; _converView.userInteractionEnabled = NO; } return _converView; } - (UIScrollView *)scrollView { if (!_scrollView) { _scrollView = [[YNPageScrollView alloc] init]; _scrollView.pagingEnabled = NO; _scrollView.bounces = self.configration.bounces;; _scrollView.showsVerticalScrollIndicator = NO; _scrollView.showsHorizontalScrollIndicator = NO; _scrollView.scrollEnabled = self.configration.scrollMenu; } return _scrollView; } - (UIButton *)addButton { if (!_addButton) { _addButton = [[UIButton alloc] init]; [_addButton setBackgroundImage:[UIImage imageNamed:self.configration.addButtonNormalImageName] forState:UIControlStateNormal]; [_addButton setBackgroundImage:[UIImage imageNamed:self.configration.addButtonHightImageName] forState:UIControlStateHighlighted]; _addButton.layer.shadowColor = [UIColor grayColor].CGColor; _addButton.layer.shadowOffset = CGSizeMake(-1, 0); _addButton.layer.shadowOpacity = 0.5; _addButton.backgroundColor = self.configration.addButtonBackgroundColor; [_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _addButton; } #pragma mark - itemButtonTapOnClick - (void)itemButtonOnClick:(UIButton *)button { self.currentIndex= button.tag; [self adjustItemWithAnimated:YES]; if (self.delegate &&[self.delegate respondsToSelector:@selector(pagescrollMenuViewItemOnClick:index:)]) { [self.delegate pagescrollMenuViewItemOnClick:button index:self.lastIndex]; } } - (void)reloadView { for (UIView *view in self.subviews) { [view removeFromSuperview]; } for (UIView *view in self.scrollView.subviews) { [view removeFromSuperview]; } [self.itemsArrayM removeAllObjects]; [self.itemsWidthArraM removeAllObjects]; [self setupSubViews]; } #pragma mark - addButtonAction - (void)addButtonAction:(UIButton *)button { if(self.delegate && [self.delegate respondsToSelector:@selector(pagescrollMenuViewAddButtonAction:)]){ [self.delegate pagescrollMenuViewAddButtonAction:button]; } } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageScrollMenuView.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
5,223
```objective-c // // YNPageCollectionView.h // YNPageViewController // // Created by ZYN on 2018/7/14. // #import <UIKit/UIKit.h> @interface YNPageCollectionView : UICollectionView @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageCollectionView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
50
```objective-c // // YNPageTableView.h // YNPageViewController // // Created by ZYN on 2018/7/14. // #import <UIKit/UIKit.h> @interface YNPageTableView : UITableView @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageTableView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
50
```objective-c // // YNPageScrollView.m // YNPageViewController // // Created by ZYN on 2018/4/22. // #import "YNPageScrollView.h" #import "UIView+YNPageExtend.h" #import <objc/runtime.h> @interface YNPageScrollView () <UIGestureRecognizerDelegate> @end @implementation YNPageScrollView - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { if ([self panBack:gestureRecognizer]) { return YES; } return NO; } - (BOOL)panBack:(UIGestureRecognizer *)gestureRecognizer { int location_X = 0.15 * kYNPAGE_SCREEN_WIDTH; if (gestureRecognizer == self.panGestureRecognizer) { UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gestureRecognizer; CGPoint point = [pan translationInView:self]; UIGestureRecognizerState state = gestureRecognizer.state; if (UIGestureRecognizerStateBegan == state || UIGestureRecognizerStatePossible == state) { CGPoint location = [gestureRecognizer locationInView:self]; int temp1 = location.x; int temp2 = kYNPAGE_SCREEN_WIDTH; NSInteger XX = temp1 % temp2; if (point.x >0 && XX < location_X) { return YES; } /* if (point.x > 0 && location.x < location_X && self.contentOffset.x <= 0) { return YES; } */ } } return NO; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if ([self panBack:gestureRecognizer]) { return NO; } return YES; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/View/YNPageScrollView.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
365
```objective-c // // UIViewController+YNPageExtend.h // YNPageViewController // // Created by ZYN on 2018/5/25. // #import <UIKit/UIKit.h> #import "YNPageViewController.h" @interface UIViewController (YNPageExtend) - (YNPageViewController *)yn_pageViewController; - (YNPageConfigration *)config; - (YNPageScrollView *)bgScrollView; - (YNPageScrollMenuView *)scrollMenuView; - (NSMutableArray<__kindof UIViewController *> *)controllersM; - (NSMutableArray<NSString *> *)titlesM; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIViewController+YNPageExtend.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
121
```objective-c // // UIScrollView+YNPageExtend.h // YNPageViewController // // Created by ZYN on 2018/5/8. // #import <UIKit/UIKit.h> typedef void(^YNPageScrollViewDidScrollView)(UIScrollView *scrollView); typedef void(^YNPageScrollViewBeginDragginScrollView)(UIScrollView *scrollView); @interface UIScrollView (YNPageExtend) @property (nonatomic, assign) BOOL yn_observerDidScrollView; @property (nonatomic, copy) YNPageScrollViewDidScrollView yn_pageScrollViewDidScrollView; @property (nonatomic, copy) YNPageScrollViewBeginDragginScrollView yn_pageScrollViewBeginDragginScrollView; - (void)yn_setContentOffsetY:(CGFloat)offsetY; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIScrollView+YNPageExtend.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
145
```objective-c // // YNPageViewController.m // YNPageViewController // // Created by ZYN on 2018/4/22. // #import "YNPageViewController.h" #import "UIView+YNPageExtend.h" #import "UIScrollView+YNPageExtend.h" #import "YNPageHeaderScrollView.h" #define kDEFAULT_INSET_BOTTOM 400 @interface YNPageViewController () <UIScrollViewDelegate, YNPageScrollMenuViewDelegate> /// HeaderViewView @property (nonatomic, strong) YNPageHeaderScrollView *headerBgView; /// ScrollView @property (nonatomic, strong) YNPageScrollView *pageScrollView; /// ScrollView @property (nonatomic, strong, readwrite) YNPageScrollView *bgScrollView; /// @property (nonatomic, strong) NSMutableDictionary *displayDictM; /// InsetBottom @property (nonatomic, strong) NSMutableDictionary *originInsetBottomDictM; /// @property (nonatomic, strong) NSMutableDictionary *cacheDictM; /// ScrollView @property (nonatomic, strong) NSMutableDictionary *scrollViewCacheDictionryM; /// @property (nonatomic, strong) UIScrollView *currentScrollView; /// @property (nonatomic, strong) UIViewController *currentViewController; /// @property (nonatomic, assign) CGFloat lastPositionX; /// TableView @property (nonatomic, assign) CGFloat insetTop; /// headerView @property (nonatomic, assign) BOOL headerViewInTableView; /// OriginY @property (nonatomic, assign) CGFloat scrollMenuViewOriginY; /// headerView @property (nonatomic, assign) CGFloat headerViewOriginHeight; /// @property (nonatomic, assign) BOOL supendStatus; /// bgScrollView Y @property (nonatomic, assign) CGFloat beginBgScrollOffsetY; /// currentScrollView Y @property (nonatomic, assign) CGFloat beginCurrentScrollOffsetY; @end @implementation YNPageViewController #pragma mark - Life Cycle - (void)viewDidLoad { [super viewDidLoad]; [self initData]; [self setupSubViews]; [self setSelectedPageIndex:self.pageIndex]; } #pragma mark - Initialize Method /** @param controllers @param titles @param config */ + (instancetype)pageViewControllerWithControllers:(NSArray *)controllers titles:(NSArray *)titles config:(YNPageConfigration *)config { return [[self alloc] initPageViewControllerWithControllers:controllers titles:titles config:config]; } - (instancetype)initPageViewControllerWithControllers:(NSArray *)controllers titles:(NSArray *)titles config:(YNPageConfigration *)config { self = [super init]; self.controllersM = controllers.mutableCopy; self.titlesM = titles.mutableCopy; self.config = config ?: [YNPageConfigration defaultConfig]; self.displayDictM = @{}.mutableCopy; self.cacheDictM = @{}.mutableCopy; self.originInsetBottomDictM = @{}.mutableCopy; self.scrollViewCacheDictionryM = @{}.mutableCopy; return self; } /** * PageScrollViewVC * * @param parentViewControler */ - (void)addSelfToParentViewController:(UIViewController *)parentViewControler { [self addChildViewControllerWithChildVC:self parentVC:parentViewControler]; } /** * PageScrollViewVC */ - (void)removeSelfViewController { [self removeViewControllerWithChildVC:self]; } #pragma mark - PageScrollMenu - (void)initPagescrollMenuViewWithFrame:(CGRect)frame { YNPageScrollMenuView *scrollMenuView = [YNPageScrollMenuView pagescrollMenuViewWithFrame:frame titles:self.titlesM configration:self.config delegate:self currentIndex:self.pageIndex]; self.scrollMenuView = scrollMenuView; switch (self.config.pageStyle) { case YNPageStyleTop: case YNPageStyleSuspensionTop: case YNPageStyleSuspensionCenter: { [self.view addSubview:self.scrollMenuView]; } break; case YNPageStyleNavigation: { UIViewController *vc; if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { vc = self; } else { vc = self.parentViewController; } vc.navigationItem.titleView = self.scrollMenuView; } break; case YNPageStyleSuspensionTopPause: { [self.bgScrollView addSubview:self.scrollMenuView]; } break; } } #pragma mark - - (void)initViewControllerWithIndex:(NSInteger)index { self.currentViewController = self.controllersM[index]; self.pageIndex = index; NSString *title = [self titleWithIndex:index]; if ([self.displayDictM objectForKey:[self getKeyWithTitle:title]]) return; UIViewController *cacheViewController = [self.cacheDictM objectForKey:[self getKeyWithTitle:title]]; [self addViewControllerToParent:cacheViewController ?: self.controllersM[index] index:index]; } /// - (void)addViewControllerToParent:(UIViewController *)viewController index:(NSInteger)index { [self addChildViewController:self.controllersM[index]]; viewController.view.frame = CGRectMake(kYNPAGE_SCREEN_WIDTH * index, 0, self.pageScrollView.yn_width, self.pageScrollView.yn_height); [self.pageScrollView addSubview:viewController.view]; NSString *title = [self titleWithIndex:index]; [self.displayDictM setObject:viewController forKey:[self getKeyWithTitle:title]]; UIScrollView *scrollView = self.currentScrollView; scrollView.frame = viewController.view.bounds; [viewController didMoveToParentViewController:self]; if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle]) { if (![self.cacheDictM objectForKey:[self getKeyWithTitle:title]]) { CGFloat bottom = scrollView.contentInset.bottom > 2 * kDEFAULT_INSET_BOTTOM ? 0 : scrollView.contentInset.bottom; [self.originInsetBottomDictM setValue:@(bottom) forKey:[self getKeyWithTitle:title]]; /// TableView scrollView.contentInset = UIEdgeInsetsMake(_insetTop, 0, scrollView.contentInset.bottom + 3 * kDEFAULT_INSET_BOTTOM, 0); } if ([self isSuspensionBottomStyle]) { scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(_insetTop, 0, 0, 0); } if (self.cacheDictM.count == 0) { /// headerViewscrollMenuView self.headerBgView.yn_y = - _insetTop; self.scrollMenuView.yn_y = self.headerBgView.yn_bottom; [scrollView addSubview:self.headerBgView]; [scrollView addSubview:self.scrollMenuView]; /// [scrollView setContentOffset:CGPointMake(0, -_insetTop) animated:NO]; } else { CGFloat scrollMenuViewY = [self.scrollMenuView.superview convertRect:self.scrollMenuView.frame toView:self.view].origin.y; if (self.supendStatus) { /// if (![self.cacheDictM objectForKey:[self getKeyWithTitle:title]]) { [scrollView setContentOffset:CGPointMake(0, -self.config.menuHeight - self.config.suspenOffsetY) animated:NO]; } else { /// if (scrollView.contentOffset.y < -self.config.menuHeight - self.config.suspenOffsetY) { [scrollView setContentOffset:CGPointMake(0, -self.config.menuHeight - self.config.suspenOffsetY) animated:NO]; } } } else { CGFloat scrollMenuViewDeltaY = _scrollMenuViewOriginY - scrollMenuViewY; scrollMenuViewDeltaY = -_insetTop + scrollMenuViewDeltaY; /// (ScrollView) scrollView.contentOffset = CGPointMake(0, scrollMenuViewDeltaY); } } } /// if (![self.cacheDictM objectForKey:[self getKeyWithTitle:title]]) { [self.cacheDictM setObject:viewController forKey:[self getKeyWithTitle:title]]; } } #pragma mark - UIScrollViewDelegate - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { if ([self isSuspensionTopPauseStyle]) { if (scrollView == self.bgScrollView) { _beginBgScrollOffsetY = scrollView.contentOffset.y; _beginCurrentScrollOffsetY = self.currentScrollView.contentOffset.y; } else { self.currentScrollView.scrollEnabled = NO; } } } - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { if (scrollView == self.bgScrollView) return; if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle]) { if (!decelerate) { [self scrollViewDidScroll:scrollView]; [self scrollViewDidEndDecelerating:scrollView]; } } else if ([self isSuspensionTopPauseStyle]) { self.currentScrollView.scrollEnabled = YES; } } /// scrollView - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { if (scrollView == self.bgScrollView) return; if ([self isSuspensionTopPauseStyle]) { self.currentScrollView.scrollEnabled = YES; } [self replaceHeaderViewFromView]; [self removeViewController]; [self.scrollMenuView adjustItemPositionWithCurrentIndex:self.pageIndex]; if (self.delegate && [self.delegate respondsToSelector:@selector(pageViewController:didEndDecelerating:)]) { [self.delegate pageViewController:self didEndDecelerating:scrollView]; } } /// scrollViewing - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView == self.bgScrollView) { [self calcuSuspendTopPauseWithBgScrollView:scrollView]; [self invokeDelegateForScrollWithOffsetY:scrollView.contentOffset.y]; return; } CGFloat currentPostion = scrollView.contentOffset.x; CGFloat offsetX = currentPostion / kYNPAGE_SCREEN_WIDTH; CGFloat offX = currentPostion > self.lastPositionX ? ceilf(offsetX) : offsetX; [self replaceHeaderViewFromTableView]; [self initViewControllerWithIndex:offX]; CGFloat progress = offsetX - (NSInteger)offsetX; self.lastPositionX = currentPostion; [self.scrollMenuView adjustItemWithProgress:progress lastIndex:floor(offsetX) currentIndex:ceilf(offsetX)]; if (floor(offsetX) == ceilf(offsetX)) { [self.scrollMenuView adjustItemAnimate:YES]; } if (self.delegate && [self.delegate respondsToSelector:@selector(pageViewController:didScroll:progress:formIndex:toIndex:)]) { [self.delegate pageViewController:self didScroll:scrollView progress:progress formIndex:floor(offsetX) toIndex:ceilf(offsetX)]; } } #pragma mark - yn_pageScrollViewBeginDragginScrollView - (void)yn_pageScrollViewBeginDragginScrollView:(UIScrollView *)scrollView { _beginBgScrollOffsetY = self.bgScrollView.contentOffset.y; _beginCurrentScrollOffsetY = scrollView.contentOffset.y; } #pragma mark - yn_pageScrollViewDidScrollView - (void)yn_pageScrollViewDidScrollView:(UIScrollView *)scrollView { if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle]) { if (!_headerViewInTableView) return; if (scrollView != self.currentScrollView) return; NSString *title = [self titleWithIndex:self.pageIndex]; CGFloat originInsetBottom = [self.originInsetBottomDictM[[self getKeyWithTitle:title]] floatValue]; if ((scrollView.contentInset.bottom - originInsetBottom) > kDEFAULT_INSET_BOTTOM) { scrollView.contentInset = UIEdgeInsetsMake(scrollView.contentInset.top, 0, originInsetBottom, 0); } CGFloat offsetY = scrollView.contentOffset.y; /// if (offsetY > - self.scrollMenuView.yn_height - self.config.suspenOffsetY) { self.headerBgView.yn_y = -self.headerBgView.yn_height + offsetY + self.config.suspenOffsetY; self.scrollMenuView.yn_y = offsetY + self.config.suspenOffsetY; self.supendStatus = YES; } else { /// headerView if (offsetY >= -_insetTop) { self.headerBgView.yn_y = -_insetTop; } else { if ([self isSuspensionBottomStyle]) { self.headerBgView.yn_y = offsetY; } } self.scrollMenuView.yn_y = self.headerBgView.yn_bottom; self.supendStatus = NO; } [self adjustSectionHeader:scrollView]; [self invokeDelegateForScrollWithOffsetY:offsetY]; [self headerScaleWithOffsetY:offsetY]; } else if ([self isSuspensionTopPauseStyle]) { [self calcuSuspendTopPauseWithCurrentScrollView:scrollView]; } else { [self invokeDelegateForScrollWithOffsetY:scrollView.contentOffset.y]; } } /// scrollMenuViewTableView Section Header - (void)adjustSectionHeader:(UIScrollView *)scrollview { if (scrollview.subviews.lastObject != self.scrollMenuView) { [scrollview bringSubviewToFront:self.scrollMenuView]; } } #pragma mark - YNPageScrollMenuViewDelegate - (void)pagescrollMenuViewItemOnClick:(UIButton *)label index:(NSInteger)index { [self setSelectedPageIndex:index]; } - (void)pagescrollMenuViewAddButtonAction:(UIButton *)button { if (self.delegate && [self.delegate respondsToSelector:@selector(pageViewController:didAddButtonAction:)]) { [self.delegate pageViewController:self didAddButtonAction:button]; } } #pragma mark - Public Method - (void)setSelectedPageIndex:(NSInteger)pageIndex { if (self.cacheDictM.count > 0 && pageIndex == self.pageIndex) return; if (pageIndex > self.controllersM.count - 1) return; CGRect frame = CGRectMake(self.pageScrollView.yn_width * pageIndex, 0, self.pageScrollView.yn_width, self.pageScrollView.yn_height); if (frame.origin.x == self.pageScrollView.contentOffset.x) { [self scrollViewDidScroll:self.pageScrollView]; } else { [self.pageScrollView scrollRectToVisible:frame animated:NO]; } [self scrollViewDidEndDecelerating:self.pageScrollView]; } - (void)reloadData { [self checkParams]; self.pageIndex = self.pageIndex < 0 ? 0 : self.pageIndex; self.pageIndex = self.pageIndex >= self.controllersM.count ? self.controllersM.count - 1 : self.pageIndex; for (UIViewController *vc in self.displayDictM.allValues) { [self removeViewControllerWithChildVC:vc]; } [self.displayDictM removeAllObjects]; [self.originInsetBottomDictM removeAllObjects]; [self.cacheDictM removeAllObjects]; [self.scrollViewCacheDictionryM removeAllObjects]; [self.headerBgView removeFromSuperview]; [self.bgScrollView removeFromSuperview]; [self.pageScrollView removeFromSuperview]; [self.scrollMenuView removeFromSuperview]; [self setupSubViews]; [self setSelectedPageIndex:self.pageIndex]; } - (void)updateMenuItemTitle:(NSString *)title index:(NSInteger)index { if (index < 0 || index > self.titlesM.count - 1 ) return; if (title.length == 0) return; NSString *oldTitle = [self titleWithIndex:index]; UIViewController *cacheVC = self.cacheDictM[[self getKeyWithTitle:oldTitle]]; if (cacheVC) { NSString *newKey = [self getKeyWithTitle:title]; NSString *oldKey = [self getKeyWithTitle:oldTitle]; [self.cacheDictM setValue:cacheVC forKey:newKey]; if (![newKey isEqualToString:oldKey]) { [self.cacheDictM setValue:nil forKey:oldKey]; } } [self.titlesM replaceObjectAtIndex:index withObject:title]; [self.scrollMenuView reloadView]; } - (void)updateMenuItemTitles:(NSArray *)titles { if (titles.count != self.titlesM.count) return; for (int i = 0; i < titles.count; i++) { NSInteger index = i; NSString *title = titles[i]; if (![title isKindOfClass:[NSString class]] || title.length == 0) return; NSString *oldTitle = [self titleWithIndex:index]; UIViewController *cacheVC = self.cacheDictM[[self getKeyWithTitle:oldTitle]]; if (cacheVC) { NSString *newKey = [self getKeyWithTitle:title]; NSString *oldKey = [self getKeyWithTitle:oldTitle]; [self.cacheDictM setValue:cacheVC forKey:newKey]; if (![newKey isEqualToString:oldKey]) { [self.cacheDictM setValue:nil forKey:oldKey]; } } } [self.titlesM replaceObjectsInRange:NSMakeRange(0, titles.count) withObjectsFromArray:titles]; [self.scrollMenuView reloadView]; } - (void)insertPageChildControllersWithTitles:(NSArray *)titles controllers:(NSArray *)controllers index:(NSInteger)index { index = index < 0 ? 0 : index; index = index > self.controllersM.count - 1 ? self.controllersM.count - 1 : index; NSInteger tarIndex = index; BOOL insertSuccess = NO; if (titles.count == controllers.count && controllers.count > 0) { for (int i = 0; i < titles.count; i++) { NSString *title = titles[i]; if (title.length == 0 || ([self.titlesM containsObject:title] && ![self respondsToCustomCachekey])) { continue; } insertSuccess = YES; [self.titlesM insertObject:title atIndex:tarIndex]; [self.controllersM insertObject:controllers[i] atIndex:tarIndex]; tarIndex ++; } } if (!insertSuccess) return; NSInteger pageIndex = index > self.pageIndex ? self.pageIndex : self.pageIndex + controllers.count; [self updateViewWithIndex:pageIndex]; } - (void)updateViewWithIndex:(NSInteger)pageIndex { self.pageScrollView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH * self.controllersM.count, self.pageScrollView.yn_height); UIViewController *vc = self.controllersM[pageIndex]; vc.view.yn_x = kYNPAGE_SCREEN_WIDTH * pageIndex; [self.scrollMenuView reloadView]; [self.scrollMenuView selectedItemIndex:pageIndex animated:NO]; CGRect frame = CGRectMake(self.pageScrollView.yn_width * pageIndex, 0, self.pageScrollView.yn_width, self.pageScrollView.yn_height); [self.pageScrollView scrollRectToVisible:frame animated:NO]; [self scrollViewDidEndDecelerating:self.pageScrollView]; self.pageIndex = pageIndex; } - (void)removePageControllerWithTitle:(NSString *)title { if ([self respondsToCustomCachekey]) return; NSInteger index = -1; for (NSInteger i = 0; i < self.titlesM.count; i++) { if ([self.titlesM[i] isEqualToString:title]) { index = i; break; } } if (index == -1) return; [self removePageControllerWithIndex:index]; } - (void)removePageControllerWithIndex:(NSInteger)index { if (index < 0 || index >= self.titlesM.count || self.titlesM.count == 1) return; NSInteger pageIndex = 0; if (self.pageIndex >= index) { pageIndex = self.pageIndex - 1; if (pageIndex < 0) { pageIndex = 0; } } /// 0 + 1 if (pageIndex == 0) { [self setSelectedPageIndex:1]; } NSString *title = self.titlesM[index]; [self.titlesM removeObject:self.titlesM[index]]; [self.controllersM removeObject:self.controllersM[index]]; NSString *key = [self getKeyWithTitle:title]; [self.originInsetBottomDictM removeObjectForKey:key]; [self.scrollViewCacheDictionryM removeObjectForKey:key]; [self.cacheDictM removeObjectForKey:key]; [self updateViewWithIndex:pageIndex]; } - (void)replaceTitlesArrayForSort:(NSArray *)titleArray { BOOL condition = YES; for (NSString *str in titleArray) { if (![self.titlesM containsObject:str]) { condition = NO; break; } } if (!condition || titleArray.count != self.titlesM.count) return; NSMutableArray *resultArrayM = @[].mutableCopy; NSInteger currentPage = self.pageIndex; for (int i = 0; i < titleArray.count; i++) { NSString *title = titleArray[i]; NSInteger oldIndex = [self.titlesM indexOfObject:title]; /// if (currentPage == oldIndex) { self.pageIndex = i; } [resultArrayM addObject:self.controllersM[oldIndex]]; } [self.titlesM removeAllObjects]; [self.titlesM addObjectsFromArray:titleArray]; [self.controllersM removeAllObjects]; [self.controllersM addObjectsFromArray:resultArrayM]; [self updateViewWithIndex:self.pageIndex]; } - (void)reloadSuspendHeaderViewFrame { if (self.headerView && ([self isSuspensionTopStyle] || [self isSuspensionBottomStyle])) { /// headerBgView [self setupHeaderBgView]; for (int i = 0; i < self.titlesM.count; i++) { NSString *title = self.titlesM[i]; if(self.cacheDictM[[self getKeyWithTitle:title]]) { UIScrollView *scrollView = [self getScrollViewWithPageIndex:i]; scrollView.contentInset = UIEdgeInsetsMake(_insetTop, 0, 0, 0); if ([self isSuspensionBottomStyle]) { /// scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(_insetTop, 0, 0, 0); } } } /// [self replaceHeaderViewFromTableView]; [self replaceHeaderViewFromView]; [self yn_pageScrollViewDidScrollView:self.currentScrollView]; [self scrollViewDidScroll:self.pageScrollView]; if (!self.pageScrollView.isDragging) { [self scrollViewDidEndDecelerating:self.pageScrollView]; } } else if ([self isSuspensionTopPauseStyle]) { /// headerBgView [self setupHeaderBgView]; [self setupPageScrollView]; } } - (void)scrollToTop:(BOOL)animated { if ([self isSuspensionTopStyle] || [self isSuspensionBottomStyle]) { [self.currentScrollView setContentOffset:CGPointMake(0, -self.config.tempTopHeight) animated:animated]; } else if ([self isSuspensionTopPauseStyle]) { [self.currentScrollView setContentOffset:CGPointMake(0, 0) animated:NO]; [self.bgScrollView setContentOffset:CGPointMake(0, 0) animated:animated]; } else { [self.currentScrollView setContentOffset:CGPointMake(0, 0) animated:animated]; } } #pragma mark - Private Method - (void)initData { [self checkParams]; self.edgesForExtendedLayout = UIRectEdgeNone; self.view.backgroundColor = [UIColor whiteColor]; self.automaticallyAdjustsScrollViewInsets = NO; _headerViewInTableView = YES; } /// View - (void)setupSubViews { [self setupHeaderBgView]; [self setupPageScrollMenuView]; [self setupPageScrollView]; } /// PageScrollView - (void)setupPageScrollView { CGFloat navHeight = self.config.showNavigation ? kYNPAGE_NAVHEIGHT : 0; CGFloat tabHeight = self.config.showTabbar ? kYNPAGE_TABBARHEIGHT : 0; CGFloat contentHeight = kYNPAGE_SCREEN_HEIGHT - navHeight - tabHeight; if ([self isSuspensionTopPauseStyle]) { self.bgScrollView.frame = CGRectMake(0, 0, kYNPAGE_SCREEN_WIDTH, contentHeight); self.bgScrollView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH, contentHeight + self.headerBgView.yn_height - self.config.suspenOffsetY); self.scrollMenuView.yn_y = self.headerBgView.yn_bottom; self.pageScrollView.frame = CGRectMake(0, self.scrollMenuView.yn_bottom, kYNPAGE_SCREEN_WIDTH, contentHeight - self.config.menuHeight - self.config.suspenOffsetY); self.pageScrollView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH * self.controllersM.count, self.pageScrollView.yn_height); self.config.contentHeight = self.pageScrollView.yn_height; [self.bgScrollView addSubview:self.pageScrollView]; if (kLESS_THAN_iOS11) { [self.view addSubview:[UIView new]]; } [self.view addSubview:self.bgScrollView]; } else { self.pageScrollView.frame = CGRectMake(0, [self isTopStyle] ? self.config.menuHeight : 0, kYNPAGE_SCREEN_WIDTH, ([self isTopStyle] ? contentHeight - self.config.menuHeight : contentHeight)); self.pageScrollView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH * self.controllersM.count, contentHeight - ([self isTopStyle] ? self.config.menuHeight : 0)); self.config.contentHeight = self.pageScrollView.yn_height - self.config.menuHeight; if (kLESS_THAN_iOS11) { [self.view addSubview:[UIView new]]; } [self.view addSubview:self.pageScrollView]; } } /// ScrollView - (void)setupPageScrollMenuView { [self initPagescrollMenuViewWithFrame:CGRectMake(0, 0, self.config.menuWidth, self.config.menuHeight)]; } /// headerView - (void)setupHeaderBgView { if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle] || [self isSuspensionTopPauseStyle]) { #if DEBUG NSAssert(self.headerView, @"Please set headerView !"); #endif self.headerBgView = [[YNPageHeaderScrollView alloc] initWithFrame:self.headerView.bounds]; self.headerBgView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH * 2, self.headerView.yn_height); [self.headerBgView addSubview:self.headerView]; self.headerViewOriginHeight = self.headerBgView.yn_height; self.headerBgView.scrollEnabled = !self.config.headerViewCouldScrollPage; if (self.config.headerViewCouldScale && self.scaleBackgroundView) { [self.headerBgView insertSubview:self.scaleBackgroundView atIndex:0]; self.scaleBackgroundView.userInteractionEnabled = NO; } self.config.tempTopHeight = self.headerBgView.yn_height + self.config.menuHeight; _insetTop = self.headerBgView.yn_height + self.config.menuHeight; _scrollMenuViewOriginY = _headerView.yn_height; if ([self isSuspensionTopPauseStyle]) { _insetTop = self.headerBgView.yn_height - self.config.suspenOffsetY; [self.bgScrollView addSubview:self.headerBgView]; } } } /// headerView view tableview - (void)replaceHeaderViewFromView { if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle]) { if (!_headerViewInTableView) { UIScrollView *scrollView = self.currentScrollView; CGFloat headerViewY = [self.headerBgView.superview convertRect:self.headerBgView.frame toView:scrollView].origin.y; CGFloat scrollMenuViewY = [self.scrollMenuView.superview convertRect:self.scrollMenuView.frame toView:scrollView].origin.y; [self.headerBgView removeFromSuperview]; [self.scrollMenuView removeFromSuperview]; self.headerBgView.yn_y = headerViewY; self.scrollMenuView.yn_y = scrollMenuViewY; [scrollView addSubview:self.headerBgView]; [scrollView addSubview:self.scrollMenuView]; _headerViewInTableView = YES; } } } /// headerView tableview view - (void)replaceHeaderViewFromTableView { if ([self isSuspensionBottomStyle] || [self isSuspensionTopStyle]) { if (_headerViewInTableView) { CGFloat headerViewY = [self.headerBgView.superview convertRect:self.headerBgView.frame toView:self.pageScrollView].origin.y; CGFloat scrollMenuViewY = [self.scrollMenuView.superview convertRect:self.scrollMenuView.frame toView:self.pageScrollView].origin.y; [self.headerBgView removeFromSuperview]; [self.scrollMenuView removeFromSuperview]; self.headerBgView.yn_y = headerViewY; self.scrollMenuView.yn_y = scrollMenuViewY; [self.view insertSubview:self.headerBgView aboveSubview:self.pageScrollView]; [self.view insertSubview:self.scrollMenuView aboveSubview:self.headerBgView]; _headerViewInTableView = NO; } } } /// - current bg bg current /// - BgScrollView - (void)calcuSuspendTopPauseWithBgScrollView:(UIScrollView *)scrollView { if ([self isSuspensionTopPauseStyle] && scrollView == self.bgScrollView) { CGFloat bg_OffsetY = scrollView.contentOffset.y; CGFloat cu_OffsetY = self.currentScrollView.contentOffset.y; /// BOOL dragBottom = _beginBgScrollOffsetY - bg_OffsetY > 0 ? YES : NO; /// cu 0 if (dragBottom && cu_OffsetY > 0) { /// [scrollView yn_setContentOffsetY:_beginBgScrollOffsetY]; /// cu _beginCurrentScrollOffsetY = cu_OffsetY; } /// begin else if (_beginBgScrollOffsetY == _insetTop && _beginCurrentScrollOffsetY != 0) { [scrollView yn_setContentOffsetY:_beginBgScrollOffsetY]; _beginCurrentScrollOffsetY = cu_OffsetY; } /// else if (bg_OffsetY >= _insetTop) { [scrollView yn_setContentOffsetY:_insetTop]; _beginCurrentScrollOffsetY = cu_OffsetY; } /// else if (bg_OffsetY <= 0 && cu_OffsetY > 0) { [scrollView yn_setContentOffsetY:0]; } } } /// - CurrentScrollView - (void)calcuSuspendTopPauseWithCurrentScrollView:(UIScrollView *)scrollView { if ([self isSuspensionTopPauseStyle]) { if (!scrollView.isDragging) return; CGFloat bg_OffsetY = self.bgScrollView.contentOffset.y; CGFloat cu_offsetY = scrollView.contentOffset.y; /// BOOL dragBottom = _beginCurrentScrollOffsetY - cu_offsetY < 0 ? YES : NO; /// cu 0 bg _insetTop if (dragBottom && cu_offsetY > 0 && bg_OffsetY < _insetTop) { /// [scrollView yn_setContentOffsetY:_beginCurrentScrollOffsetY]; /// bg _beginBgScrollOffsetY = bg_OffsetY; } /// cu 0 0 else if (cu_offsetY < 0) { [scrollView yn_setContentOffsetY:0]; } /// bg insetTop _insetTop else if (bg_OffsetY >= _insetTop) { _beginBgScrollOffsetY = _insetTop; } } } /// - (void)removeViewController { NSString *title = [self titleWithIndex:self.pageIndex]; NSString *displayKey = [self getKeyWithTitle:title]; for (NSString *key in self.displayDictM.allKeys) { if (![key isEqualToString:displayKey]) { [self removeViewControllerWithChildVC:self.displayDictM[key] key:key]; } } } /// - (void)removeViewControllerWithChildVC:(UIViewController *)childVC key:(NSString *)key { [self removeViewControllerWithChildVC:childVC]; [self.displayDictM removeObjectForKey:key]; if (![self.cacheDictM objectForKey:key]) { [self.cacheDictM setObject:childVC forKey:key]; } } /// - (void)addChildViewControllerWithChildVC:(UIViewController *)childVC parentVC:(UIViewController *)parentVC { [parentVC addChildViewController:childVC]; [parentVC didMoveToParentViewController:childVC]; [parentVC.view addSubview:childVC.view]; } /// - (void)removeViewControllerWithChildVC:(UIViewController *)childVC { [childVC.view removeFromSuperview]; [childVC willMoveToParentViewController:nil]; [childVC removeFromParentViewController]; } /// - (void)checkParams { #if DEBUG NSAssert(self.controllersM.count != 0 || self.controllersM, @"ViewControllers`count is 0 or nil"); NSAssert(self.titlesM.count != 0 || self.titlesM, @"TitleArray`count is 0 or nil,"); NSAssert(self.controllersM.count == self.titlesM.count, @"ViewControllers`count is not equal titleArray!"); #endif if (![self respondsToCustomCachekey]) { BOOL isHasNotEqualTitle = YES; for (int i = 0; i < self.titlesM.count; i++) { for (int j = i + 1; j < self.titlesM.count; j++) { if (i != j && [self.titlesM[i] isEqualToString:self.titlesM[j]]) { isHasNotEqualTitle = NO; break; } } } #if DEBUG NSAssert(isHasNotEqualTitle, @"TitleArray Not allow equal title."); #endif } } - (BOOL)respondsToCustomCachekey { if (self.dataSource && [self.dataSource respondsToSelector:@selector(pageViewController:customCacheKeyForIndex:)]) { return YES; } return NO; } #pragma mark - - (BOOL)isTopStyle { return self.config.pageStyle == YNPageStyleTop ? YES : NO; } - (BOOL)isNavigationStyle { return self.config.pageStyle == YNPageStyleNavigation ? YES : NO; } - (BOOL)isSuspensionTopStyle { return self.config.pageStyle == YNPageStyleSuspensionTop ? YES : NO; } - (BOOL)isSuspensionBottomStyle { return self.config.pageStyle == YNPageStyleSuspensionCenter ? YES : NO; } - (BOOL)isSuspensionTopPauseStyle { return self.config.pageStyle == YNPageStyleSuspensionTopPause ? YES : NO; } - (NSString *)titleWithIndex:(NSInteger)index { return self.titlesM[index]; } - (NSInteger)getPageIndexWithTitle:(NSString *)title { return [self.titlesM indexOfObject:title]; } - (NSString *)getKeyWithTitle:(NSString *)title { if ([self respondsToCustomCachekey]) { NSString *ID = [self.dataSource pageViewController:self customCacheKeyForIndex:self.pageIndex]; return ID; } return title; }; #pragma mark - Invoke Delegate Method /// - (void)invokeDelegateForScrollWithOffsetY:(CGFloat)offsetY { if (self.delegate && [self.delegate respondsToSelector:@selector(pageViewController:contentOffsetY:progress:)]) { switch (self.config.pageStyle) { case YNPageStyleSuspensionTop: case YNPageStyleSuspensionCenter: { CGFloat progress = 1 + (offsetY + self.scrollMenuView.yn_height + self.config.suspenOffsetY) / (self.headerBgView.yn_height -self.config.suspenOffsetY); progress = progress > 1 ? 1 : progress; progress = progress < 0 ? 0 : progress; [self.delegate pageViewController:self contentOffsetY:offsetY progress:progress]; } break; case YNPageStyleSuspensionTopPause: { CGFloat progress = offsetY / (self.headerBgView.yn_height - self.config.suspenOffsetY); progress = progress > 1 ? 1 : progress; progress = progress < 0 ? 0 : progress; [self.delegate pageViewController:self contentOffsetY:offsetY progress:progress]; } break; default: { [self.delegate pageViewController:self contentOffsetY:offsetY progress:1]; } break; } } } #pragma mark - Lazy Method - (YNPageScrollView *)bgScrollView { if (!_bgScrollView) { _bgScrollView = [[YNPageScrollView alloc] init]; _bgScrollView.showsVerticalScrollIndicator = NO; _bgScrollView.showsHorizontalScrollIndicator = NO; _bgScrollView.delegate = self; _bgScrollView.backgroundColor = [UIColor whiteColor]; if (@available(iOS 11.0, *)) { _bgScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } } return _bgScrollView; } - (YNPageScrollView *)pageScrollView { if (!_pageScrollView) { _pageScrollView = [[YNPageScrollView alloc] init]; _pageScrollView.showsVerticalScrollIndicator = NO; _pageScrollView.showsHorizontalScrollIndicator = NO; _pageScrollView.scrollEnabled = self.config.pageScrollEnabled; _pageScrollView.pagingEnabled = YES; _pageScrollView.bounces = NO; _pageScrollView.delegate = self; _pageScrollView.backgroundColor = [UIColor whiteColor]; if (@available(iOS 11.0, *)) { _pageScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } } return _pageScrollView; } /// ScrollView - (UIScrollView *)currentScrollView { return [self getScrollViewWithPageIndex:self.pageIndex]; } /// pageIndex ScrollView - (UIScrollView *)getScrollViewWithPageIndex:(NSInteger)pageIndex { NSString *title = [self titleWithIndex:self.pageIndex]; NSString *key = [self getKeyWithTitle:title]; UIScrollView *scrollView = nil; if (![self.scrollViewCacheDictionryM objectForKey:key]) { if (self.dataSource && [self.dataSource respondsToSelector:@selector(pageViewController:pageForIndex:)]) { scrollView = [self.dataSource pageViewController:self pageForIndex:pageIndex]; scrollView.yn_observerDidScrollView = YES; __weak typeof(self) weakSelf = self; scrollView.yn_pageScrollViewDidScrollView = ^(UIScrollView *scrollView) { [weakSelf yn_pageScrollViewDidScrollView:scrollView]; }; if (self.config.pageStyle == YNPageStyleSuspensionTopPause) { scrollView.yn_pageScrollViewBeginDragginScrollView = ^(UIScrollView *scrollView) { [weakSelf yn_pageScrollViewBeginDragginScrollView:scrollView]; }; } if (@available(iOS 11.0, *)) { if (scrollView) { scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } } } } else { return [self.scrollViewCacheDictionryM objectForKey:key]; } #if DEBUG NSAssert(scrollView != nil, @"pageViewController "); #endif [self.scrollViewCacheDictionryM setObject:scrollView forKey:key]; return scrollView; } /// - (void)headerScaleWithOffsetY:(CGFloat)offsetY { if (self.config.headerViewCouldScale && self.scaleBackgroundView) { CGFloat yOffset = offsetY + _insetTop; CGFloat xOffset = (yOffset) / 2; CGRect headerBgViewFrame = self.headerBgView.frame; CGRect scaleBgViewFrame = self.scaleBackgroundView.frame; if (self.config.headerViewScaleMode == YNPageHeaderViewScaleModeTop) { if (yOffset < 0) { headerBgViewFrame.origin.y = yOffset - _insetTop; headerBgViewFrame.size.height = -yOffset + self.headerViewOriginHeight; scaleBgViewFrame.size.height = -yOffset + self.headerViewOriginHeight; scaleBgViewFrame.origin.x = xOffset; scaleBgViewFrame.size.width = kYNPAGE_SCREEN_WIDTH + fabs(xOffset) * 2; } } else { if (yOffset < 0) { headerBgViewFrame.origin.y = yOffset - _insetTop; headerBgViewFrame.size.height = fabs(yOffset) + self.headerViewOriginHeight; scaleBgViewFrame.size.height = fabs(yOffset) + self.headerViewOriginHeight; scaleBgViewFrame.origin.x = xOffset; scaleBgViewFrame.size.width = kYNPAGE_SCREEN_WIDTH + fabs(xOffset) * 2; } } self.headerBgView.frame = headerBgViewFrame; self.scaleBackgroundView.frame = scaleBgViewFrame; } } - (void)dealloc { #if DEBUG NSLog(@"----%@----dealloc", [self class]); #endif } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/YNPageViewController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
8,720
```objective-c // // UIScrollView+YNPageExtend.m // YNPageViewController // // Created by ZYN on 2018/5/8. // #import "UIScrollView+YNPageExtend.h" #import <objc/runtime.h> @implementation UIScrollView (YNPageExtend) + (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ [self swizzleInstanceMethod:NSSelectorFromString(@"_notifyDidScroll") withMethod:@selector(yn_scrollViewDidScrollView)]; [self swizzleInstanceMethod:NSSelectorFromString(@"_scrollViewWillBeginDragging") withMethod:@selector(yn_scrollViewWillBeginDragging)]; }); } - (void)yn_scrollViewDidScrollView { [self yn_scrollViewDidScrollView]; if (self.yn_observerDidScrollView && self.yn_pageScrollViewDidScrollView) { self.yn_pageScrollViewDidScrollView(self); } } - (void)yn_scrollViewWillBeginDragging { [self yn_scrollViewWillBeginDragging]; if (self.yn_observerDidScrollView && self.yn_pageScrollViewBeginDragginScrollView) { self.yn_pageScrollViewBeginDragginScrollView(self); } } #pragma mark - Getter - Setter - (BOOL)yn_observerDidScrollView { return [objc_getAssociatedObject(self, _cmd) boolValue]; } - (void)setYn_observerDidScrollView:(BOOL)yn_observerDidScrollView { objc_setAssociatedObject(self, @selector(yn_observerDidScrollView), @(yn_observerDidScrollView), OBJC_ASSOCIATION_ASSIGN); } - (YNPageScrollViewDidScrollView)yn_pageScrollViewDidScrollView { return objc_getAssociatedObject(self, _cmd); } - (void)setYn_pageScrollViewDidScrollView:(YNPageScrollViewDidScrollView)yn_pageScrollViewDidScrollView { objc_setAssociatedObject(self, @selector(yn_pageScrollViewDidScrollView), yn_pageScrollViewDidScrollView, OBJC_ASSOCIATION_COPY_NONATOMIC); } - (YNPageScrollViewBeginDragginScrollView)yn_pageScrollViewBeginDragginScrollView { return objc_getAssociatedObject(self, _cmd); } - (void)setYn_pageScrollViewBeginDragginScrollView:(YNPageScrollViewBeginDragginScrollView)yn_pageScrollViewBeginDragginScrollView { objc_setAssociatedObject(self, @selector(yn_pageScrollViewBeginDragginScrollView), yn_pageScrollViewBeginDragginScrollView, OBJC_ASSOCIATION_COPY_NONATOMIC); } #pragma amrk - Swizzle + (void)swizzleInstanceMethod:(SEL)origSelector withMethod:(SEL)newSelector { Class cls = [self class]; Method originalMethod = class_getInstanceMethod(cls, origSelector); Method swizzledMethod = class_getInstanceMethod(cls, newSelector); if (class_addMethod(cls, origSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)) ) { class_replaceMethod(cls, newSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); } else { class_replaceMethod(cls, newSelector, class_replaceMethod(cls, origSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)), method_getTypeEncoding(originalMethod)); } } - (void)yn_setContentOffsetY:(CGFloat)offsetY { if (self.contentOffset.y != offsetY) { self.contentOffset = CGPointMake(0, offsetY); } } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIScrollView+YNPageExtend.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
726
```objective-c // // UIViewController+YNPageExtend.m // YNPageViewController // // Created by ZYN on 2018/5/25. // #import "UIViewController+YNPageExtend.h" @implementation UIViewController (YNPageExtend) - (YNPageViewController *)yn_pageViewController { return (YNPageViewController *)self.parentViewController; } - (YNPageConfigration *)config { return self.yn_pageViewController.config; } - (YNPageScrollView *)bgScrollView { return self.yn_pageViewController.bgScrollView; } - (YNPageScrollMenuView *)scrollMenuView { return self.yn_pageViewController.scrollMenuView; } - (NSMutableArray<__kindof UIViewController *> *)controllersM { return self.yn_pageViewController.controllersM; } - (NSMutableArray<NSString *> *)titlesM { return self.yn_pageViewController.titlesM; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIViewController+YNPageExtend.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
184
```objective-c // // UIView+YNPageExtend.h // YNPageViewController // // Created by ZYN on 2018/4/22. // #import <UIKit/UIKit.h> #define kYNPAGE_SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define kYNPAGE_SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) #define kYNPAGE_IS_IPHONE_X ((kYNPAGE_SCREEN_HEIGHT == 812.0f && kYNPAGE_SCREEN_WIDTH == 375.0f) ? YES : NO) #define kYNPAGE_NAVHEIGHT (kYNPAGE_IS_IPHONE_X ? 88 : 64) #define kYNPAGE_TABBARHEIGHT (kYNPAGE_IS_IPHONE_X ? 83 : 49) #define kLESS_THAN_iOS11 ([[UIDevice currentDevice].systemVersion floatValue] < 11.0 ? YES : NO) @interface UIView (YNPageExtend) @property (nonatomic, assign) CGFloat yn_x; @property (nonatomic, assign) CGFloat yn_y; @property (nonatomic, assign) CGFloat yn_width; @property (nonatomic, assign) CGFloat yn_height; @property (nonatomic, assign) CGFloat yn_bottom; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIView+YNPageExtend.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
237
```objective-c // // UIView+YNPageExtend.m // YNPageViewController // // Created by ZYN on 2018/4/22. // #import "UIView+YNPageExtend.h" @implementation UIView (YNPageExtend) - (void)setYn_x:(CGFloat)yn_x { CGRect frame = self.frame; frame.origin.x = yn_x; self.frame = frame; } - (CGFloat)yn_x { return self.frame.origin.x; } - (void)setYn_y:(CGFloat)yn_y { CGRect frame = self.frame; frame.origin.y = yn_y; self.frame = frame; } - (CGFloat)yn_y { return self.frame.origin.y; } - (CGFloat)yn_width { return self.frame.size.width; } - (void)setYn_width:(CGFloat)yn_width { CGRect frame = self.frame; frame.size.width = yn_width; self.frame = frame; } - (CGFloat)yn_height { return self.frame.size.height; } - (void)setYn_height:(CGFloat)yn_height { CGRect frame = self.frame; frame.size.height = yn_height; self.frame = frame; } - (CGFloat)yn_bottom { return self.frame.size.height + self.frame.origin.y; } - (void)setYn_bottom:(CGFloat)yn_bottom { CGRect frame = self.frame; frame.origin.y = yn_bottom - frame.size.height; self.frame = frame; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/YNPageViewController/Category/UIView+YNPageExtend.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
312
```objective-c // // FTPopOverMenu.h // FTPopOverMenu // // Created by liufengting on 16/4/5. // #import <UIKit/UIKit.h> /** * FTPopOverMenuDoneBlock * * @param index SlectedIndex */ typedef void (^FTPopOverMenuDoneBlock)(NSInteger selectedIndex); /** * FTPopOverMenuDismissBlock */ typedef void (^FTPopOverMenuDismissBlock)(); /** * your_sha256_hash-------- */ @interface FTPopOverMenuConfiguration : NSObject @property (nonatomic, assign)CGFloat menuTextMargin;// Default is 6. @property (nonatomic, assign)CGFloat menuIconMargin;// Default is 6. @property (nonatomic, assign)CGFloat menuRowHeight; @property (nonatomic, assign)CGFloat menuWidth; @property (nonatomic, strong)UIColor *textColor; @property (nonatomic, strong)UIColor *tintColor; @property (nonatomic, strong)UIColor *borderColor; @property (nonatomic, assign)CGFloat borderWidth; @property (nonatomic, strong)UIFont *textFont; @property (nonatomic, assign)NSTextAlignment textAlignment; @property (nonatomic, assign)BOOL ignoreImageOriginalColor;// Default is 'NO', if sets to 'YES', images color will be same as textColor. @property (nonatomic, assign)BOOL allowRoundedArrow;// Default is 'NO', if sets to 'YES', the arrow will be drawn with round corner. @property (nonatomic, assign)NSTimeInterval animationDuration; /** * defaultConfiguration * * @return curren configuration */ + (FTPopOverMenuConfiguration *)defaultConfiguration; @end /** * -----------------------FTPopOverMenuCell----------------------- */ @interface FTPopOverMenuCell : UITableViewCell @end /** * -----------------------FTPopOverMenuView----------------------- */ @interface FTPopOverMenuView : UIControl @end /** * -----------------------FTPopOverMenu----------------------- */ @interface FTPopOverMenu : NSObject /** show method with sender without images @param sender sender @param menuArray menuArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showForSender:(UIView *)sender withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** show method with sender and image resouce Array @param sender sender @param menuArray menuArray @param imageArray imageArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showForSender:(UIView *)sender withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** show method for barbuttonitems with event without images @param event event @param menuArray menuArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showFromEvent:(UIEvent *)event withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** show method for barbuttonitems with event and imageArray @param event event @param menuArray menuArray @param imageArray imageArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showFromEvent:(UIEvent *)event withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** show method with SenderFrame without images @param senderFrame senderFrame @param menuArray menuArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showFromSenderFrame:(CGRect )senderFrame withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** show method with SenderFrame and image resouce Array @param senderFrame senderFrame @param menuArray menuArray @param imageArray imageArray @param doneBlock doneBlock @param dismissBlock dismissBlock */ + (void) showFromSenderFrame:(CGRect )senderFrame withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock; /** * dismiss method */ + (void) dismiss; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/FTPopOverMenu/FTPopOverMenu.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,022
```objective-c // // UIView+Extension.h // 01 - // // Created by apple on 15-1-30. // #import <UIKit/UIKit.h> @interface UIView (Extension) @property (nonatomic, assign) CGFloat x; @property (nonatomic, assign) CGFloat y; @property (nonatomic, assign) CGFloat centerX; @property (nonatomic, assign) CGFloat centerY; @property (nonatomic, assign) CGFloat width; @property (nonatomic, assign) CGFloat height; @property (nonatomic, assign) CGSize size; @property (nonatomic, assign) CGPoint origin; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Category/UIView+Extension.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
115
```objective-c // // UIView+Extension.m // 01 - // // Created by apple on 15-1-30. // #import "UIView+Extension.h" @implementation UIView (Extension) - (void)setX:(CGFloat)x { CGRect frame = self.frame; frame.origin.x = x; self.frame = frame; } - (void)setY:(CGFloat)y { CGRect frame = self.frame; frame.origin.y = y; self.frame = frame; } - (CGFloat)x { return self.frame.origin.x; } - (CGFloat)y { return self.frame.origin.y; } - (void)setCenterX:(CGFloat)centerX { CGPoint center = self.center; center.x = centerX; self.center = center; } - (CGFloat)centerX { return self.center.x; } - (void)setCenterY:(CGFloat)centerY { CGPoint center = self.center; center.y = centerY; self.center = center; } - (CGFloat)centerY { return self.center.y; } - (void)setWidth:(CGFloat)width { CGRect frame = self.frame; frame.size.width = width; self.frame = frame; } - (void)setHeight:(CGFloat)height { CGRect frame = self.frame; frame.size.height = height; self.frame = frame; } - (CGFloat)height { return self.frame.size.height; } - (CGFloat)width { return self.frame.size.width; } - (void)setSize:(CGSize)size { CGRect frame = self.frame; frame.size = size; self.frame = frame; } - (CGSize)size { return self.frame.size; } - (void)setOrigin:(CGPoint)origin { CGRect frame = self.frame; frame.origin = origin; self.frame = frame; } - (CGPoint)origin { return self.frame.origin; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Category/UIView+Extension.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
412
```objective-c // // MAMapURLSearch.h // MAMapKitNew // // Created by xiaoming han on 15/5/25. // #import <Foundation/Foundation.h> #import "MAMapURLSearchConfig.h" /// URL`+ (void)getLatestAMapApp;`app. @interface MAMapURLSearch : NSObject /// AppStore + (void)getLatestAMapApp; /** * app. * * @param config . * * @return .YESNO. */ + (BOOL)openAMapNavigation:(MANaviConfig *)config; /** * app. * * @param config . * * @return . */ + (BOOL)openAMapRouteSearch:(MARouteConfig *)config; /** * appPOI. * * @param config . * * @return . */ + (BOOL)openAMapPOISearch:(MAPOIConfig *)config; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapURLSearch.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
203
```objective-c // // MAOfflineCity.h // // #import <Foundation/Foundation.h> #import "MAOfflineItem.h" typedef enum{ MAOfflineCityStatusNone __attribute__((deprecated("use MAOfflineItemStatusNone instead"))) = MAOfflineItemStatusNone, /* . */ MAOfflineCityStatusCached __attribute__((deprecated("use MAOfflineItemStatusCached instead"))) = MAOfflineItemStatusCached, /* . */ MAOfflineCityStatusInstalled __attribute__((deprecated("use MAOfflineItemStatusInstalled instead"))) = MAOfflineItemStatusInstalled, /* . */ MAOfflineCityStatusExpired __attribute__((deprecated("use MAOfflineItemStatusExpired instead"))) = MAOfflineItemStatusExpired /* . */ }MAOfflineCityStatus; @interface MAOfflineCity : MAOfflineItem /*! @brief */ @property (nonatomic, copy, readonly) NSString *cityCode; /*! @brief */ @property (nonatomic, copy, readonly) NSString *cityName __attribute__ ((deprecated("use name instead"))); /*! @brief */ @property (nonatomic, copy, readonly) NSString *urlString __attribute__ ((deprecated("Not supported in future version"))); /*! @brief */ @property (nonatomic, assign, readonly) MAOfflineCityStatus status __attribute__ ((deprecated("use itemStatus instead"))); @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineCity.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
272
```objective-c // // MAAnnotationView.h // MAMapKitDemo // // Created by songjian on 13-1-7. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, MAAnnotationViewDragState) { MAAnnotationViewDragStateNone = 0, ///< MAAnnotationViewDragStateStarting, ///< MAAnnotationViewDragStateDragging, ///< MAAnnotationViewDragStateCanceling, ///< MAAnnotationViewDragStateEnding ///< }; @protocol MAAnnotation; /*! @brief view */ @interface MAAnnotationView : UIView /*! @brief annotation view @param annotation annotation @param reuseIdentifier view,,nil,view @return annotation view,nil */ - (id)initWithAnnotation:(id <MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier; /*! @brief */ @property (nonatomic, readonly, copy) NSString *reuseIdentifier; /*! @brief reuse, super. */ - (void)prepareForReuse; /*! @brief annotation */ @property (nonatomic, strong) id <MAAnnotation> annotation; /*! @brief image */ @property (nonatomic, strong) UIImage *image; /*! @brief , annotation viewannotationcenterOffsetviewview */ @property (nonatomic) CGPoint centerOffset; /*! @brief , viewcalloutOffsetviewview */ @property (nonatomic) CGPoint calloutOffset; /*! @brief YES,NOview */ @property (nonatomic, getter=isEnabled) BOOL enabled; @property (nonatomic, getter=isHighlighted) BOOL highlighted; /*! @brief , mapViewselectAnnotation */ @property (nonatomic, getter=isSelected) BOOL selected; - (void)setSelected:(BOOL)selected animated:(BOOL)animated; @property (nonatomic) BOOL canShowCallout; /*! @brief view */ @property (strong, nonatomic) UIView *leftCalloutAccessoryView; /*! @brief view */ @property (strong, nonatomic) UIView *rightCalloutAccessoryView; /*! @brief */ @property (nonatomic, getter=isDraggable) BOOL draggable NS_AVAILABLE(NA, 4_0); /*! @brief view */ @property (nonatomic) MAAnnotationViewDragState dragState NS_AVAILABLE(NA, 4_0); - (void)setDragState:(MAAnnotationViewDragState)newDragState animated:(BOOL)animated NS_AVAILABLE(NA, 4_2); @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAAnnotationView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
483
```objective-c // // MAGeodesicPolyline.h // MapKit_static // // Created by songjian on 13-10-23. // #import "MAPolyline.h" @interface MAGeodesicPolyline : MAPolyline + (instancetype)polylineWithPoints:(MAMapPoint *)points count:(NSUInteger)count; + (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAGeodesicPolyline.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
97
```objective-c // // MAPolygonView.h // MAMapKit // // // #import <UIKit/UIKit.h> #import "MAPolygon.h" #import "MAOverlayPathView.h" /*! @brief MAPolygonview,MAOverlayPathViewfillstroke attributes */ @interface MAPolygonView : MAOverlayPathView /*! @brief View @param polygon @return View */ - (id)initWithPolygon:(MAPolygon *)polygon; /*! @brief MAPolygon model */ @property (nonatomic, readonly) MAPolygon *polygon; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPolygonView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
111
```objective-c // // MAGeometry.h // MAMapKit // // Created by AutoNavi. // #import <CoreGraphics/CoreGraphics.h> #import <CoreLocation/CoreLocation.h> #import <UIKit/UIKit.h> #ifdef __cplusplus extern "C" { #endif typedef struct { CLLocationCoordinate2D northEast; CLLocationCoordinate2D southWest; } MACoordinateBounds; typedef struct { CLLocationDegrees latitudeDelta; CLLocationDegrees longitudeDelta; } MACoordinateSpan; typedef struct { CLLocationCoordinate2D center; MACoordinateSpan span; } MACoordinateRegion; static inline MACoordinateBounds MACoordinateBoundsMake(CLLocationCoordinate2D northEast,CLLocationCoordinate2D southWest) { return (MACoordinateBounds){northEast, southWest}; } static inline MACoordinateSpan MACoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) { return (MACoordinateSpan){latitudeDelta, longitudeDelta}; } static inline MACoordinateRegion MACoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, MACoordinateSpan span) { return (MACoordinateRegion){centerCoordinate, span}; } /*! @brief MACoordinateRegion @param centerCoordinate @param latitudinalMeters ( ) @param longitudinalMeters ( ) @return MACoordinateRegion */ extern MACoordinateRegion MACoordinateRegionMakeWithDistance(CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters); /** */ typedef struct { double x; double y; } MAMapPoint; /** */ typedef struct { double width; double height; } MAMapSize; /** */ typedef struct { MAMapPoint origin; MAMapSize size; } MAMapRect; /** :MAZoomScale = Screen Point / MAMapPoint, MAZoomScale = 1, 1 screen point = 1 MAMapPoint, MAZoomScale = 0.5, 1 screen point = 2 MAMapPoints */ typedef double MAZoomScale; /*! const */ extern const MAMapSize MAMapSizeWorld; extern const MAMapRect MAMapRectWorld; extern const MAMapRect MAMapRectNull; extern const MAMapRect MAMapRectZero; /*! @brief @param coordinate @return */ extern MAMapPoint MAMapPointForCoordinate(CLLocationCoordinate2D coordinate); /*! @brief @param mapPoint @return */ extern CLLocationCoordinate2D MACoordinateForMapPoint(MAMapPoint mapPoint); /*! @brief region @param mapPoint @return region */ extern MACoordinateRegion MACoordinateRegionForMapRect(MAMapRect rect); /*! @brief region @param region region @return */ extern MAMapRect MAMapRectForCoordinateRegion(MACoordinateRegion region); /*! @brief */ extern CLLocationDistance MAMetersPerMapPointAtLatitude(CLLocationDegrees latitude); /*! @brief 1 */ extern double MAMapPointsPerMeterAtLatitude(CLLocationDegrees latitude); /*! @brief */ extern CLLocationDistance MAMetersBetweenMapPoints(MAMapPoint a, MAMapPoint b); /*! @brief ( ) */ extern double MAAreaBetweenCoordinates(CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest); /*! @brief InsetMAMapRect */ extern MAMapRect MAMapRectInset(MAMapRect rect, double dx, double dy); /*! @brief MAMapRect */ extern MAMapRect MAMapRectUnion(MAMapRect rect1, MAMapRect rect2); /*! @brief size1size2 */ extern BOOL MAMapSizeContainsSize(MAMapSize size1, MAMapSize size2); /*! @brief */ extern BOOL MAMapRectContainsPoint(MAMapRect rect, MAMapPoint point); /*! @brief */ extern BOOL MAMapRectIntersectsRect(MAMapRect rect1, MAMapRect rect2); /*! @brief rect1rect2 */ extern BOOL MAMapRectContainsRect(MAMapRect rect1, MAMapRect rect2); /*! @brief */ extern BOOL MACircleContainsPoint(MAMapPoint point, MAMapPoint center, double radius); /*! @brief */ extern BOOL MACircleContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius); /*! @brief */ extern BOOL MAPolygonContainsPoint(MAMapPoint point, MAMapPoint *polygon, NSUInteger count); /*! @brief */ extern BOOL MAPolygonContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count); /*! lineStartlineEndpoint. @param lineStart . @param lineEnd . @param point . @return point. */ extern MAMapPoint MAGetNearestMapPointFromLine(MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point); /*! block(-1, -1, 0, 0, 0, 0). @param offsetX tileX, . @param offsetY tileY, . @param minX tilex. @param maxX tilex. @param minY tiley. @param maxY tiley. */ typedef void (^AMapTileProjectionBlock)(int offsetX, int offsetY, int minX, int maxX, int minY, int maxY); /*! . @param bounds . @param levelOfDetails , 0-20 @param tileProjection block. */ extern void MAGetTileProjectionFromBounds(MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection); static inline MAMapPoint MAMapPointMake(double x, double y) { return (MAMapPoint){x, y}; } static inline MAMapSize MAMapSizeMake(double width, double height) { return (MAMapSize){width, height}; } static inline MAMapRect MAMapRectMake(double x, double y, double width, double height) { return (MAMapRect){MAMapPointMake(x, y), MAMapSizeMake(width, height)}; } static inline double MAMapRectGetMinX(MAMapRect rect) { return rect.origin.x; } static inline double MAMapRectGetMinY(MAMapRect rect) { return rect.origin.y; } static inline double MAMapRectGetMidX(MAMapRect rect) { return rect.origin.x + rect.size.width / 2.0; } static inline double MAMapRectGetMidY(MAMapRect rect) { return rect.origin.y + rect.size.height / 2.0; } static inline double MAMapRectGetMaxX(MAMapRect rect) { return rect.origin.x + rect.size.width; } static inline double MAMapRectGetMaxY(MAMapRect rect) { return rect.origin.y + rect.size.height; } static inline double MAMapRectGetWidth(MAMapRect rect) { return rect.size.width; } static inline double MAMapRectGetHeight(MAMapRect rect) { return rect.size.height; } static inline BOOL MAMapPointEqualToPoint(MAMapPoint point1, MAMapPoint point2) { return point1.x == point2.x && point1.y == point2.y; } static inline BOOL MAMapSizeEqualToSize(MAMapSize size1, MAMapSize size2) { return size1.width == size2.width && size1.height == size2.height; } static inline BOOL MAMapRectEqualToRect(MAMapRect rect1, MAMapRect rect2) { return MAMapPointEqualToPoint(rect1.origin, rect2.origin) && MAMapSizeEqualToSize(rect1.size, rect2.size); } static inline BOOL MAMapRectIsNull(MAMapRect rect) { return isinf(rect.origin.x) || isinf(rect.origin.y); } static inline BOOL MAMapRectIsEmpty(MAMapRect rect) { return MAMapRectIsNull(rect) || (rect.size.width == 0.0 && rect.size.height == 0.0); } static inline NSString *MAStringFromMapPoint(MAMapPoint point) { return [NSString stringWithFormat:@"{%.1f, %.1f}", point.x, point.y]; } static inline NSString *MAStringFromMapSize(MAMapSize size) { return [NSString stringWithFormat:@"{%.1f, %.1f}", size.width, size.height]; } static inline NSString *MAStringFromMapRect(MAMapRect rect) { return [NSString stringWithFormat:@"{%@, %@}", MAStringFromMapPoint(rect.origin), MAStringFromMapSize(rect.size)]; } /// typedef NS_ENUM(NSUInteger, MACoordinateType) { MACoordinateTypeBaidu = 0, // Baidu MACoordinateTypeMapBar, // MapBar MACoordinateTypeMapABC, // MapABC MACoordinateTypeSoSoMap, // SoSoMap MACoordinateTypeAliYun, // AliYun MACoordinateTypeGoogle, // Google MACoordinateTypeGPS, // GPS }; /** * * * @param coordinate * @param type * * @return */ extern CLLocationCoordinate2D MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type); #ifdef __cplusplus } #endif @interface NSValue (NSValueMAGeometryExtensions) + (NSValue *)valueWithMAMapPoint:(MAMapPoint)mapPoint; + (NSValue *)valueWithMAMapSize:(MAMapSize)mapSize; + (NSValue *)valueWithMAMapRect:(MAMapRect)mapRect; + (NSValue *)valueWithMACoordinate:(CLLocationCoordinate2D)coordinate; - (MAMapPoint)MAMapPointValue; - (MAMapSize)MAMapSizeValue; - (MAMapRect)MAMapRectValue; - (CLLocationCoordinate2D)MACoordinateValue; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAGeometry.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
2,453
```objective-c // // FTPopOverMenu.m // FTPopOverMenu // // Created by liufengting on 16/4/5. // #import "FTPopOverMenu.h" // changeable #define FTDefaultMargin 4.f #define FTDefaultMenuTextMargin 6.f #define FTDefaultMenuIconMargin 6.f #define FTDefaultMenuCornerRadius 5.f #define FTDefaultAnimationDuration 0.2 // unchangeable, change them at your own risk #define KSCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width #define KSCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height #define FTDefaultBackgroundColor [UIColor clearColor] #define FTDefaultTintColor [UIColor colorWithRed:80/255.f green:80/255.f blue:80/255.f alpha:1.f] #define FTDefaultTextColor [UIColor whiteColor] #define FTDefaultMenuFont [UIFont systemFontOfSize:14.f] #define FTDefaultMenuWidth 120.f #define FTDefaultMenuIconSize 24.f #define FTDefaultMenuRowHeight 40.f #define FTDefaultMenuBorderWidth 0.8 #define FTDefaultMenuArrowWidth 8.f #define FTDefaultMenuArrowHeight 10.f #define FTDefaultMenuArrowWidth_R 12.f #define FTDefaultMenuArrowHeight_R 12.f #define FTDefaultMenuArrowRoundRadius 4.f static NSString *const FTPopOverMenuTableViewCellIndentifier = @"FTPopOverMenuTableViewCellIndentifier"; static NSString *const FTPopOverMenuImageCacheDirectory = @"com.FTPopOverMenuImageCache"; /** * FTPopOverMenuArrowDirection */ typedef NS_ENUM(NSUInteger, FTPopOverMenuArrowDirection) { /** * Up */ FTPopOverMenuArrowDirectionUp, /** * Down */ FTPopOverMenuArrowDirectionDown, }; #pragma mark - FTPopOverMenuConfiguration @interface FTPopOverMenuConfiguration () @end @implementation FTPopOverMenuConfiguration + (FTPopOverMenuConfiguration *)defaultConfiguration { static dispatch_once_t once = 0; static FTPopOverMenuConfiguration *configuration; dispatch_once(&once, ^{ configuration = [[FTPopOverMenuConfiguration alloc] init]; }); return configuration; } - (instancetype)init { self = [super init]; if (self) { self.menuRowHeight = FTDefaultMenuRowHeight; self.menuWidth = FTDefaultMenuWidth; self.textColor = FTDefaultTextColor; self.textFont = FTDefaultMenuFont; self.tintColor = FTDefaultTintColor; self.borderColor = FTDefaultTintColor; self.borderWidth = FTDefaultMenuBorderWidth; self.textAlignment = NSTextAlignmentCenter; self.ignoreImageOriginalColor = NO; self.allowRoundedArrow = NO; self.menuTextMargin = FTDefaultMenuTextMargin; self.menuIconMargin = FTDefaultMenuIconMargin; self.animationDuration = FTDefaultAnimationDuration; } return self; } @end #pragma mark - FTPopOverMenuCell @interface FTPopOverMenuCell () @property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UILabel *menuNameLabel; @end @implementation FTPopOverMenuCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier menuName:(NSString *)menuName menuImage:(id )menuImage { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.backgroundColor = [UIColor clearColor]; [self setupWithMenuName:menuName menuImage:menuImage]; } return self; } -(UIImageView *)iconImageView { if (!_iconImageView) { _iconImageView = [[UIImageView alloc]initWithFrame:CGRectZero]; _iconImageView.backgroundColor = [UIColor clearColor]; _iconImageView.contentMode = UIViewContentModeScaleAspectFit; } return _iconImageView; } -(UILabel *)menuNameLabel { if (!_menuNameLabel) { _menuNameLabel = [[UILabel alloc]initWithFrame:CGRectZero]; _menuNameLabel.backgroundColor = [UIColor clearColor]; } return _menuNameLabel; } -(void)setupWithMenuName:(NSString *)menuName menuImage:(id )menuImage { FTPopOverMenuConfiguration *configuration = [FTPopOverMenuConfiguration defaultConfiguration]; CGFloat margin = (configuration.menuRowHeight - FTDefaultMenuIconSize)/2.f; CGRect iconImageRect = CGRectMake(configuration.menuIconMargin, margin, FTDefaultMenuIconSize, FTDefaultMenuIconSize); CGFloat menuNameX = iconImageRect.origin.x + iconImageRect.size.width + configuration.menuTextMargin; CGRect menuNameRect = CGRectMake(menuNameX, 0, configuration.menuWidth - menuNameX - configuration.menuTextMargin, configuration.menuRowHeight); if (!menuImage) { menuNameRect = CGRectMake(configuration.menuTextMargin, 0, configuration.menuWidth - configuration.menuTextMargin*2, configuration.menuRowHeight); }else{ self.iconImageView.frame = iconImageRect; self.iconImageView.tintColor = configuration.textColor; [self getImageWithResource:menuImage completion:^(UIImage *image) { if (configuration.ignoreImageOriginalColor) { image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; } _iconImageView.image = image; }]; [self.contentView addSubview:self.iconImageView]; } self.menuNameLabel.frame = menuNameRect; self.menuNameLabel.font = configuration.textFont; self.menuNameLabel.textColor = configuration.textColor; self.menuNameLabel.textAlignment = configuration.textAlignment; self.menuNameLabel.text = menuName; [self.contentView addSubview:self.menuNameLabel]; } /** get image from local or remote @param resource image reource @param doneBlock get image back */ -(void)getImageWithResource:(id)resource completion:(void (^)(UIImage *image))completion { if ([resource isKindOfClass:[UIImage class]]) { completion(resource); }else if ([resource isKindOfClass:[NSString class]]) { if ([resource hasPrefix:@"http"]) { [self downloadImageWithURL:[NSURL URLWithString:resource] completion:completion]; }else{ completion([UIImage imageNamed:resource]); } }else if ([resource isKindOfClass:[NSURL class]]) { [self downloadImageWithURL:resource completion:completion]; }else{ NSLog(@"Image resource not recougnized."); completion(nil); } } /** download image if needed, cache image into disk if needed. @param url imageURL @param doneBlock get image back */ -(void)downloadImageWithURL:(NSURL *)url completion:(void (^)(UIImage *image))completion { if ([self isExitImageForImageURL:url]) { NSString *filePath = [self filePathForImageURL:url]; completion([UIImage imageWithContentsOfFile:filePath]); }else{ // download dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]]; if (image) { NSData *data = UIImagePNGRepresentation(image); [data writeToFile:[self filePathForImageURL:url] atomically:YES]; dispatch_async(dispatch_get_main_queue(), ^{ completion(image); }); } }); } } /** return if the image is downloaded and cached before @param url imageURL @return if the image is downloaded and cached before */ -(BOOL)isExitImageForImageURL:(NSURL *)url { return [[NSFileManager defaultManager] fileExistsAtPath:[self filePathForImageURL:url]]; } /** get local disk cash filePath for imageurl @param url imageURL @return filePath */ -(NSString *)filePathForImageURL:(NSURL *)url { NSString *diskCachePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:FTPopOverMenuImageCacheDirectory]; if(![[NSFileManager defaultManager] fileExistsAtPath:diskCachePath]){ NSError *error = nil; [[NSFileManager defaultManager] createDirectoryAtPath:diskCachePath withIntermediateDirectories:YES attributes:@{} error:&error]; } NSData *data = [url.absoluteString dataUsingEncoding:NSUTF8StringEncoding]; NSString *pathComponent = [data base64EncodedStringWithOptions:NSUTF8StringEncoding]; NSString *filePath = [diskCachePath stringByAppendingPathComponent:pathComponent]; return filePath; } @end #pragma mark - FTPopOverMenuView @interface FTPopOverMenuView () <UITableViewDelegate,UITableViewDataSource> @property (nonatomic, strong) UITableView *menuTableView; @property (nonatomic, strong) NSArray<NSString *> *menuStringArray; @property (nonatomic, strong) NSArray *menuImageArray; @property (nonatomic, assign) FTPopOverMenuArrowDirection arrowDirection; @property (nonatomic, strong) FTPopOverMenuDoneBlock doneBlock; @property (nonatomic, strong) CAShapeLayer *backgroundLayer; @property (nonatomic, strong) UIColor *tintColor; @end @implementation FTPopOverMenuView -(instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { } return self; } -(UITableView *)menuTableView { if (!_menuTableView) { _menuTableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain]; _menuTableView.backgroundColor = FTDefaultBackgroundColor; _menuTableView.separatorColor = [UIColor grayColor]; _menuTableView.layer.cornerRadius = FTDefaultMenuCornerRadius; _menuTableView.scrollEnabled = NO; _menuTableView.clipsToBounds = YES; _menuTableView.delegate = self; _menuTableView.dataSource = self; [self addSubview:_menuTableView]; } return _menuTableView; } -(CGFloat)menuArrowWidth { return [FTPopOverMenuConfiguration defaultConfiguration].allowRoundedArrow ? FTDefaultMenuArrowWidth_R : FTDefaultMenuArrowWidth; } -(CGFloat)menuArrowHeight { return [FTPopOverMenuConfiguration defaultConfiguration].allowRoundedArrow ? FTDefaultMenuArrowHeight_R : FTDefaultMenuArrowHeight; } -(void)showWithFrame:(CGRect )frame anglePoint:(CGPoint )anglePoint withNameArray:(NSArray<NSString*> *)nameArray imageNameArray:(NSArray *)imageNameArray shouldAutoScroll:(BOOL)shouldAutoScroll arrowDirection:(FTPopOverMenuArrowDirection)arrowDirection doneBlock:(FTPopOverMenuDoneBlock)doneBlock { self.frame = frame; _menuStringArray = nameArray; _menuImageArray = imageNameArray; _arrowDirection = arrowDirection; self.doneBlock = doneBlock; self.menuTableView.scrollEnabled = shouldAutoScroll; CGRect menuRect = CGRectMake(0, self.menuArrowHeight, self.frame.size.width, self.frame.size.height - self.menuArrowHeight); if (_arrowDirection == FTPopOverMenuArrowDirectionDown) { menuRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - self.menuArrowHeight); } [self.menuTableView setFrame:menuRect]; [self.menuTableView reloadData]; [self drawBackgroundLayerWithAnglePoint:anglePoint]; } -(void)drawBackgroundLayerWithAnglePoint:(CGPoint)anglePoint { if (_backgroundLayer) { [_backgroundLayer removeFromSuperlayer]; } UIBezierPath *path = [UIBezierPath bezierPath]; BOOL allowRoundedArrow = [FTPopOverMenuConfiguration defaultConfiguration].allowRoundedArrow; CGFloat offset = 2.f*FTDefaultMenuArrowRoundRadius*sinf(M_PI_4/2.f); CGFloat roundcenterHeight = offset + FTDefaultMenuArrowRoundRadius*sqrtf(2.f); CGPoint roundcenterPoint = CGPointMake(anglePoint.x, roundcenterHeight); switch (_arrowDirection) { case FTPopOverMenuArrowDirectionUp:{ if (allowRoundedArrow) { [path addArcWithCenter:CGPointMake(anglePoint.x + self.menuArrowWidth, self.menuArrowHeight - 2.f*FTDefaultMenuArrowRoundRadius) radius:2.f*FTDefaultMenuArrowRoundRadius startAngle:M_PI_2 endAngle:M_PI_4*3.f clockwise:YES]; [path addLineToPoint:CGPointMake(anglePoint.x + FTDefaultMenuArrowRoundRadius/sqrtf(2.f), roundcenterPoint.y - FTDefaultMenuArrowRoundRadius/sqrtf(2.f))]; [path addArcWithCenter:roundcenterPoint radius:FTDefaultMenuArrowRoundRadius startAngle:M_PI_4*7.f endAngle:M_PI_4*5.f clockwise:NO]; [path addLineToPoint:CGPointMake(anglePoint.x - self.menuArrowWidth + (offset * (1.f+1.f/sqrtf(2.f))), self.menuArrowHeight - offset/sqrtf(2.f))]; [path addArcWithCenter:CGPointMake(anglePoint.x - self.menuArrowWidth, self.menuArrowHeight - 2.f*FTDefaultMenuArrowRoundRadius) radius:2.f*FTDefaultMenuArrowRoundRadius startAngle:M_PI_4 endAngle:M_PI_2 clockwise:YES]; } else { [path moveToPoint:CGPointMake(anglePoint.x + self.menuArrowWidth, self.menuArrowHeight)]; [path addLineToPoint:anglePoint]; [path addLineToPoint:CGPointMake( anglePoint.x - self.menuArrowWidth, self.menuArrowHeight)]; } [path addLineToPoint:CGPointMake( FTDefaultMenuCornerRadius, self.menuArrowHeight)]; [path addArcWithCenter:CGPointMake(FTDefaultMenuCornerRadius, self.menuArrowHeight + FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:-M_PI_2 endAngle:-M_PI clockwise:NO]; [path addLineToPoint:CGPointMake( 0, self.bounds.size.height - FTDefaultMenuCornerRadius)]; [path addArcWithCenter:CGPointMake(FTDefaultMenuCornerRadius, self.bounds.size.height - FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:M_PI endAngle:M_PI_2 clockwise:NO]; [path addLineToPoint:CGPointMake( self.bounds.size.width - FTDefaultMenuCornerRadius, self.bounds.size.height)]; [path addArcWithCenter:CGPointMake(self.bounds.size.width - FTDefaultMenuCornerRadius, self.bounds.size.height - FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:M_PI_2 endAngle:0 clockwise:NO]; [path addLineToPoint:CGPointMake(self.bounds.size.width , FTDefaultMenuCornerRadius + self.menuArrowHeight)]; [path addArcWithCenter:CGPointMake(self.bounds.size.width - FTDefaultMenuCornerRadius, FTDefaultMenuCornerRadius + self.menuArrowHeight) radius:FTDefaultMenuCornerRadius startAngle:0 endAngle:-M_PI_2 clockwise:NO]; [path closePath]; }break; case FTPopOverMenuArrowDirectionDown:{ roundcenterPoint = CGPointMake(anglePoint.x, anglePoint.y - roundcenterHeight); if (allowRoundedArrow) { [path addArcWithCenter:CGPointMake(anglePoint.x + self.menuArrowWidth, anglePoint.y - self.menuArrowHeight + 2.f*FTDefaultMenuArrowRoundRadius) radius:2.f*FTDefaultMenuArrowRoundRadius startAngle:M_PI_2*3 endAngle:M_PI_4*5.f clockwise:NO]; [path addLineToPoint:CGPointMake(anglePoint.x + FTDefaultMenuArrowRoundRadius/sqrtf(2.f), roundcenterPoint.y + FTDefaultMenuArrowRoundRadius/sqrtf(2.f))]; [path addArcWithCenter:roundcenterPoint radius:FTDefaultMenuArrowRoundRadius startAngle:M_PI_4 endAngle:M_PI_4*3.f clockwise:YES]; [path addLineToPoint:CGPointMake(anglePoint.x - self.menuArrowWidth + (offset * (1.f+1.f/sqrtf(2.f))), anglePoint.y - self.menuArrowHeight + offset/sqrtf(2.f))]; [path addArcWithCenter:CGPointMake(anglePoint.x - self.menuArrowWidth, anglePoint.y - self.menuArrowHeight + 2.f*FTDefaultMenuArrowRoundRadius) radius:2.f*FTDefaultMenuArrowRoundRadius startAngle:M_PI_4*7 endAngle:M_PI_2*3 clockwise:NO]; } else { [path moveToPoint:CGPointMake(anglePoint.x + self.menuArrowWidth, anglePoint.y - self.menuArrowHeight)]; [path addLineToPoint:anglePoint]; [path addLineToPoint:CGPointMake( anglePoint.x - self.menuArrowWidth, anglePoint.y - self.menuArrowHeight)]; } [path addLineToPoint:CGPointMake( FTDefaultMenuCornerRadius, anglePoint.y - self.menuArrowHeight)]; [path addArcWithCenter:CGPointMake(FTDefaultMenuCornerRadius, anglePoint.y - self.menuArrowHeight - FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:M_PI_2 endAngle:M_PI clockwise:YES]; [path addLineToPoint:CGPointMake( 0, FTDefaultMenuCornerRadius)]; [path addArcWithCenter:CGPointMake(FTDefaultMenuCornerRadius, FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:M_PI endAngle:-M_PI_2 clockwise:YES]; [path addLineToPoint:CGPointMake( self.bounds.size.width - FTDefaultMenuCornerRadius, 0)]; [path addArcWithCenter:CGPointMake(self.bounds.size.width - FTDefaultMenuCornerRadius, FTDefaultMenuCornerRadius) radius:FTDefaultMenuCornerRadius startAngle:-M_PI_2 endAngle:0 clockwise:YES]; [path addLineToPoint:CGPointMake(self.bounds.size.width , anglePoint.y - (FTDefaultMenuCornerRadius + self.menuArrowHeight))]; [path addArcWithCenter:CGPointMake(self.bounds.size.width - FTDefaultMenuCornerRadius, anglePoint.y - (FTDefaultMenuCornerRadius + self.menuArrowHeight)) radius:FTDefaultMenuCornerRadius startAngle:0 endAngle:M_PI_2 clockwise:YES]; [path closePath]; }break; default: break; } _backgroundLayer = [CAShapeLayer layer]; _backgroundLayer.path = path.CGPath; _backgroundLayer.lineWidth = [FTPopOverMenuConfiguration defaultConfiguration].borderWidth; _backgroundLayer.fillColor = [FTPopOverMenuConfiguration defaultConfiguration].tintColor.CGColor; _backgroundLayer.strokeColor = [FTPopOverMenuConfiguration defaultConfiguration].borderColor.CGColor; [self.layer insertSublayer:_backgroundLayer atIndex:0]; } #pragma mark - UITableViewDelegate,UITableViewDataSource -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 0.f; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return [FTPopOverMenuConfiguration defaultConfiguration].menuRowHeight; } -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.f; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return _menuStringArray.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { id menuImage; if (_menuImageArray.count - 1 >= indexPath.row) { menuImage = _menuImageArray[indexPath.row]; } FTPopOverMenuCell *menuCell = [[FTPopOverMenuCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:FTPopOverMenuTableViewCellIndentifier menuName:[NSString stringWithFormat:@"%@", _menuStringArray[indexPath.row]] menuImage:menuImage]; if (indexPath.row == _menuStringArray.count-1) { menuCell.separatorInset = UIEdgeInsetsMake(0, self.bounds.size.width, 0, 0); }else{ menuCell.separatorInset = UIEdgeInsetsMake(0, [FTPopOverMenuConfiguration defaultConfiguration].menuTextMargin, 0, [FTPopOverMenuConfiguration defaultConfiguration].menuTextMargin); } return menuCell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; if (self.doneBlock) { self.doneBlock(indexPath.row); } } @end #pragma mark - FTPopOverMenu @interface FTPopOverMenu () <UIGestureRecognizerDelegate> @property (nonatomic, strong) UIView * backgroundView; @property (nonatomic, strong) FTPopOverMenuView *popMenuView; @property (nonatomic, strong) FTPopOverMenuDoneBlock doneBlock; @property (nonatomic, strong) FTPopOverMenuDismissBlock dismissBlock; @property (nonatomic, strong) UIView *sender; @property (nonatomic, assign) CGRect senderFrame; @property (nonatomic, strong) NSArray<NSString*> *menuArray; @property (nonatomic, strong) NSArray<NSString*> *menuImageArray; @property (nonatomic, assign) BOOL isCurrentlyOnScreen; @end @implementation FTPopOverMenu + (FTPopOverMenu *)sharedInstance { static dispatch_once_t once = 0; static FTPopOverMenu *shared; dispatch_once(&once, ^{ shared = [[FTPopOverMenu alloc] init]; }); return shared; } #pragma mark - Public Method + (void) showForSender:(UIView *)sender withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:sender senderFrame:CGRectNull withMenu:menuArray imageNameArray:nil doneBlock:doneBlock dismissBlock:dismissBlock]; } + (void) showForSender:(UIView *)sender withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:sender senderFrame:CGRectNull withMenu:menuArray imageNameArray:imageArray doneBlock:doneBlock dismissBlock:dismissBlock]; } + (void) showFromEvent:(UIEvent *)event withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:[event.allTouches.anyObject view] senderFrame:CGRectNull withMenu:menuArray imageNameArray:nil doneBlock:doneBlock dismissBlock:dismissBlock]; } + (void) showFromEvent:(UIEvent *)event withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:[event.allTouches.anyObject view] senderFrame:CGRectNull withMenu:menuArray imageNameArray:imageArray doneBlock:doneBlock dismissBlock:dismissBlock]; } + (void) showFromSenderFrame:(CGRect )senderFrame withMenuArray:(NSArray<NSString*> *)menuArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:nil senderFrame:senderFrame withMenu:menuArray imageNameArray:nil doneBlock:doneBlock dismissBlock:dismissBlock]; } + (void) showFromSenderFrame:(CGRect )senderFrame withMenuArray:(NSArray<NSString*> *)menuArray imageArray:(NSArray *)imageArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { [[self sharedInstance] showForSender:nil senderFrame:senderFrame withMenu:menuArray imageNameArray:imageArray doneBlock:doneBlock dismissBlock:dismissBlock]; } +(void)dismiss { [[self sharedInstance] dismiss]; } #pragma mark - Private Methods - (instancetype)init { self = [super init]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; } return self; } - (UIWindow *)backgroundWindow { UIWindow *window = [[UIApplication sharedApplication] keyWindow]; id<UIApplicationDelegate> delegate = [[UIApplication sharedApplication] delegate]; if (window == nil && [delegate respondsToSelector:@selector(window)]){ window = [delegate performSelector:@selector(window)]; } return window; } -(UIView *)backgroundView { if (!_backgroundView) { _backgroundView = [[UIView alloc ]initWithFrame:[UIScreen mainScreen].bounds]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onBackgroundViewTapped:)]; tap.delegate = self; [_backgroundView addGestureRecognizer:tap]; _backgroundView.backgroundColor = FTDefaultBackgroundColor; } return _backgroundView; } -(FTPopOverMenuView *)popMenuView { if (!_popMenuView) { _popMenuView = [[FTPopOverMenuView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; _popMenuView.alpha = 0; } return _popMenuView; } -(CGFloat)menuArrowWidth { return [FTPopOverMenuConfiguration defaultConfiguration].allowRoundedArrow ? FTDefaultMenuArrowWidth_R : FTDefaultMenuArrowWidth; } -(CGFloat)menuArrowHeight { return [FTPopOverMenuConfiguration defaultConfiguration].allowRoundedArrow ? FTDefaultMenuArrowHeight_R : FTDefaultMenuArrowHeight; } -(void)onChangeStatusBarOrientationNotification:(NSNotification *)notification { if (self.isCurrentlyOnScreen) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self adjustPopOverMenu]; }); } } - (void) showForSender:(UIView *)sender senderFrame:(CGRect )senderFrame withMenu:(NSArray<NSString*> *)menuArray imageNameArray:(NSArray<NSString*> *)imageNameArray doneBlock:(FTPopOverMenuDoneBlock)doneBlock dismissBlock:(FTPopOverMenuDismissBlock)dismissBlock { dispatch_async(dispatch_get_main_queue(), ^{ [self.backgroundView addSubview:self.popMenuView]; [[self backgroundWindow] addSubview:self.backgroundView]; self.sender = sender; self.senderFrame = senderFrame; self.menuArray = menuArray; self.menuImageArray = imageNameArray; self.doneBlock = doneBlock; self.dismissBlock = dismissBlock; [self adjustPopOverMenu]; }); } -(void)adjustPopOverMenu { [self.backgroundView setFrame:CGRectMake(0, 0, KSCREEN_WIDTH, KSCREEN_HEIGHT)]; CGRect senderRect ; if (self.sender) { senderRect = [self.sender.superview convertRect:self.sender.frame toView:self.backgroundView]; // if run into touch problems on nav bar, use the fowllowing line. // senderRect.origin.y = MAX(64-senderRect.origin.y, senderRect.origin.y); }else{ senderRect = self.senderFrame; } if (senderRect.origin.y > KSCREEN_HEIGHT) { senderRect.origin.y = KSCREEN_HEIGHT; } CGFloat menuHeight = [FTPopOverMenuConfiguration defaultConfiguration].menuRowHeight * self.menuArray.count + self.menuArrowHeight; CGPoint menuArrowPoint = CGPointMake(senderRect.origin.x + (senderRect.size.width)/2, 0); CGFloat menuX = 0; CGRect menuRect = CGRectZero; BOOL shouldAutoScroll = NO; FTPopOverMenuArrowDirection arrowDirection; if (senderRect.origin.y + senderRect.size.height/2 < KSCREEN_HEIGHT/2) { arrowDirection = FTPopOverMenuArrowDirectionUp; menuArrowPoint.y = 0; }else{ arrowDirection = FTPopOverMenuArrowDirectionDown; menuArrowPoint.y = menuHeight; } if (menuArrowPoint.x + [FTPopOverMenuConfiguration defaultConfiguration].menuWidth/2 + FTDefaultMargin > KSCREEN_WIDTH) { menuArrowPoint.x = MIN(menuArrowPoint.x - (KSCREEN_WIDTH - [FTPopOverMenuConfiguration defaultConfiguration].menuWidth - FTDefaultMargin), [FTPopOverMenuConfiguration defaultConfiguration].menuWidth - self.menuArrowWidth - FTDefaultMargin); menuX = KSCREEN_WIDTH - [FTPopOverMenuConfiguration defaultConfiguration].menuWidth - FTDefaultMargin; }else if ( menuArrowPoint.x - [FTPopOverMenuConfiguration defaultConfiguration].menuWidth/2 - FTDefaultMargin < 0){ menuArrowPoint.x = MAX( FTDefaultMenuCornerRadius + self.menuArrowWidth, menuArrowPoint.x - FTDefaultMargin); menuX = FTDefaultMargin; }else{ menuArrowPoint.x = [FTPopOverMenuConfiguration defaultConfiguration].menuWidth/2; menuX = senderRect.origin.x + (senderRect.size.width)/2 - [FTPopOverMenuConfiguration defaultConfiguration].menuWidth/2; } if (arrowDirection == FTPopOverMenuArrowDirectionUp) { menuRect = CGRectMake(menuX, (senderRect.origin.y + senderRect.size.height), [FTPopOverMenuConfiguration defaultConfiguration].menuWidth, menuHeight); // if too long and is out of screen if (menuRect.origin.y + menuRect.size.height > KSCREEN_HEIGHT) { menuRect = CGRectMake(menuX, (senderRect.origin.y + senderRect.size.height), [FTPopOverMenuConfiguration defaultConfiguration].menuWidth, KSCREEN_HEIGHT - menuRect.origin.y - FTDefaultMargin); shouldAutoScroll = YES; } }else{ menuRect = CGRectMake(menuX, (senderRect.origin.y - menuHeight), [FTPopOverMenuConfiguration defaultConfiguration].menuWidth, menuHeight); // if too long and is out of screen if (menuRect.origin.y < 0) { menuRect = CGRectMake(menuX, FTDefaultMargin, [FTPopOverMenuConfiguration defaultConfiguration].menuWidth, senderRect.origin.y - FTDefaultMargin); menuArrowPoint.y = senderRect.origin.y; shouldAutoScroll = YES; } } [self prepareToShowWithMenuRect:menuRect menuArrowPoint:menuArrowPoint shouldAutoScroll:shouldAutoScroll arrowDirection:arrowDirection]; [self show]; } -(void)prepareToShowWithMenuRect:(CGRect)menuRect menuArrowPoint:(CGPoint)menuArrowPoint shouldAutoScroll:(BOOL)shouldAutoScroll arrowDirection:(FTPopOverMenuArrowDirection)arrowDirection { CGPoint anchorPoint = CGPointMake(menuArrowPoint.x/menuRect.size.width, 0); if (arrowDirection == FTPopOverMenuArrowDirectionDown) { anchorPoint = CGPointMake(menuArrowPoint.x/menuRect.size.width, 1); } _popMenuView.transform = CGAffineTransformMakeScale(1, 1); [_popMenuView showWithFrame:menuRect anglePoint:menuArrowPoint withNameArray:self.menuArray imageNameArray:self.menuImageArray shouldAutoScroll:shouldAutoScroll arrowDirection:arrowDirection doneBlock:^(NSInteger selectedIndex) { [self doneActionWithSelectedIndex:selectedIndex]; }]; [self setAnchorPoint:anchorPoint forView:_popMenuView]; _popMenuView.transform = CGAffineTransformMakeScale(0.1, 0.1); } -(void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view { CGPoint newPoint = CGPointMake(view.bounds.size.width * anchorPoint.x, view.bounds.size.height * anchorPoint.y); CGPoint oldPoint = CGPointMake(view.bounds.size.width * view.layer.anchorPoint.x, view.bounds.size.height * view.layer.anchorPoint.y); newPoint = CGPointApplyAffineTransform(newPoint, view.transform); oldPoint = CGPointApplyAffineTransform(oldPoint, view.transform); CGPoint position = view.layer.position; position.x -= oldPoint.x; position.x += newPoint.x; position.y -= oldPoint.y; position.y += newPoint.y; view.layer.position = position; view.layer.anchorPoint = anchorPoint; } #pragma mark - UIGestureRecognizerDelegate -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { CGPoint point = [touch locationInView:_popMenuView]; if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) { return NO; }else if (CGRectContainsPoint(CGRectMake(0, 0, [FTPopOverMenuConfiguration defaultConfiguration].menuWidth, [FTPopOverMenuConfiguration defaultConfiguration].menuRowHeight), point)) { [self doneActionWithSelectedIndex:0]; return NO; } return YES; } #pragma mark - onBackgroundViewTapped -(void)onBackgroundViewTapped:(UIGestureRecognizer *)gesture { [self dismiss]; } #pragma mark - show animation - (void)show { self.isCurrentlyOnScreen = YES; [UIView animateWithDuration:FTDefaultAnimationDuration animations:^{ _popMenuView.alpha = 1; _popMenuView.transform = CGAffineTransformMakeScale(1, 1); }]; } #pragma mark - dismiss animation - (void)dismiss { self.isCurrentlyOnScreen = NO; [self doneActionWithSelectedIndex:-1]; } #pragma mark - doneActionWithSelectedIndex -(void)doneActionWithSelectedIndex:(NSInteger)selectedIndex { [UIView animateWithDuration:FTDefaultAnimationDuration animations:^{ _popMenuView.alpha = 0; _popMenuView.transform = CGAffineTransformMakeScale(0.1, 0.1); }completion:^(BOOL finished) { if (finished) { [self.popMenuView removeFromSuperview]; [self.backgroundView removeFromSuperview]; if (selectedIndex < 0) { if (self.dismissBlock) { self.dismissBlock(); } }else{ if (self.doneBlock) { self.doneBlock(selectedIndex); } } } }]; } @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Lib/FTPopOverMenu/FTPopOverMenu.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
7,291
```objective-c // // MAPinAnnotationView.h // MAMapKitDemo // // Created by songjian on 13-1-7. // #import "MAMapKit.h" typedef NS_ENUM(NSUInteger, MAPinAnnotationColor){ MAPinAnnotationColorRed = 0, MAPinAnnotationColorGreen, MAPinAnnotationColorPurple }; //typedef NSUInteger MAPinAnnotationColor; /*! @brief annotation view */ @interface MAPinAnnotationView : MAAnnotationView /*! @brief MAPinAnnotationColorRed, MAPinAnnotationColorGreen, MAPinAnnotationColorPurple */ @property (nonatomic) MAPinAnnotationColor pinColor; /*! @brief */ @property (nonatomic) BOOL animatesDrop; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPinAnnotationView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
152
```objective-c // // MAOverlay.h // MAMapKit // // // #import "MAAnnotation.h" #import "MAGeometry.h" /*! @brief */ @protocol MAOverlay <MAAnnotation> @required /*! @brief . */ @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; /*! @brief */ @property (nonatomic, readonly) MAMapRect boundingMapRect; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOverlay.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
84
```objective-c // // MAOverlayView.h // MAMapKit // // // #import <UIKit/UIKit.h> #import "MAGeometry.h" #import "MAOverlay.h" #import "MALineDrawType.h" #define kMAOverlayViewDefaultStrokeColor [UIColor colorWithRed:0.3 green:0.63 blue:0.89 alpha:0.8] #define kMAOverlayViewDefaultFillColor [UIColor colorWithRed:0.77 green:0.88 blue:0.94 alpha:0.8] /*! @brief View, overlay */ @interface MAOverlayView : UIView /*! @brief overlay view @param overlay overlay @return overlay view,nil */ - (id)initWithOverlay:(id <MAOverlay>)overlay; /*! @brief overlay */ @property (nonatomic, readonly, retain) id <MAOverlay> overlay; /*! @brief MAMapPointreceiver @param mapPoint MAMapPoint @return receiver */ - (CGPoint)pointForMapPoint:(MAMapPoint)mapPoint; /*! @brief receiverMAMapPoint @param point receiver @return MAMapPoint */ - (MAMapPoint)mapPointForPoint:(CGPoint)point; /*! @brief MAMapRectreceiverrect @param mapRect MAMapRect @return receiverrect */ - (CGRect)rectForMapRect:(MAMapRect)mapRect; /*! @brief receiverrectMAMapRect @param rect receiverrect @return MAMapRect */ - (MAMapRect)mapRectForRect:(CGRect)rect; /*! @brief overlay view @param mapRect MAMapRect @param zoomScale @param context graphics context */ - (void)drawMapRect:(MAMapRect)mapRect zoomScale:(CGFloat)zoomScale inContext:(CGContextRef)context; /*! @brief OpenGLES */ @property (nonatomic) CGPoint *glPoints; /*! @brief OpenGLES */ @property (nonatomic) NSUInteger glPointCount; /*! @brief MAMapPointopengles @param mapPoint MAMapPoint @return opengles */ - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint; /*! @brief MAMapPointopengles @param mapPoint MAMapPoint @param count @return opengles () */ - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count; /*! @brief OpenGLES @param windowWidth @return OpenGLES */ - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth; /*! @brief OpenGLES, OpenGLES */ - (void)referenceDidChange; /*! @brief OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param strokeColor @param lineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param looped , polylineNO, polygonYES. */ - (void)renderLinesWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth looped:(BOOL)looped; /*! OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param strokeColor @param lineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param looped , polylineNO, polygonYES. @param lineJoinType @param lineCapType @param lineDash */ - (void)renderLinesWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth looped:(BOOL)looped LineJoinType:(MALineJoinType)lineJoinType LineCapType:(MALineCapType)lineCapType lineDash:(BOOL)lineDash; /*! OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param lineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param textureID - (void)loadStrokeTextureImage:(UIImage *)textureImage; @param looped , polylineNO, polygonYES. */ - (void)renderTexturedLinesWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount lineWidth:(CGFloat)lineWidth textureID:(GLuint)textureID looped:(BOOL)looped; /*! @brief OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param fillColor @param usingTriangleFan YESNO */ - (void)renderRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount fillColor:(UIColor *)fillColor usingTriangleFan:(BOOL)usingTriangleFan; /*! OpenGLES () @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param fillColor @param strokeColor @param strokeLineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param strokeLineJoinType @param strokeLineDash @param usingTriangleFan YESNO strokeLineWidth0 strokeColornil */ - (void)renderStrokedRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount fillColor:(UIColor *)fillColor strokeColor:(UIColor *)strokeColor strokeLineWidth:(CGFloat)strokeLineWidth strokeLineJoinType:(MALineJoinType)strokeLineJoinType strokeLineDash:(BOOL)strokeLineDash usingTriangleFan:(BOOL)usingTriangleFan; /*! @brief OpenGLES () @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param fillColor @param strokeLineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param strokeTexture - (void)loadStrokeTextureImage:(UIImage *)textureImage; @param usingTriangleFan YESNO strokeLineWidth0 strokeTexture0 */ - (void)renderTextureStrokedRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount fillColor:(UIColor *)fillColor strokeTineWidth:(CGFloat)strokeLineWidth strokeTextureID:(GLuint)strokeTexture usingTriangleFan:(BOOL)usingTriangleFan; /*! @brief OpenGLES @param textureID OpenGLESID @param points OpenGLES,, ,- (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count */ - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points; /*! @brief OpenGLES @param textureID OpenGLESID @param points OpenGLES,, ,- (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param modulateColor , = * modulateColor. alpha[red=1, green=1, blue=1, alpha=0.5]. */ - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points modulateColor:(UIColor *)modulateColor; /*! @brief () */ - (void)glRender; #pragma mark - draw property /*! @brief id id - (GLuint)loadStrokeTextureImage:(UIImage *)textureImage; */ @property (nonatomic, readonly) GLuint strokeTextureID; /*! IDstrokeTextureIDnil @param textureImage 2nil @return openGLID, 0 */ - (GLuint)loadStrokeTextureImage:(UIImage *)textureImage; @end @interface MAOverlayView(Deprecated) /*! @brief OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param strokeColor @param lineWidth OpenGLES, - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth @param looped , polylineNO, polygonYES. @param lineDash . */ - (void)renderLinesWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth looped:(BOOL)looped lineDash:(BOOL)lineDash __attribute__ ((deprecated("use - (void)renderLinesWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount strokeColor:(UIColor *)strokeColor lineWidth:(CGFloat)lineWidth looped:(BOOL)looped LineJoinType:(MALineJoinType)lineJoinType LineCapType:(MALineCapType)lineCapType lineDash:(BOOL)lineDash; instead"))); /*! @brief OpenGLES @param points OpenGLES, - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count @param pointCount @param fillColor @param strokeLineWidth @param usingTriangleFan YESGL_TRIANGLE_FAN, NOGL_TRIANGLES */ - (void)renderRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount fillColor:(UIColor *)fillColor strokeLineWidth:(CGFloat)strokeLineWidth usingTriangleFan:(BOOL)usingTriangleFan __attribute__ ((deprecated("use - (void)renderRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount fillColor:(UIColor *)fillColor usingTriangleFan:(BOOL)usingTriangleFan; instead"))); @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOverlayView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
2,337
```objective-c // // MAOfflineItemMunicipality.h // MapKit_static // // Created by songjian on 14-4-23. // #import "MAOfflineCity.h" /* . */ @interface MAOfflineItemMunicipality : MAOfflineCity @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineItemMunicipality.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
58
```objective-c // // MAShape.h // MAMapKit // // // #import <Foundation/Foundation.h> #import "MAAnnotation.h" /*! @brief MAAnnotationMAShape */ @interface MAShape : NSObject <MAAnnotation> { NSString *_title; NSString *_subtitle; } /*! @brief */ @property (copy) NSString *title; /*! @brief */ @property (copy) NSString *subtitle; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAShape.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
88
```objective-c // // MAOfflineProvince.h // MapKit_static // // Created by songjian on 14-4-24. // #import "MAOfflineItem.h" #import "MAOfflineItemCommonCity.h" @interface MAOfflineProvince : MAOfflineItem /* (MAOfflineItemCommonCity). */ @property (nonatomic, strong, readonly) NSArray *cities; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineProvince.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
79
```objective-c // // MAMapKit.h // MAMapKitDemo // // Created by songjian on 12-12-21. // #import "MAMapView.h" #import "MAMapStatus.h" #import "MAGeometry.h" #import "MAAnnotation.h" #import "MAOverlay.h" #import "MACircle.h" #import "MACircleView.h" #import "MAMultiPoint.h" #import "MAOverlayPathView.h" #import "MAOverlayView.h" #import "MAPolygon.h" #import "MAPolygonView.h" #import "MAPolyline.h" #import "MAPolylineView.h" #import "MAGroundOverlay.h" #import "MAGroundOverlayView.h" #import "MATileOverlay.h" #import "MATileOverlayView.h" #import "MAShape.h" #import "MAPinAnnotationView.h" #import "MAAnnotationView.h" #import "MAPointAnnotation.h" #import "MAUserlocation.h" #import "MAMapServices.h" #import "MATouchPoi.h" #import "MAGeodesicPolyline.h" #import "MAHeatMapTileOverlay.h" #import "MAMapURLSearch.h" #import "MAOfflineMap.h" #import "MAOfflineItem.h" #import "MAOfflineCity.h" #import "MAOfflineItemCommonCity.h" #import "MAOfflineItemMunicipality.h" #import "MAOfflineItemNationWide.h" #import "MAOfflineProvince.h" ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapKit.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
302
```objective-c // // MAAnnotation.h // MAMapKit // // Created by yin cai on 11-12-13. // #import <CoreGraphics/CoreGraphics.h> #import <CoreLocation/CoreLocation.h> #import <Foundation/Foundation.h> /*! @brief protocol */ @protocol MAAnnotation <NSObject> /*! @brief view */ @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; @optional /*! @brief annotation @return annotation */ - (NSString *)title; /*! @brief annotation @return annotation */ - (NSString *)subtitle; /** @brief . @param newCoordinate */ - (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAAnnotation.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
144
```objective-c // // MAPolylineView.h // MAMapKit // // // #import <UIKit/UIKit.h> #import "MAPolyline.h" #import "MAOverlayPathView.h" /*! @brief MAPolylineview,MAOverlayPathViewfillstroke attributes */ @interface MAPolylineView : MAOverlayPathView /*! @brief MAPolylineview @param polyline MAPolyline @return View */ - (id)initWithPolyline:(MAPolyline *)polyline; /*! @brief MAPolyline model */ @property (nonatomic, readonly) MAPolyline *polyline; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPolylineView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
128
```objective-c // // MAOfflineItemCommonCity.h // MapKit_static // // Created by songjian on 14-4-23. // #import "MAOfflineCity.h" /* . */ @interface MAOfflineItemCommonCity : MAOfflineCity /*! @brief */ @property (nonatomic, weak) MAOfflineItem *province; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineItemCommonCity.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
73
```objective-c // // MAPolygon.h // MAMapKit // // // #import <Foundation/Foundation.h> #import "MAMultiPoint.h" #import "MAOverlay.h" /*! @brief , , , MAPolygonMAPolygonViewmodel */ @interface MAPolygon : MAMultiPoint <MAOverlay> /*! @brief @param coords ,coords, @param count @return */ + (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count; /*! @brief map point @param points map point,points, @param count @return */ + (instancetype)polygonWithPoints:(MAMapPoint *)points count:(NSUInteger)count; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPolygon.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
147
```objective-c // // MAHeatMapTileOverlay.h // test2D // // Created by xiaoming han on 15/4/21. // #import "MATileOverlay.h" /** * */ @interface MAHeatMapNode : NSObject @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, assign) float intensity; @end /** * */ @interface MAHeatMapGradient : NSObject<NSCopying> @property (nonatomic, readonly) NSArray *colors; // default [blue,green,red] @property (nonatomic, readonly) NSArray *startPoints; // default [@(0.2),@(0.5),@(0,9)] ///gradient MATileOverlayView reloadData . - (instancetype)initWithColor:(NSArray *)colors andWithStartPoints:(NSArray *)startPoints; @end /** * tileOverlay */ @interface MAHeatMapTileOverlay : MATileOverlay @property (nonatomic, strong) NSArray *data; // MAHeatMapNode array @property (nonatomic, assign) NSInteger radius; // 12, :0-100 screen point @property (nonatomic, assign) CGFloat opacity; // 0.6,:0-1 @property (nonatomic, strong) MAHeatMapGradient *gradient; @property (nonatomic, assign) BOOL allowRetinaAdapting; // @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAHeatMapTileOverlay.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
273
```objective-c // // MAGroundOverlayView.h // MapKit_static // // Created by Li Fei on 11/13/13. // #import "MAOverlayView.h" #import "MAGroundOverlay.h" /*! @brief MAGroundOverlayview; */ @interface MAGroundOverlayView : MAOverlayView /*! @brief groundOverlay */ @property (nonatomic ,readonly) MAGroundOverlay *groundOverlay; /*! @brief GroundOverlayView @param groundOverlay groundOverlay @return GroundOverlayView */ - (id)initWithGroundOverlay:(MAGroundOverlay *)groundOverlay; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAGroundOverlayView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
125
```objective-c // // MAPolyline.h // MAMapKit // // // #import "MAMultiPoint.h" #import "MAOverlay.h" /*! @brief , MAPolylineMAPolylineViewmodel */ @interface MAPolyline : MAMultiPoint <MAOverlay> /*! @brief map point @param points map point,points, @param count map point @return */ + (instancetype)polylineWithPoints:(MAMapPoint *)points count:(NSUInteger)count; /*! @brief @param coords ,coords, @param count @return */ + (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPolyline.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
146
```objective-c // // MALineDrawType.h // MapKit_static // // Created by yi chen on 14-7-30. // #ifndef MapKit_static_MALineDrawType_h #define MapKit_static_MALineDrawType_h enum MALineJoinType { kMALineJoinBevel, kMALineJoinMiter, kMALineJoinRound }; typedef enum MALineJoinType MALineJoinType; enum MALineCapType { kMALineCapButt, kMALineCapSquare, kMALineCapArrow, kMALineCapRound }; typedef enum MALineCapType MALineCapType; #endif ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MALineDrawType.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
147
```objective-c // // MAOverlayPathView.h // MAMapKit // // // #import <UIKit/UIKit.h> #import "MAOverlayView.h" /*! @brief CGPathRefoverlay,fill attributes, stroke attributesCAShapeLayer, MACircleView, MAPolylineView, MAPolygonView, -(void)createPath */ @interface MAOverlayPathView : MAOverlayView /*! @brief ,kMAOverlayViewDefaultFillColor */ @property (retain) UIColor *fillColor; /*! @brief ,kMAOverlayViewDefaultStrokeColor */ @property (retain) UIColor *strokeColor; /*! @brief ,0 */ @property CGFloat lineWidth; /*! @brief LineJoin,kMALineJoinBevel */ @property MALineJoinType lineJoinType; /*! @brief LineCap,kMALineCapButt */ @property MALineCapType lineCapType; /*! @brief MiterLimit,10.f */ @property CGFloat miterLimit; /*! @brief , NO */ @property BOOL lineDash; #pragma mark - Deprecated /*! @brief LineJoin,kCGLineJoinRound */ @property CGLineJoin lineJoin __attribute__ ((deprecated("not workable. use lineJoinType"))); /*! @brief LineCap,kCGLineCapRound */ @property CGLineCap lineCap __attribute__ ((deprecated("not workable. use lineCapType"))); /*! @brief LineDashPhase,0.f */ @property CGFloat lineDashPhase __attribute__ ((deprecated("not workable"))); /*! @brief LineDashPattern,nil */ @property (copy) NSArray *lineDashPattern __attribute__ ((deprecated("not workable"))); /*! @brief (self.path = newPath) */ - (void)createPath __attribute__ ((deprecated("not workable"))); /*! @brief path */ @property CGPathRef path __attribute__ ((deprecated("not workable"))); /*! @brief path, path == NULL */ - (void)invalidatePath __attribute__ ((deprecated("not workable"))); /*! @brief stroke attributescontext @param context context @param zoomScale */ - (void)applyStrokePropertiesToContext:(CGContextRef)context atZoomScale:(CGFloat)zoomScale __attribute__ ((deprecated("not workable"))); /*! @brief fill attributescontext @param context context @param zoomScale */ - (void)applyFillPropertiesToContext:(CGContextRef)context atZoomScale:(CGFloat)zoomScale __attribute__ ((deprecated("not workable"))); /*! @brief path @param path path @param context context */ - (void)strokePath:(CGPathRef)path inContext:(CGContextRef)context __attribute__ ((deprecated("not workable"))); /*! @brief path @param path path @param context context */ - (void)fillPath:(CGPathRef)path inContext:(CGContextRef)context __attribute__ ((deprecated("not workable"))); @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOverlayPathView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
603
```objective-c // // MATouchPoi.h // MapKit_static // // Created by songjian on 13-7-17. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> @interface MATouchPoi : NSObject /*! @brief */ @property (nonatomic, copy, readonly) NSString *name; /*! @brief */ @property (nonatomic, assign, readonly) CLLocationCoordinate2D coordinate; /*! @brief poiID */ @property (nonatomic, copy, readonly) NSString *uid; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MATouchPoi.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
110
```objective-c // // MAMapURLSearchType.h // MAMapKitNew // // Created by xiaoming han on 15/5/25. // #ifndef MAMapKitNew_MAMapURLSearchType_h #define MAMapKitNew_MAMapURLSearchType_h /// typedef NS_ENUM(NSInteger, MADrivingStrategy) { MADrivingStrategyFastest = 0, // MADrivingStrategyMinFare = 1, // MADrivingStrategyShortest = 2, // MADrivingStrategyNoHighways = 3, // MADrivingStrategyAvoidCongestion = 4, // MADrivingStrategyAvoidHighwaysAndFare = 5, // MADrivingStrategyAvoidHighwaysAndCongestion = 6, // MADrivingStrategyAvoidFareAndCongestion = 7, // MADrivingStrategyAvoidHighwaysAndFareAndCongestion = 8 // }; /// typedef NS_ENUM(NSInteger, MATransitStrategy) { MATransitStrategyFastest = 0,// MATransitStrategyMinFare = 1,// MATransitStrategyMinTransfer = 2,// MATransitStrategyMinWalk = 3,// MATransitStrategyMostComfortable = 4,// MATransitStrategyAvoidSubway = 5,// }; /// typedef NS_ENUM(NSInteger, MARouteSearchType) { MARouteSearchTypeDriving = 0, // MARouteSearchTypeTransit = 1, // MARouteSearchTypeWalking = 2, // }; #endif ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapURLSearchType.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
358
```objective-c // // MAOfflineItemNationWide.h // MapKit_static // // Created by songjian on 14-4-23. // #import "MAOfflineCity.h" /* . */ @interface MAOfflineItemNationWide : MAOfflineCity @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineItemNationWide.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
56
```objective-c // // MATileOverlayView.h // MapKit_static // // Created by Li Fei on 11/25/13. // #import "MAOverlayView.h" #import "MATileOverlay.h" /*! @brief MAOverlayViewtilesview; */ @interface MATileOverlayView : MAOverlayView /*! @brief tiles */ @property (nonatomic ,readonly) MATileOverlay *tileOverlay; /*! @brief tileOverlaytilesView @param tileOverlay groundOverlay @return tileOverlayView */ - (id)initWithTileOverlay:(MATileOverlay *)tileOverlay; /** * tileoverlay */ - (void)reloadData; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MATileOverlayView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
138
```objective-c // // MAOfflineMap.h // // #import <Foundation/Foundation.h> #import "MAOfflineProvince.h" #import "MAOfflineItemNationWide.h" #import "MAOfflineItemMunicipality.h" typedef NS_ENUM(NSInteger, MAOfflineMapDownloadStatus) { MAOfflineMapDownloadStatusWaiting, /* . */ MAOfflineMapDownloadStatusStart, /* . */ MAOfflineMapDownloadStatusProgress, /* . */ MAOfflineMapDownloadStatusCompleted, /* . */ MAOfflineMapDownloadStatusCancelled, /* . */ MAOfflineMapDownloadStatusUnzip, /* . */ MAOfflineMapDownloadStatusFinished, /* . */ MAOfflineMapDownloadStatusError /* . */ }; /* domain. */ extern NSString * const MAOfflineMapErrorDomain; typedef NS_ENUM(NSInteger, MAOfflineMapError) { /* . */ MAOfflineMapErrorUnknown = -1, /* . */ MAOfflineMapErrorCannotWriteToTmp = -2, /* . */ MAOfflineMapErrorCannotOpenZipFile = -3, /* . */ MAOfflineMapErrorCannotExpand = -4 }; /* downloadStatus == MAOfflineMapDownloadStatusProgress , infoNSDictionary, key(byte), NSNumber(long long) . */ extern NSString * const MAOfflineMapDownloadReceivedSizeKey; extern NSString * const MAOfflineMapDownloadExpectedSizeKey; typedef void(^MAOfflineMapDownloadBlock)(MAOfflineItem * downloadItem, MAOfflineMapDownloadStatus downloadStatus, id info); typedef void(^MAOfflineMapNewestVersionBlock)(BOOL hasNewestVersion); @interface MAOfflineMap : NSObject /*! @brief MAOfflineMap @return MAOfflineMap */ + (MAOfflineMap *)sharedOfflineMap; /*! @brief (MAOfflineProvince) */ @property (nonatomic, readonly) NSArray *provinces; /*! @brief (MAOfflineItemMunicipality) */ @property (nonatomic, readonly) NSArray *municipalities; /*! @brief */ @property (nonatomic, readonly) MAOfflineItemNationWide *nationWide; /*! @brief , . */ @property (nonatomic, readonly) NSArray *cities; /*! @brief (, @"20130715") */ @property (nonatomic, readonly) NSString *version; /*! @brief @param item @prarm shouldContinueWhenAppEntersBackground @param downloadBlock block */ - (void)downloadItem:(MAOfflineItem *)item shouldContinueWhenAppEntersBackground:(BOOL)shouldContinueWhenAppEntersBackground downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock; /*! @brief @param item @return */ - (BOOL)isDownloadingForItem:(MAOfflineItem *)item; /*! @brief @param item */ - (void)pauseItem:(MAOfflineItem *)item; /*! @brief item @param item */ - (void)deleteItem:(MAOfflineItem *)item; /*! @brief */ - (void)cancelAll; /*! @brief , [mapView reloadMap]. */ - (void)clearDisk; /*! @brief @param newestVersionBlock block */ - (void)checkNewestVersion:(MAOfflineMapNewestVersionBlock)newestVersionBlock; @end @interface MAOfflineMap (Deprecated) /*! @brief (MAOfflineCity) */ @property (nonatomic, readonly) NSArray *offlineCities __attribute__ ((deprecated("use cities instead"))); /*! @brief () @param city @param downloadBlock block */ - (void)downloadCity:(MAOfflineCity *)city downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock __attribute__ ((deprecated("use - (void)downloadItem:(MAOfflineItem *)item shouldContinueWhenAppEntersBackground:(BOOL)shouldContinueWhenAppEntersBackground downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock instead"))); /*! @brief @param city @prarm shouldContinueWhenAppEntersBackground @param downloadBlock block */ - (void)downloadCity:(MAOfflineCity *)city shouldContinueWhenAppEntersBackground:(BOOL)shouldContinueWhenAppEntersBackground downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock __attribute__ ((deprecated("use - (void)downloadItem:(MAOfflineItem *)item shouldContinueWhenAppEntersBackground:(BOOL)shouldContinueWhenAppEntersBackground downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock instead"))); /*! @brief @param city @return */ - (BOOL)isDownloadingForCity:(MAOfflineCity *)city __attribute__ ((deprecated("use - (BOOL)isDownloadingForItem:(MAOfflineItem *)item instead"))); /*! @brief @param city */ - (void)pause:(MAOfflineCity *)city __attribute__ ((deprecated("use - (void)pauseItem:(MAOfflineItem *)item instead"))); @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineMap.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,005
```objective-c // // MAMapStatus.h // MapKit_static // // Created by yi chen on 1/27/15. // #import <UIKit/UIKit.h> #import <CoreLocation/CLLocation.h> @interface MAMapStatus : NSObject /*! @brief */ @property (nonatomic) CLLocationCoordinate2D centerCoordinate; /*! @brief */ @property (nonatomic) CGFloat zoomLevel; /*! @brief () */ @property (nonatomic) CGFloat rotationDegree; /*! @brief ([0.f, 45.f]) */ @property (nonatomic) CGFloat cameraDegree; /*! @brief (0, 0)MAMapView(1, 1)(0.5, 0.5) */ @property (nonatomic) CGPoint screenAnchor; /*! @brief status @param coordinate @param zoomLevel @param rotationDegree () @param cameraDegree ([0.f, 45.f]) @param screenAnchor (0, 0)MAMapView(1, 1)(0.5, 0.5) @return Status */ + (instancetype)statusWithCenterCoordinate:(CLLocationCoordinate2D)coordinate zoomLevel:(CGFloat)zoomLevel rotationDegree:(CGFloat)rotationDegree cameraDegree:(CGFloat)cameraDegree screenAnchor:(CGPoint)screenAnchor; /*! @brief status @param coordinate @param zoomLevel @param rotationDegree () @param cameraDegree ([0.f, 45.f]) @param screenAnchor (0, 0)MAMapView(1, 1)(0.5, 0.5) @return Status */ - (id)initWithCenterCoordinate:(CLLocationCoordinate2D)coordinate zoomLevel:(CGFloat)zoomLevel rotationDegree:(CGFloat)rotationDegree cameraDegree:(CGFloat)cameraDegree screenAnchor:(CGPoint)screenAnchor; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapStatus.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
387
```objective-c // // MAPointAnnotation.h // MAMapKitDemo // // Created by songjian on 13-1-7. // #import "MAShape.h" #import <CoreLocation/CLLocation.h> /*! @brief */ @interface MAPointAnnotation : MAShape /*! @brief */ @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAPointAnnotation.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
78
```objective-c // // MAUserLocation.h // MAMapKit // // Created by yin cai on 12-1-4. // #import <Foundation/Foundation.h> #import "MAAnnotation.h" @class CLLocation; @class CLHeading; /*! @brief */ @interface MAUserLocation : NSObject<MAAnnotation> /*! @brief YES */ @property (readonly, nonatomic, getter = isUpdating) BOOL updating; /*! @brief MAMapViewshowsUserLocationNOnil */ @property (readonly, nonatomic, retain) CLLocation *location; /*! @brief heading */ @property (readonly, nonatomic, retain) CLHeading *heading; /*! @brief */ @property (nonatomic, copy) NSString *title; /*! @brief . */ @property (nonatomic, copy) NSString *subtitle; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAUserLocation.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
165
```objective-c // // MATileOverlay.h // MapKit_static // // Created by Li Fei on 11/22/13. // #import "MAOverlay.h" /*! @brief tiles */ @interface MATileOverlay : NSObject <MAOverlay> /*! @brief URLTemplatetileOverlay @param URLTemplate"{x}","{y}","{z}","{scale}","{x}","{y}","{z}","{scale}"tile pathtileURL path_to_url{x}&y={y}&z={z}&scale={scale} @return URLTemplatetileOverlay */ - (id)initWithURLTemplate:(NSString *)URLTemplate; /*! @brief tileSize 256x256 */ @property (readonly) CGSize tileSize; /*! @brief tileOverlayZoom */ @property NSInteger minimumZ; /*! @brief tileOverlayZoom */ @property NSInteger maximumZ; /*! @brief initWithURLTemplate:URLTemplate */ @property (readonly) NSString *URLTemplate; /*! @brief */ @property (nonatomic) BOOL canReplaceMapContent; /*! @brief tileOverlay */ @property (nonatomic) MAMapRect boundingMapRect; @end typedef struct { NSInteger x; NSInteger y; NSInteger z; CGFloat contentScaleFactor; } MATileOverlayPath; /*! @brief CustomLoadingMKTileOverlay */ @interface MATileOverlay (CustomLoading) /*! @brief tile pathURLtile,URLTemplate @param tile path @return tile pathtileOverlay */ - (NSURL *)URLForTilePath:(MATileOverlayPath)path; /*! @brief tile,tiletileerrorblock;URLForTilePathURL,NSURLConnectiontile @param tile path @param tiletileerrorblock */ - (void)loadTileAtPath:(MATileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MATileOverlay.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
393
```objective-c // // MAOfflineItem.h // MapKit_static // // Created by songjian on 14-4-23. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, MAOfflineItemStatus) { MAOfflineItemStatusNone = 0, /* . */ MAOfflineItemStatusCached, /* . */ MAOfflineItemStatusInstalled, /* . */ MAOfflineItemStatusExpired /* . */ }; @interface MAOfflineItem : NSObject /* . */ @property (nonatomic, copy, readonly) NSString *name; /* . */ @property (nonatomic, copy, readonly) NSString *jianpin; /* . */ @property (nonatomic, copy, readonly) NSString *pinyin; /* . */ @property (nonatomic, copy, readonly) NSString *adcode; /* . */ @property (nonatomic, assign, readonly) long long size; /* . */ @property (nonatomic, assign, readonly) MAOfflineItemStatus itemStatus; /* (itemStatus == MAOfflineItemStatusCached ). */ @property (nonatomic, assign, readonly) long long downloadedSize; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAOfflineItem.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
226
```objective-c // // MACircle.h // MAMapKit // // // #import "MAShape.h" #import "MAOverlay.h" #import "MAGeometry.h" /*! @brief , MACircleMACircleViewmodel */ @interface MACircle : MAShape <MAOverlay> { @package CLLocationCoordinate2D _coordinate; CLLocationDistance _radius; MAMapRect _boundingMapRect; } /*! @brief @param coord @param radius @return */ + (instancetype)circleWithCenterCoordinate:(CLLocationCoordinate2D)coord radius:(CLLocationDistance)radius; /*! @brief map rect @param mapRect @return */ + (instancetype)circleWithMapRect:(MAMapRect)mapRect; /*! @brief */ @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; /*! @brief */ @property (nonatomic, readonly) CLLocationDistance radius; /*! @brief map rect */ @property (nonatomic, readonly) MAMapRect boundingMapRect; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MACircle.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
216
```objective-c // // MACircleView.h // MAMapKit // // Created by yin cai on 11-12-30. // #import "MACircle.h" #import "MAOverlayPathView.h" /*! @brief MACircleview,MAOverlayPathViewfillstroke attributes */ @interface MACircleView : MAOverlayPathView /*! @brief View @param circle MACircle model @return View */ - (id)initWithCircle:(MACircle *)circle; /*! @brief MAcirlce model */ @property (nonatomic, readonly) MACircle *circle; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MACircleView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
125
```objective-c // // MAGroundOverlay.h // MapKit_static // // Created by Li Fei on 11/12/13. // #import <UIKit/UIKit.h> #import "MAShape.h" #import "MAOverlay.h" /*! @brief , MAGroundOverlayMAGroundOverlayViewmodel */ @interface MAGroundOverlay : MAShape<MAOverlay> /*! @brief */ @property (nonatomic, readonly) UIImage *icon; /*! @brief . = * alpha. [0.f, 1.f], 1.f */ @property (nonatomic) CGFloat alpha; /*! @brief zoom */ @property (nonatomic, readonly) CGFloat zoomLevel; /*! @brief */ @property (nonatomic, readonly) MACoordinateBounds bounds; /*! @brief boundsiconGroundOverlay @param bounds @param icon @return boundsicon GroundOverlay */ + (instancetype)groundOverlayWithBounds:(MACoordinateBounds)bounds icon:(UIImage *)icon; /*! @brief coordinate,icon,zoomLevelGroundOverlay @param coordinate @param zoomLevel zoom @param icon @return coordinate,icon,zoomLevel GroundOverlay */ + (instancetype)groundOverlayWithCoordinate:(CLLocationCoordinate2D)coordinate zoomLevel:(CGFloat)zoomLevel icon:(UIImage *)icon; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAGroundOverlay.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
273
```objective-c // // MAMultiPoint.h // MAMapKit // // // #import <Foundation/Foundation.h> #import "MAShape.h" #import "MAGeometry.h" /*! @brief , , MAPolyline,MAPolygon */ @interface MAMultiPoint : MAShape { @package MAMapPoint *_points; NSUInteger _pointCount; MAMapRect _boundingRect; } /*! @brief */ @property (nonatomic, readonly) MAMapPoint *points; /*! @brief */ @property (nonatomic, readonly) NSUInteger pointCount; /*! @brief coords @param coords , range.length @param range */ - (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMultiPoint.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
160
```objective-c // // MAMapServices.h // MapKit_static // // Created by AutoNavi. // #import <Foundation/Foundation.h> @interface MAMapServices : NSObject + (MAMapServices *)sharedServices; /// API Key, MAMapViewkey. @property (nonatomic, copy) NSString *apiKey; /// SDK , v3.0.0 @property (nonatomic, readonly) NSString *SDKVersion; /** * YES * SDKSDK * NSUncaughtExceptionHandlerAPPSDKNSUncaughtExceptionHandlerMAMapServicesNSUncaughtExceptionHandlerhandlerhandlerhandler */ @property (nonatomic, assign) BOOL crashReportEnabled; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapServices.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
140
```objective-c // // MAMapURLSearchConfig.h // MAMapKitNew // // Created by xiaoming han on 15/5/25. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> #import "MAMapURLSearchType.h" /// @interface MANaviConfig : NSObject /// Scheme @property (nonatomic, copy) NSString *appScheme; /// @property (nonatomic, copy) NSString *appName; /// @property (nonatomic, assign) CLLocationCoordinate2D destination; /// @property (nonatomic, assign) MADrivingStrategy strategy; @end #pragma mark - /// @interface MARouteConfig : NSObject /// Scheme @property (nonatomic, copy) NSString *appScheme; /// @property (nonatomic, copy) NSString *appName; /// @property (nonatomic, assign) CLLocationCoordinate2D startCoordinate; /// @property (nonatomic, assign) CLLocationCoordinate2D destinationCoordinate; /// @property (nonatomic, assign) MADrivingStrategy drivingStrategy; /// @property (nonatomic, assign) MATransitStrategy transitStrategy; /// @property (nonatomic, assign) MARouteSearchType routeType; @end #pragma mark - /// POI @interface MAPOIConfig : NSObject /// Scheme @property (nonatomic, copy) NSString *appScheme; /// @property (nonatomic, copy) NSString *appName; /// @property (nonatomic, copy) NSString *keywords; /// @property (nonatomic, assign) CLLocationCoordinate2D leftTopCoordinate; /// @property (nonatomic, assign) CLLocationCoordinate2D rightBottomCoordinate; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapURLSearchConfig.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
325
```objective-c // // AMapSearchError.h // AMapSearchKit // // Created by xiaoming han on 15/7/29. // #ifndef AMapSearchKit_AMapSearchError_h #define AMapSearchKit_AMapSearchError_h /** AMapSearch errorDomain */ extern NSString * const AMapSearchErrorDomain; /** AMapSearch errorCode */ typedef NS_ENUM(NSInteger, AMapSearchErrorCode) { AMapSearchErrorOK = 0, //!< AMapSearchErrorUnknown = 1, //!< AMapSearchErrorInvalidSCode = 2, //!< AMapSearchErrorInvalidKey = 3, //!< key AMapSearchErrorInvalidService = 4, //!< AMapSearchErrorInvalidResponse = 5, //!< AMapSearchErrorInsufficientPrivileges = 6, //!< AMapSearchErrorOverQuota = 7, //!< AMapSearchErrorInvalidParams = 8, //!< AMapSearchErrorInvalidProtocol = 9, //!< AMapSearchErrorKeyNotMatch = 10, //!< key AMapSearchErrorTooFrequently = 11, //!< AMapSearchErrorInvalidUserIp = 12, //!< ip AMapSearchErrorInvalidUserSignature = 13, //!< AMapSearchErrorShortAddressFailed = 14, //!< AMapSearchErrorInvalidUserID = 30, //!< userID AMapSearchErrorKeyNotBind = 31, //!< key AMapSearchErrorNotSupportHttps = 32, //!< HTTPS AMapSearchErrorServiceMaintenance = 33, //!< AMapSearchErrorInvalidAccount = 34, //!< AMapSearchErrorCancelled = 100, //!< AMapSearchErrorTimeOut = 101, //!< AMapSearchErrorCannotFindHost = 102, //!< AMapSearchErrorBadURL = 103, //!< URL AMapSearchErrorNotConnectedToInternet = 104, //!< AMapSearchErrorCannotConnectToHost = 105, //!< }; #endif ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapSearchError.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
479
```objective-c // // AMapNearbySearchManager.h // AMapSearchKit // // Created by xiaoming han on 15/8/31. // #import <Foundation/Foundation.h> #import "AMapSearchError.h" @class AMapNearbySearchManager; @class AMapNearbyUploadInfo; /// @protocol AMapNearbySearchManagerDelegate <NSObject> @optional /* * */ - (AMapNearbyUploadInfo *)nearbyInfoForUploading:(AMapNearbySearchManager *)manager; /** * * * @param error */ - (void)onNearbyInfoUploadedWithError:(NSError *)error; /** * * * @param error */ - (void)onUserInfoClearedWithError:(NSError *)error; @end /// @interface AMapNearbySearchManager : NSObject /** * manager. * * `AMapSearchServices` APIKey. * * @return nearbySearch */ + (instancetype)sharedInstance; /// - (instancetype)init __attribute__((unavailable)); /// 15s7s @property (nonatomic, assign) NSTimeInterval uploadTimeInterval; /// @property (nonatomic, weak) id<AMapNearbySearchManagerDelegate> delegate; /// @property (nonatomic, readonly) BOOL isAutoUploading; /** * */ - (void)startAutoUploadNearbyInfo; /** * */ - (void)stopAutoUploadNearbyInfo; /** * uploadTimeInterval * * @param info * * @return YESNO */ - (BOOL)uploadNearbyInfo:(AMapNearbyUploadInfo *)info; /** * * * @param userID ID * * @return YESNO */ - (BOOL)clearUserInfoWithID:(NSString *)userID; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapNearbySearchManager.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
377
```objective-c // // AMapSearchKit.h // AMapSearchKit // // Created by xiaoming han on 15/7/22. // #import <AMapSearchKit/AMapSearchAPI.h> #import <AMapSearchKit/AMapSearchObj.h> #import <AMapSearchKit/AMapCommonObj.h> #import <AMapSearchKit/AMapSearchError.h> #import <AMapSearchKit/AMapSearchServices.h> #import <AMapSearchKit/AMapNearbySearchManager.h> #import <AMapSearchKit/AMapNearbyUploadInfo.h> ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapSearchKit.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
130
```objective-c // // AMapSearchServices.h // AMapSearchKit // // Created by xiaoming han on 15/6/18. // #import <Foundation/Foundation.h> @interface AMapSearchServices : NSObject + (AMapSearchServices *)sharedServices; /// API Key, key. @property (nonatomic, copy) NSString *apiKey; /// SDK , v3.0.0 @property (nonatomic, readonly) NSString *SDKVersion; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapSearchServices.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
98
```objective-c // // MAMapView.h // MAMapKitDemo // // Created by songjian on 12-12-21. // #import <UIKit/UIKit.h> #import "MAOverlay.h" #import "MAOverlayView.h" #import "MAAnnotationView.h" #import "MAAnnotation.h" #import "MAMapStatus.h" /** * MAMapView layer , , , . CABasicAnimation, CAKeyframeAnimation. * * *************************************************** * * * CAMediaTimingFunction : * 1> kCAMediaTimingFunctionLinear (default) * 2> kCAMediaTimingFunctionEaseIn * 3> kCAMediaTimingFunctionEaseOut * 4> kCAMediaTimingFunctionEaseInEaseOut * * CAAnimation : * 1> duration * 2> timingFunction * 3> delegate * * CAPropertyAnimation : * 1> keyPath * * CABasicAnimation : * 1> fromValue * 2> toValue * * CAKeyframeAnimation : * 1> values * 2> keyTimes * 3> timingFunctions * * ***************************************************** * Add CABasicAnimation Example: * * CLLocationCoordinate2D toCoordiante = CLLocationCoordinate2DMake(39.989870, 116.480940); * CABasicAnimation *centerAnimation = [CABasicAnimation animationWithKeyPath:kMAMapLayerCenterMapPointKey]; * centerAnimation.duration = 3.f; * centerAnimation.toValue = [NSValue valueWithMAMapPoint:MAMapPointForCoordinate(toCoordiante)]; * centerAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; * [mapView.layer addAnimation:centerAnimation forKey:kMAMapLayerCenterMapPointKey]; * * Add CAKeyframeAnimation Example: * * CAKeyframeAnimation *zoomLevelAnimation = [CAKeyframeAnimation animationWithKeyPath:kMAMapLayerZoomLevelKey]; * zoomLevelAnimation.duration = 3.f; * zoomLevelAnimation.values = @[@(15), @(12), @(18)]; * zoomLevelAnimation.keyTimes = @[@(0.f), @(0.4f), @(1.f)]; * [mapView.layer addAnimation:zoomLevelAnimation forKey:kMAMapLayerZoomLevelKey]; * * Remove animation Example: * [mapView.layer removeAnimationForKey:kMAMapLayerZoomLevelKey]; * **/ /*! @brief (MAMapPoint)key, [NSValue valueWithMAMapPoint:]. */ extern NSString * const kMAMapLayerCenterMapPointKey; /*! @brief key, [minZoomLevel, maxZoomLevel], NSNumber. */ extern NSString * const kMAMapLayerZoomLevelKey; /*! @brief key, [0, 360), NSNumber. */ extern NSString * const kMAMapLayerRotationDegreeKey; /*! @brief , [0, 45], NSNumber. */ extern NSString * const kMAMapLayerCameraDegreeKey; typedef NS_ENUM(NSInteger, MAMapType) { MAMapTypeStandard = 0, // MAMapTypeSatellite, // MAMapTypeStandardNight // }; typedef NS_ENUM(NSInteger, MAUserTrackingMode) { MAUserTrackingModeNone = 0, // location MAUserTrackingModeFollow = 1, // location MAUserTrackingModeFollowWithHeading = 2 // locationheading }; @class MAUserLocation; @class MATouchPoi; @class MACircle; @protocol MAMapViewDelegate; /*! @brief view */ @interface MAMapView : UIView /*! @brief */ @property (nonatomic, assign) id <MAMapViewDelegate> delegate; /*! @brief */ @property (nonatomic) MAMapType mapType; /*! @brief logo, mapView.bounds */ @property (nonatomic) CGPoint logoCenter; /*! @brief logo */ @property (nonatomic, readonly) CGSize logoSize; /*! @brief */ @property (nonatomic, assign, getter = isShowsLabels) BOOL showsLabels; /*! @brief */ @property (nonatomic, getter = isShowTraffic) BOOL showTraffic; /*! @brief YES */ @property (nonatomic, getter = isShowsBuildings) BOOL showsBuildings; /*! @brief */ @property (nonatomic, getter = isZoomEnabled) BOOL zoomEnabled; /*! @brief */ @property (nonatomic, getter = isScrollEnabled) BOOL scrollEnabled; /*! @brief */ @property (nonatomic, getter = isRotateEnabled) BOOL rotateEnabled; /*! @brief POI(YES) - (void)mapView:(MAMapView *)mapView didTouchPois:(NSArray *)pois */ @property (nonatomic) BOOL touchPOIEnabled; /*! @brief () */ @property (nonatomic) CGFloat rotationDegree; /*! @brief YES. annotation */ @property (nonatomic, getter = isSkyModelEnabled) BOOL skyModelEnable; /*! @brief () @param animated @param duration */ - (void)setRotationDegree:(CGFloat)rotationDegree animated:(BOOL)animated duration:(CFTimeInterval)duration; /*! @brief ([0.f, 60.f]4016) @param cameraDegree */ @property (nonatomic) CGFloat cameraDegree; - (void)setCameraDegree:(CGFloat)cameraDegree animated:(BOOL)animated duration:(CFTimeInterval)duration; /*! @brief camera */ @property (nonatomic, getter = isRotateCameraEnabled) BOOL rotateCameraEnabled; /*! @brief */ @property (nonatomic, assign) BOOL showsCompass; /*! @brief */ @property (nonatomic) CGPoint compassOrigin; /*! @brief */ @property (nonatomic, readonly) CGSize compassSize; /*! @brief */ - (void)setCompassImage:(UIImage *)image; /*! @brief */ @property (nonatomic) BOOL showsScale; /*! @brief */ @property (nonatomic) CGPoint scaleOrigin; /*! @brief */ @property (nonatomic, readonly) CGSize scaleSize; /*! @brief */ @property (nonatomic, readonly) CGSize indoorMapControlSize; /*! @brief */ @property (nonatomic, getter = isShowsIndoorMap) BOOL showsIndoorMap; /*! @brief */ - (void)clearIndoorMapCache; /*! @brief */ - (void)setIndoorMapControlOrigin:(CGPoint)origin; /*! @brief , , 1 screen point (). @return () */ - (double)metersPerPointForCurrentZoomLevel; /*! @brief , , 1 screen point (). @param zoomLevel , [minZoomLevel, maxZoomLevel]. @return () */ - (double)metersPerPointForZoomLevel:(CGFloat)zoomLevel; /*! @brief */ @property (nonatomic) MACoordinateRegion region; - (void)setRegion:(MACoordinateRegion)region animated:(BOOL)animated; /*! @brief */ @property (nonatomic) CLLocationCoordinate2D centerCoordinate; - (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated; /*! @brief @param animated @param duration 0.35s */ - (void)setMapStatus:(MAMapStatus *)status animated:(BOOL)animated; - (void)setMapStatus:(MAMapStatus *)status animated:(BOOL)animated duration:(CFTimeInterval)duration; - (MAMapStatus *)getMapStatus; /*! @brief frameregion @param region @return */ - (MACoordinateRegion)regionThatFits:(MACoordinateRegion)region; /*! @brief */ @property (nonatomic) MAMapRect visibleMapRect; - (void)setVisibleMapRect:(MAMapRect)mapRect animated:(BOOL)animated; /*! @brief */ @property (nonatomic) CGFloat zoomLevel; - (void)setZoomLevel:(CGFloat)zoomLevel animated:(BOOL)animated; /*! @brief @param zoomLevel @param pivot (view) @param animated */ - (void)setZoomLevel:(CGFloat)zoomLevel atPivot:(CGPoint)pivot animated:(BOOL)animated; /*! @brief */ @property (nonatomic, readonly) CGFloat minZoomLevel; /*! @brief */ @property (nonatomic, readonly) CGFloat maxZoomLevel; /*! @brief @param mapRect @return */ - (MAMapRect)mapRectThatFits:(MAMapRect)mapRect; /*! @brief frame @param mapRect @return */ - (void)setVisibleMapRect:(MAMapRect)mapRect edgePadding:(UIEdgeInsets)insets animated:(BOOL)animate; /*! @brief @param mapRect @param insets @return */ - (MAMapRect)mapRectThatFits:(MAMapRect)mapRect edgePadding:(UIEdgeInsets)insets; /*! @brief view @param coordinate @param view view @return view */ - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view; /*! @brief view @param point view @param view view @return */ - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view; /*! @brief regionviewrect @param region region @param view view @return viewrect */ - (CGRect)convertRegion:(MACoordinateRegion)region toRectToView:(UIView *)view; /*! @brief viewrectregion @param rect viewrect @param view view @return region */ - (MACoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view; /*! @brief */ @property (nonatomic) BOOL showsUserLocation; /*! @brief */ @property (nonatomic, readonly) MAUserLocation *userLocation; /*! @brief (userLocationAccuracyCircle) view, NO. YES: - (MAOverlayView *)mapView:(MAMapView *)mapView viewForOverlay:(id <MAOverlay>)overlay nil, . NO : . */ @property (nonatomic) BOOL customizeUserLocationAccuracyCircleRepresentation; /*! @brief overlay. */ @property (nonatomic, readonly) MACircle *userLocationAccuracyCircle; /*! @brief */ @property (nonatomic) MAUserTrackingMode userTrackingMode; - (void)setUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated; /*! @brief */ @property (nonatomic, readonly, getter=isUserLocationVisible) BOOL userLocationVisible; /*! @brief MAMapViewDelegate-mapView:viewForAnnotation:View @param annotation */ - (void)addAnnotation:(id <MAAnnotation>)annotation; /*! @brief MAMapViewDelegate-mapView:viewForAnnotation:View @param annotations */ - (void)addAnnotations:(NSArray *)annotations; /*! @brief @param annotation */ - (void)removeAnnotation:(id <MAAnnotation>)annotation; /*! @brief @param annotation */ - (void)removeAnnotations:(NSArray *)annotations; /*! @brief */ @property (nonatomic, readonly) NSArray *annotations; /*! @brief @param mapRect @return */ - (NSSet *)annotationsInMapRect:(MAMapRect)mapRect; /*! @brief view @param annotation @return view */ - (MAAnnotationView *)viewForAnnotation:(id <MAAnnotation>)annotation; /*! @brief annotation view @param identifier @return annotation view */ - (MAAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:(NSString *)identifier; /*! @brief view @param annotation @param animated */ - (void)selectAnnotation:(id <MAAnnotation>)annotation animated:(BOOL)animated; /*! @brief view @param annotation @param animated */ - (void)deselectAnnotation:(id <MAAnnotation>)annotation animated:(BOOL)animated; /*! @brief (count == 0 1) */ @property (nonatomic, copy) NSArray *selectedAnnotations; /*! @brief annotation */ @property (nonatomic, readonly) CGRect annotationVisibleRect; /*! annotation, annotation @param annotations annotation @param animated */ - (void)showAnnotations:(NSArray *)annotations animated:(BOOL)animated; /** * annotation, annotation * * @param annotations annotation * @param insets insets * @param animated */ - (void)showAnnotations:(NSArray *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated; @end /*! @brief overlay */ typedef NS_ENUM(NSInteger, MAOverlayLevel) { MAOverlayLevelAboveRoads = 0, // overlay MAOverlayLevelAboveLabels // overlay }; /*! @brief viewoverlay */ @interface MAMapView (OverlaysAPI) /*! @brief Overlay */ @property (nonatomic, readonly) NSArray *overlays; /*! @brief leveloverlays */ - (NSArray *)overlaysInLevel:(MAOverlayLevel)level; /*! @brief Overlay MAMapViewDelegate-mapView:viewForOverlay:View MAGroundOverlayMAOverlayLevelAboveRoadsoverlayMAOverlayLevelAboveLabels @param overlay overlay */ - (void)addOverlay:(id <MAOverlay>)overlay; /*! @brief OverlayMAMapViewDelegate-mapView:viewForOverlay:View MAOverlayLevelAboveLabels @param overlays overlay */ - (void)addOverlays:(NSArray *)overlays; /*! @brief OverlayMAMapViewDelegate-mapView:viewForOverlay:View @param overlay overlay @param level overlay */ - (void)addOverlay:(id <MAOverlay>)overlay level:(MAOverlayLevel)level; /*! @brief OverlayMAMapViewDelegate-mapView:viewForOverlay:View @param overlays overlay @param level overlay */ - (void)addOverlays:(NSArray *)overlays level:(MAOverlayLevel)level; /*! @brief Overlay @param overlay overlay */ - (void)removeOverlay:(id <MAOverlay>)overlay; /*! @brief Overlay @param overlays overlay */ - (void)removeOverlays:(NSArray *)overlays; /*! @brief Overlay @param overlay overlay @param index @param level indexlevellevel */ - (void)insertOverlay:(id <MAOverlay>)overlay atIndex:(NSUInteger)index level:(MAOverlayLevel)level; /*! @brief Overlayoverlay @param overlay Overlay @param sibling Overlay */ - (void)insertOverlay:(id <MAOverlay>)overlay aboveOverlay:(id <MAOverlay>)sibling; /*! @brief Overlayoverlay @param overlay Overlay @param sibling Overlay */ - (void)insertOverlay:(id <MAOverlay>)overlay belowOverlay:(id <MAOverlay>)sibling; /*! @brief Overlay @param overlay overlay @param index */ - (void)insertOverlay:(id <MAOverlay>)overlay atIndex:(NSUInteger)index; /*! @brief Overlay @param index1 1 @param index2 2 */ - (void)exchangeOverlayAtIndex:(NSUInteger)index1 withOverlayAtIndex:(NSUInteger)index2; /*! @brief overlay @param overlay1 @param overlay2 */ - (void)exchangeOverlay:(id <MAOverlay>)overlay1 withOverlay:(id <MAOverlay>)overlay2; /*! @brief overlayViewViewnil @param overlay overlay @return overlayView */ - (MAOverlayView *)viewForOverlay:(id <MAOverlay>)overlay; @end /*! @brief view */ @interface MAMapView (Snapshot) /*! @brief (annotationView) @param rect @return image */ - (UIImage *)takeSnapshotInRect:(CGRect)rect; @end /*! @brief view */ @interface MAMapView (Offline) /*! @brief Documents/3dvmap/ , offlineDataWillReload:(MAMapView *)mapView, offlineDataDidReload:(MAMapView *)mapView. */ - (void)reloadMap; @end @interface MAMapView (OpenGLES) /*! @brief / OpenGLES - (void)mapView:(MAMapView *)mapView didChangeOpenGLESDisabled:(BOOL)openGLESDisabled */ @property (nonatomic) BOOL openGLESDisabled; @end /*! @brief */ @interface MAMapView (LocationOption) /*! @brief kCLDistanceFilterNone */ @property(nonatomic) CLLocationDistance distanceFilter; /*! @brief kCLLocationAccuracyBest */ @property(nonatomic) CLLocationAccuracy desiredAccuracy; /*! @brief 1kCLHeadingFilterNone */ @property(nonatomic) CLLocationDegrees headingFilter; /** * YESiOS 6.0 */ @property(nonatomic) BOOL pausesLocationUpdatesAutomatically; /** * NOiOS 9.0 * YES Background Modes Location updates */ @property (nonatomic) BOOL allowsBackgroundLocationUpdates; @end /*! @brief viewdelegate */ @protocol MAMapViewDelegate <NSObject> @optional /*! @brief @param mapview View @param animated */ - (void)mapView:(MAMapView *)mapView regionWillChangeAnimated:(BOOL)animated; /*! @brief @param mapview View @param animated */ - (void)mapView:(MAMapView *)mapView regionDidChangeAnimated:(BOOL)animated; /*! @brief @param mapview View */ - (void)mapViewWillStartLoadingMap:(MAMapView *)mapView; /*! @brief @param mapView View @param dataSize */ - (void)mapViewDidFinishLoadingMap:(MAMapView *)mapView dataSize:(NSInteger)dataSize; /*! @brief @param mapView View @param error */ - (void)mapViewDidFailLoadingMap:(MAMapView *)mapView withError:(NSError *)error; /*! @brief anntationView @param mapView View @param annotation @return View */ - (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id <MAAnnotation>)annotation; /*! @brief mapViewannotation views @param mapView View @param views annotation views */ - (void)mapView:(MAMapView *)mapView didAddAnnotationViews:(NSArray *)views; /*! @brief annotation views @param mapView View @param views annotation views */ - (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view; /*! @brief annotation views @param mapView View @param views annotation views */ - (void)mapView:(MAMapView *)mapView didDeselectAnnotationView:(MAAnnotationView *)view; /*! @brief View @param mapView View */ - (void)mapViewWillStartLocatingUser:(MAMapView *)mapView; /*! @brief View @param mapView View */ - (void)mapViewDidStopLocatingUser:(MAMapView *)mapView; /*! @brief , -(void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation @param mapView View @param userLocation () */ - (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation __attribute__ ((deprecated("use -(void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation instead"))); /*! @brief @param mapView View @param userLocation () @param updatingLocation location, YES:location NO:heading */ - (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation; /*! @brief @param mapView View @param error CLError.h */ - (void)mapView:(MAMapView *)mapView didFailToLocateUserWithError:(NSError *)error; /*! @brief annotation viewviewios3.2 @param mapView View @param view annotation view @param newState @param oldState */ - (void)mapView:(MAMapView *)mapView annotationView:(MAAnnotationView *)view didChangeDragState:(MAAnnotationViewDragState)newState fromOldState:(MAAnnotationViewDragState)oldState; /*! @brief overlayView @param mapView View @param overlay overlay @return View */ - (MAOverlayView *)mapView:(MAMapView *)mapView viewForOverlay:(id <MAOverlay>)overlay; /*! @brief mapViewoverlay views @param mapView View @param overlayViews overlay views */ - (void)mapView:(MAMapView *)mapView didAddOverlayViews:(NSArray *)overlayViews; /*! @brief viewaccessory view(UIControl) @param mapView View @param annotationView calloutview @param control control */ - (void)mapView:(MAMapView *)mapView annotationView:(MAAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control; /** * viewcalloutview * * @param mapView view * @param view calloutViewannotationView */ - (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view; /*! @brief userTrackingMode @param mapView View @param mode mode @param animated */ - (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated; /*! @brief , reloadMap. @param mapview View */ - (void)offlineDataWillReload:(MAMapView *)mapView; /*! @brief , reloadMap. @param mapview View */ - (void)offlineDataDidReload:(MAMapView *)mapView; /*! @brief openGLESDisabled @param mapView View @param mode openGLESDisabled */ - (void)mapView:(MAMapView *)mapView didChangeOpenGLESDisabled:(BOOL)openGLESDisabled; /*! @brief touchPOIEnabled == YESPOI @param mapView View @param pois poi(MATouchPoi) */ - (void)mapView:(MAMapView *)mapView didTouchPois:(NSArray *)pois; /*! @brief @param mapView View @param coordinate */ - (void)mapView:(MAMapView *)mapView didSingleTappedAtCoordinate:(CLLocationCoordinate2D)coordinate; /*! @brief @param mapView View @param coordinate */ - (void)mapView:(MAMapView *)mapView didLongPressedAtCoordinate:(CLLocationCoordinate2D)coordinate; /*! @brief @param mapView View */ - (void)mapInitComplete:(MAMapView *)mapView; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/MAMapKit.framework/Versions/3.2.1.94eef6d.752/Headers/MAMapView.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
4,803
```objective-c // // AMapCommonObj.h // AMapSearchKit // // Created by xiaoming han on 15/7/22. // /** * */ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #pragma mark - AMapSearchObject /// SDK @interface AMapSearchObject : NSObject /// response - (NSString *)formattedDescription; @end #pragma mark - /// @interface AMapGeoPoint : AMapSearchObject<NSCopying> @property (nonatomic, assign) CGFloat latitude; @property (nonatomic, assign) CGFloat longitude; + (AMapGeoPoint *)locationWithLatitude:(CGFloat)lat longitude:(CGFloat)lon; @end /** * * :- */ @interface AMapGeoPolygon : AMapSearchObject<NSCopying> @property (nonatomic, strong) NSArray *points; //!< , AMapGeoPoint + (AMapGeoPolygon *)polygonWithPoints:(NSArray *)points; @end /// @interface AMapCity : AMapSearchObject @property (nonatomic, copy) NSString *city; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, assign) NSInteger num; //!< ,AMapSuggestion @property (nonatomic, strong) NSArray *districts; //!< AMapDistrict AMepStep @end /// @interface AMapSuggestion : AMapSearchObject @property (nonatomic, strong) NSArray *keywords; //!< NSString @property (nonatomic, strong) NSArray *cities; //!< AMapCity @end #pragma mark - /// @interface AMapTip : AMapSearchObject @property (nonatomic, copy) NSString *uid; //!< poiid @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *district; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @end #pragma mark - POI @interface AMapIndoorData : AMapSearchObject @property (nonatomic, assign) NSInteger floor; // !< 0POI @property (nonatomic, copy) NSString *pid; // !< ID @end /// POI @interface AMapPOI : AMapSearchObject // @property (nonatomic, copy) NSString *uid; //!< POIID @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *type; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, copy) NSString *address; //!< @property (nonatomic, copy) NSString *tel; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, copy) NSString *parkingType; // !< // @property (nonatomic, copy) NSString *postcode; //!< @property (nonatomic, copy) NSString *website; //!< @property (nonatomic, copy) NSString *email; //!< @property (nonatomic, copy) NSString *province; //!< @property (nonatomic, copy) NSString *pcode; //!< @property (nonatomic, copy) NSString *city; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *district; //!< @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *gridcode; //!< ID @property (nonatomic, copy) AMapGeoPoint *enterLocation; //!< @property (nonatomic, copy) AMapGeoPoint *exitLocation; //!< @property (nonatomic, copy) NSString *direction; //!< @property (nonatomic, assign) BOOL hasIndoorMap; //!< @property (nonatomic, copy) NSString *businessArea; //!< @property (nonatomic, strong) AMapIndoorData *indoorData; // !< @property (nonatomic, strong) NSArray *subPOIs; // !< POI AMapSubPOI @end /// POI @interface AMapSubPOI : AMapSearchObject @property (nonatomic, copy) NSString *uid; //!< POIID @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *sname; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, copy) NSString *address; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, copy) NSString *subtype; // !< POI @end #pragma mark - && /// @interface AMapRoad : AMapSearchObject @property (nonatomic, copy) NSString *uid; //!< ID @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, copy) NSString *direction; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @end /// @interface AMapRoadInter : AMapSearchObject @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, copy) NSString *direction; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, copy) NSString *firstId; //!< ID @property (nonatomic, copy) NSString *firstName; //!< @property (nonatomic, copy) NSString *secondId; //!< ID @property (nonatomic, copy) NSString *secondName; //!< @end /// @interface AMapStreetNumber : AMapSearchObject @property (nonatomic, copy) NSString *street; //!< @property (nonatomic, copy) NSString *number; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, copy) NSString *direction; //!< @end /// @interface AMapAddressComponent : AMapSearchObject @property (nonatomic, copy) NSString *province; //!< / @property (nonatomic, copy) NSString *city; //!< @property (nonatomic, copy) NSString *district; //!< @property (nonatomic, copy) NSString *township; //!< @property (nonatomic, copy) NSString *neighborhood; //!< @property (nonatomic, copy) NSString *building; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, strong) AMapStreetNumber *streetNumber; //!< @property (nonatomic, strong) NSArray *businessAreas; //!< AMapBusinessArea @end /// @interface AMapBusinessArea : AMapSearchObject @property (nonatomic, strong) NSString *name; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @end /// @interface AMapReGeocode : AMapSearchObject // @property (nonatomic, copy) NSString *formattedAddress; //!< @property (nonatomic, strong) AMapAddressComponent *addressComponent; //!< // @property (nonatomic, strong) NSArray *roads; //!< AMapRoad @property (nonatomic, strong) NSArray *roadinters; //!< AMapRoadInter @property (nonatomic, strong) NSArray *pois; //!< AMapPOI @end /// @interface AMapGeocode : AMapSearchObject @property (nonatomic, copy) NSString *formattedAddress; //<! @property (nonatomic, copy) NSString *province; //<! / @property (nonatomic, copy) NSString *city; //<! @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *district; //<! @property (nonatomic, copy) NSString *township; //<! @property (nonatomic, copy) NSString *neighborhood; //<! @property (nonatomic, copy) NSString *building; //<! @property (nonatomic, copy) NSString *adcode; //<! @property (nonatomic, copy) AMapGeoPoint *location; //<! @property (nonatomic, copy) NSString *level; //<! @end #pragma mark - @interface AMapBusStop : AMapSearchObject @property (nonatomic, copy) NSString *uid; //!< ID @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, strong) NSArray *buslines; //!< AMapBusLine @property (nonatomic, copy) NSString *sequence; //!< @end /// @interface AMapBusLine : AMapSearchObject // @property (nonatomic, copy) NSString *uid; //!< ID @property (nonatomic, copy) NSString *type; //!< @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *polyline; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *startStop; //!< @property (nonatomic, copy) NSString *endStop; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< AMapBusLine // @property (nonatomic, copy) NSString *startTime; //!< @property (nonatomic, copy) NSString *endTime; //!< @property (nonatomic, copy) NSString *company; //!< @property (nonatomic, assign) CGFloat distance; //!< ; @property (nonatomic, assign) CGFloat basicPrice; //!< @property (nonatomic, assign) CGFloat totalPrice; //!< @property (nonatomic, copy) AMapGeoPolygon *bounds; //!< @property (nonatomic, strong) NSArray *busStops; //!< AMapBusStop // @property (nonatomic, strong) AMapBusStop *departureStop; //!< @property (nonatomic, strong) AMapBusStop *arrivalStop; //!< @property (nonatomic, strong) NSArray *viaBusStops; //!< AMapBusStop @property (nonatomic, assign) NSInteger duration; //!< @end #pragma mark - @interface AMapDistrict : AMapSearchObject @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *citycode; //!< @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) NSString *level; //!< @property (nonatomic, strong) NSArray *districts; //!< @property (nonatomic, copy) AMapGeoPoint *center; //!< @property (nonatomic, strong) NSArray *polylines; //!< , NSString @end #pragma mark - /// @interface AMapRoute : AMapSearchObject @property (nonatomic, copy) AMapGeoPoint *origin; //!< @property (nonatomic, copy) AMapGeoPoint *destination; //!< @property (nonatomic, assign) CGFloat taxiCost; //!< @property (nonatomic, strong) NSArray *paths; //!< AMapPath @property (nonatomic, strong) NSArray *transits; //!< AMapTransit @end /// @interface AMapPath : AMapSearchObject @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, assign) NSInteger duration; //!< @property (nonatomic, copy) NSString *strategy; //!< @property (nonatomic, strong) NSArray *steps; //!< AMapStep @property (nonatomic, assign) CGFloat tolls; //!< @property (nonatomic, assign) NSInteger tollDistance; //!< @end /// @interface AMapStep : AMapSearchObject // @property (nonatomic, copy) NSString *instruction; //!< @property (nonatomic, copy) NSString *orientation; //!< @property (nonatomic, copy) NSString *road; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, assign) NSInteger duration; //!< @property (nonatomic, copy) NSString *polyline; //!< @property (nonatomic, copy) NSString *action; //!< @property (nonatomic, copy) NSString *assistantAction; //!< @property (nonatomic, assign) CGFloat tolls; //!< @property (nonatomic, assign) NSInteger tollDistance; //!< @property (nonatomic, copy) NSString *tollRoad; //!< // @property (nonatomic, strong) NSArray *cities; //!< AMapCity @end /// @interface AMapWalking : AMapSearchObject @property (nonatomic, copy) AMapGeoPoint *origin; //!< @property (nonatomic, copy) AMapGeoPoint *destination; //!< @property (nonatomic, assign) NSInteger distance; //!< @property (nonatomic, assign) NSInteger duration; //!< @property (nonatomic, strong) NSArray *steps; //!< AMapStep @end /// @interface AMapSegment : AMapSearchObject @property (nonatomic, strong) AMapWalking *walking; //!< @property (nonatomic, strong) NSArray *buslines; //!< AMapBusLine @property (nonatomic, copy) NSString *enterName; //!< @property (nonatomic, copy) AMapGeoPoint *enterLocation; //!< @property (nonatomic, copy) NSString *exitName; //!< @property (nonatomic, copy) AMapGeoPoint *exitLocation; //!< @end /// @interface AMapTransit : AMapSearchObject @property (nonatomic, assign) CGFloat cost; //!< @property (nonatomic, assign) NSInteger duration; //!< @property (nonatomic, assign) BOOL nightflag; //!< @property (nonatomic, assign) NSInteger walkingDistance; //!< @property (nonatomic, strong) NSArray *segments; //!< AMapSegment @property (nonatomic, assign) NSInteger distance; // !< @end #pragma mark - /// @interface AMapLocalWeatherLive : AMapSearchObject @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *province; //!< @property (nonatomic, copy) NSString *city; //!< @property (nonatomic, copy) NSString *weather; //!< @property (nonatomic, copy) NSString *temperature; //!< @property (nonatomic, copy) NSString *windDirection; //!< @property (nonatomic, copy) NSString *windPower; //!< @property (nonatomic, copy) NSString *humidity; //!< @property (nonatomic, copy) NSString *reportTime; //!< @end /// 3 @interface AMapLocalWeatherForecast : AMapSearchObject @property (nonatomic, copy) NSString *adcode; //!< @property (nonatomic, copy) NSString *province; //!< @property (nonatomic, copy) NSString *city; //!< @property (nonatomic, copy) NSString *reportTime; //!< @property (nonatomic, strong) NSArray *casts; //!< AMapLocalDayWeatherForecast @end /// @interface AMapLocalDayWeatherForecast : AMapSearchObject @property (nonatomic, copy) NSString *date; //!< @property (nonatomic, copy) NSString *week; //!< @property (nonatomic, copy) NSString *dayWeather; //!< @property (nonatomic, copy) NSString *nightWeather;//!< @property (nonatomic, copy) NSString *dayTemp; //!< @property (nonatomic, copy) NSString *nightTemp; //!< @property (nonatomic, copy) NSString *dayWind; //!< @property (nonatomic, copy) NSString *nightWind; //!< @property (nonatomic, copy) NSString *dayPower; //!< @property (nonatomic, copy) NSString *nightPower; //!< @end #pragma mark - @interface AMapNearbyUserInfo : AMapSearchObject @property (nonatomic, copy) NSString *userID; //!< ID @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, assign) CGFloat distance; //!< searchType @property (nonatomic, assign) NSTimeInterval updatetime; //!< @end #pragma mark - /// POI @interface AMapCloudImage : AMapSearchObject @property (nonatomic, copy) NSString *uid; //!< id @property (nonatomic, copy) NSString *preurl; //!< url @property (nonatomic, copy) NSString *url; //!< url @end /// POI @interface AMapCloudPOI : AMapSearchObject @property (nonatomic, assign) NSInteger uid; //!< @property (nonatomic, copy) NSString *name; //!< @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, copy) NSString *address; //!< @property (nonatomic, strong) NSDictionary *customFields; //!< @property (nonatomic, copy) NSString *createTime; //!< @property (nonatomic, copy) NSString *updateTime; //!< @property (nonatomic, assign) NSInteger distance; //!< (PlaceAround) @property (nonatomic, strong) NSArray *images; //!< @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapCommonObj.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
3,679
```objective-c // // AMapSearchAPI.h // AMapSearchKit // // Created by xiaoming han on 15/7/22. // #import <Foundation/Foundation.h> #import "AMapSearchObj.h" #import "AMapCommonObj.h" @protocol AMapSearchDelegate; /// typedef NS_ENUM(NSInteger, AMapSearchLanguage) { AMapSearchLanguageZhCN = 0, //!< AMapSearchLanguageEn = 1 //!< }; /// @interface AMapSearchAPI : NSObject /// AMapSearchDelegate @property (nonatomic, weak) id<AMapSearchDelegate> delegate; /// 20 @property (nonatomic, assign) NSInteger timeout; /// , @property (nonatomic, assign) AMapSearchLanguage language; /** * AMapSearch * * AMapSearchServices APIKey. * @return AMapSearch */ - (instancetype)init; /** * */ - (void)cancelAllRequests; #pragma mark - /** * POI ID * * @param request AMapPOIIDSearchRequest */ - (void)AMapPOIIDSearch:(AMapPOIIDSearchRequest *)request; /** * POI * * @param request AMapPOIKeywordsSearchRequest */ - (void)AMapPOIKeywordsSearch:(AMapPOIKeywordsSearchRequest *)request; /** * POI * * @param request AMapPOIAroundSearchRequest */ - (void)AMapPOIAroundSearch:(AMapPOIAroundSearchRequest *)request; /** * POI * * @param request AMapPOIPolygonSearchRequest */ - (void)AMapPOIPolygonSearch:(AMapPOIPolygonSearchRequest *)request; /** * * * @param request AMapGeocodeSearchRequest */ - (void)AMapGeocodeSearch:(AMapGeocodeSearchRequest *)request; /** * * * @param request AMapReGeocodeSearchRequest */ - (void)AMapReGoecodeSearch:(AMapReGeocodeSearchRequest *)request; /** * * * @param request AMapInputTipsSearchRequest */ - (void)AMapInputTipsSearch:(AMapInputTipsSearchRequest *)request; /** * * * @param request AMapBusStopSearchRequest */ - (void)AMapBusStopSearch:(AMapBusStopSearchRequest *)request; /** * * * @param request AMapBusLineIDSearchRequest */ - (void)AMapBusLineIDSearch:(AMapBusLineIDSearchRequest *)request; /** * * * @param request AMapBusLineNameSearchRequest */ - (void)AMapBusLineNameSearch:(AMapBusLineNameSearchRequest *)request; /** * * * @param request AMapDistrictSearchRequest */ - (void)AMapDistrictSearch:(AMapDistrictSearchRequest *)request; /** * * * @param request AMapDrivingRouteSearchRequest */ - (void)AMapDrivingRouteSearch:(AMapDrivingRouteSearchRequest *)request; /** * * * @param request AMapWalkingRouteSearchRequest */ - (void)AMapWalkingRouteSearch:(AMapWalkingRouteSearchRequest *)request; /** * * * @param request AMapTransitRouteSearchRequest */ - (void)AMapTransitRouteSearch:(AMapTransitRouteSearchRequest *)request; /** * * * @param request AMapWeatherSearchRequest */ - (void)AMapWeatherSearch:(AMapWeatherSearchRequest *)request; #pragma mark - /** * * * @param request AMapNearbySearchRequest */ - (void)AMapNearbySearch:(AMapNearbySearchRequest *)request; #pragma mark - /** * * * @param request AMapCloudPOIAroundSearchRequest */ - (void)AMapCloudPOIAroundSearch:(AMapCloudPOIAroundSearchRequest *)request; /** * polygon * * @param request AMapCloudPOIPolygonSearchRequest */ - (void)AMapCloudPOIPolygonSearch:(AMapCloudPOIPolygonSearchRequest *)request; /** * ID * * @param request AMapCloudPOIIDSearchRequest */ - (void)AMapCloudPOIIDSearch:(AMapCloudPOIIDSearchRequest *)request; /** * * * @param request AMapCloudPOILocalSearchRequest */ - (void)AMapCloudPOILocalSearch:(AMapCloudPOILocalSearchRequest *)request; #pragma mark - /** * * * @param request AMapLocationShareSearchRequest */ - (void)AMapLocationShareSearch:(AMapLocationShareSearchRequest *)request; /** * * * @param request AMapPOIShareSearchRequest */ - (void)AMapPOIShareSearch:(AMapPOIShareSearchRequest *)request; /** * * * @param request AMapRouteShareSearchRequest */ - (void)AMapRouteShareSearch:(AMapRouteShareSearchRequest *)request; /** * * * @param request AMapNavigationShareSearchRequest */ - (void)AMapNavigationShareSearch:(AMapNavigationShareSearchRequest *)request; @end #pragma mark - AMapSearchDelegate /** * AMapSearchDelegate * */ @protocol AMapSearchDelegate<NSObject> @optional /** * . * * @param request . * @param error . */ - (void)AMapSearchRequest:(id)request didFailWithError:(NSError *)error; /** * POI * * @param request AMapPOISearchBaseRequest * @param response AMapPOISearchResponse */ - (void)onPOISearchDone:(AMapPOISearchBaseRequest *)request response:(AMapPOISearchResponse *)response; /** * * * @param request AMapGeocodeSearchRequest * @param response AMapGeocodeSearchResponse */ - (void)onGeocodeSearchDone:(AMapGeocodeSearchRequest *)request response:(AMapGeocodeSearchResponse *)response; /** * * * @param request AMapReGeocodeSearchRequest * @param response AMapReGeocodeSearchResponse */ - (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response; /** * * * @param request AMapInputTipsSearchRequest * @param response AMapInputTipsSearchResponse */ - (void)onInputTipsSearchDone:(AMapInputTipsSearchRequest *)request response:(AMapInputTipsSearchResponse *)response; /** * * * @param request AMapBusStopSearchRequest * @param response AMapBusStopSearchResponse */ - (void)onBusStopSearchDone:(AMapBusStopSearchRequest *)request response:(AMapBusStopSearchResponse *)response; /** * * * @param request AMapBusLineSearchRequest * @param response AMapBusLineSearchResponse */ - (void)onBusLineSearchDone:(AMapBusLineBaseSearchRequest *)request response:(AMapBusLineSearchResponse *)response; /** * * * @param request AMapDistrictSearchRequest * @param response AMapDistrictSearchResponse */ - (void)onDistrictSearchDone:(AMapDistrictSearchRequest *)request response:(AMapDistrictSearchResponse *)response; /** * * * @param request AMapRouteSearchBaseRequest * @param response AMapRouteSearchResponse */ - (void)onRouteSearchDone:(AMapRouteSearchBaseRequest *)request response:(AMapRouteSearchResponse *)response; /** * * * @param request AMapWeatherSearchRequest * @param response AMapWeatherSearchResponse */ - (void)onWeatherSearchDone:(AMapWeatherSearchRequest *)request response:(AMapWeatherSearchResponse *)response; #pragma mark - /** * * * @param request AMapNearbySearchRequest * @param response AMapNearbySearchResponse */ - (void)onNearbySearchDone:(AMapNearbySearchRequest *)request response:(AMapNearbySearchResponse *)response; #pragma mark - /** * * * @param request AMapCloudSearchBaseRequest * @param response AMapCloudPOISearchResponse */ - (void)onCloudSearchDone:(AMapCloudSearchBaseRequest *)request response:(AMapCloudPOISearchResponse *)response; #pragma mark - /** * * * @param request * @param response AMapShareSearchResponse */ - (void)onShareSearchDone:(AMapShareSearchBaseRequest *)request response:(AMapShareSearchResponse *)response; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapSearchAPI.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,956
```objective-c // // AMapSearchObj.h // AMapSearchKit // // Created by xiaoming han on 15/7/22. // /** * */ #import <Foundation/Foundation.h> #import "AMapCommonObj.h" #pragma mark - AMapPOISearchBaseRequest /// POI @interface AMapPOISearchBaseRequest : AMapSearchObject @property (nonatomic, copy) NSString *types; //!< | : @property (nonatomic, assign) NSInteger sortrule; //<! , 0-1-, 1 @property (nonatomic, assign) NSInteger offset; //<! , 1-50, [default = 20] @property (nonatomic, assign) NSInteger page; //<! , 1-100, [default = 1] @property (nonatomic, assign) BOOL requireExtension; //<! NO @property (nonatomic, assign) BOOL requireSubPOIs; //<! POI NO @end /// POI ID @interface AMapPOIIDSearchRequest : AMapPOISearchBaseRequest @property (nonatomic, copy) NSString *uid; //<! POIID @end /// POI @interface AMapPOIKeywordsSearchRequest : AMapPOISearchBaseRequest @property (nonatomic, copy) NSString *keywords; //<! | @property (nonatomic, copy) NSString *city; //!< citynamecitycodeadcode. @property (nonatomic, assign) BOOL cityLimit; // !< NOcitylimittruePOI @end /// POI @interface AMapPOIAroundSearchRequest : AMapPOISearchBaseRequest @property (nonatomic, copy) NSString *keywords; //<! | @property (nonatomic, copy) AMapGeoPoint *location; //<! @property (nonatomic, assign) NSInteger radius; //<! 0-50000 [default = 3000] @end /// POI @interface AMapPOIPolygonSearchRequest : AMapPOISearchBaseRequest @property (nonatomic, copy) NSString *keywords; //<! | @property (nonatomic, copy) AMapGeoPolygon *polygon; //<! @end /// POI @interface AMapPOISearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< POI @property (nonatomic, strong) AMapSuggestion *suggestion; //!< @property (nonatomic, strong) NSArray *pois; //!< POIAMapPOI @end #pragma mark - AMapInputTipsSearchRequest /// @interface AMapInputTipsSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *keywords; //!< @property (nonatomic, copy) NSString *city; //!< citynamecitycodeadcode. @property (nonatomic, copy) NSString *types; //!< | : @property (nonatomic, assign) BOOL cityLimit; // !< citylimittruePOI @end /// @interface AMapInputTipsSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) NSArray *tips; //!< AMapTip @end #pragma mark - AMapGeocodeSearchRequest /// @interface AMapGeocodeSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *address; //!< @property (nonatomic, copy) NSString *city; //!< citynamecitycodeadcode. @end /// @interface AMapGeocodeSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) NSArray *geocodes; //!< AMapGeocode @end #pragma mark - AMapReGeocodeSearchRequest /// @interface AMapReGeocodeSearchRequest : AMapSearchObject @property (nonatomic, assign) BOOL requireExtension; //!< NO @property (nonatomic, copy) AMapGeoPoint *location; //!< @property (nonatomic, assign) NSInteger radius; //!< 0~30001000 @end /// @interface AMapReGeocodeSearchResponse : AMapSearchObject @property (nonatomic, strong) AMapReGeocode *regeocode; //!< @end #pragma mark - AMapBusStopSearchRequest /// @interface AMapBusStopSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *keywords; //!< @property (nonatomic, copy) NSString *city; //!< citynamecitycodeadcode @property (nonatomic, assign) NSInteger offset; //!< 201-50 @property (nonatomic, assign) NSInteger page; //!< 11-100 @end /// @interface AMapBusStopSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) AMapSuggestion *suggestion; //!< @property (nonatomic, strong) NSArray *busstops; //!< AMapBusStop @end #pragma mark - AMapBusLineSearchRequest /// @interface AMapBusLineBaseSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *city; //!< citynamecitycodeadcode @property (nonatomic, assign) BOOL requireExtension; //!< NO @property (nonatomic, assign) NSInteger offset; //!< 20150 @property (nonatomic, assign) NSInteger page; //!< 11-100 @end /// @interface AMapBusLineNameSearchRequest : AMapBusLineBaseSearchRequest @property (nonatomic, copy) NSString *keywords; //!< @end /// ID @interface AMapBusLineIDSearchRequest : AMapBusLineBaseSearchRequest @property (nonatomic, copy) NSString *uid; @end /// @interface AMapBusLineSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) AMapSuggestion *suggestion; //!< @property (nonatomic, strong) NSArray *buslines; //!< AMapBusLine @end #pragma mark - AMapDistrictSearchRequest @interface AMapDistrictSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *keywords; //!< @property (nonatomic, assign) BOOL requireExtension; //!< NO @end @interface AMapDistrictSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) NSArray *districts; //!< AMapDistrict @end #pragma mark - AMapRouteSearchBaseRequest /// @interface AMapRouteSearchBaseRequest : AMapSearchObject @property (nonatomic, copy) AMapGeoPoint *origin; //!< @property (nonatomic, copy) AMapGeoPoint *destination; //!< @end #pragma mark - AMapDrivingRouteSearchRequest /// @interface AMapDrivingRouteSearchRequest : AMapRouteSearchBaseRequest /// 0-1-2-3-4-5-6-7-8-9- @property (nonatomic, assign) NSInteger strategy; //!< ([default = 0]) @property (nonatomic, copy) NSArray *waypoints; //!< AMapGeoPoint 16 @property (nonatomic, copy) NSArray *avoidpolygons; //!< AMapGeoPolygon 10016 @property (nonatomic, copy) NSString *avoidroad; //!< @property (nonatomic, copy) NSString *originId; //!< POI ID @property (nonatomic, copy) NSString *destinationId; //!< POI ID @property (nonatomic, assign) BOOL requireExtension; //!< NO @end #pragma mark - AMapWalkingRouteSearchRequest /// @interface AMapWalkingRouteSearchRequest : AMapRouteSearchBaseRequest /// : 0-; 1-() @property (nonatomic, assign) NSInteger multipath; //!< ([default = 0]) @end #pragma mark - AMapTransitRouteSearchRequest /// @interface AMapTransitRouteSearchRequest : AMapRouteSearchBaseRequest /// 0-1-2-3-4-5- @property (nonatomic, assign) NSInteger strategy; //!< ([default = 0]) @property (nonatomic, copy) NSString *city; //!< , @property (nonatomic, assign) BOOL nightflag; //!< NO @property (nonatomic, assign) BOOL requireExtension; //!< NO @end #pragma mark - AMapRouteSearchResponse /// @interface AMapRouteSearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) AMapRoute *route; //!< @end #pragma mark - AMapWeatherSearchWeather /// typedef NS_ENUM(NSInteger, AMapWeatherType) { AMapWeatherTypeLive = 1, //<! AMapWeatherTypeForecast //<! }; /// @interface AMapWeatherSearchRequest : AMapSearchObject @property (nonatomic, copy) NSString *city; //!< citynameadcode @property (nonatomic, assign) AMapWeatherType type; //!< LiveForecastLive @end /// @interface AMapWeatherSearchResponse : AMapSearchObject @property (nonatomic, strong) NSArray *lives; //!< AMapLocalWeatherLive @property (nonatomic, strong) NSArray *forecasts; //!< AMapLocalWeatherForecast @end #pragma mark - AMapNearbySearchRequest /// typedef NS_ENUM(NSInteger, AMapNearbySearchType) { AMapNearbySearchTypeLiner = 0, //!< AMapNearbySearchTypeDriving = 1, //!< }; /// @interface AMapNearbySearchRequest : AMapSearchObject @property (nonatomic, copy) AMapGeoPoint *center; //<! @property (nonatomic, assign) NSInteger radius; //<! [0, 10000] [default = 1000] @property (nonatomic, assign) AMapNearbySearchType searchType; //<! @property (nonatomic, assign) NSInteger timeRange; //<! 24[5, 24*60*60] [default = 1800] @property (nonatomic, assign) NSInteger limit; //<! [1, 100], 30 @end /// @interface AMapNearbySearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //!< @property (nonatomic, strong) NSArray *infos; //!< AMapNearbyUserInfo @end #pragma mark - AMapCloudSearchBaseRequest /// typedef NS_ENUM(NSInteger, AMapCloudSortType) { AMapCloudSortTypeDESC = 0, //<! AMapCloudSortTypeASC = 1 //<! }; /// @interface AMapCloudSearchBaseRequest : AMapSearchObject /// ID, @property (nonatomic, copy) NSString *tableID; /** * , , (_id_name_address_updatetime_createtime). * * 1.; * 2.:{@"type:", @"star:[3,5]"},SQL:WHERE type = "" AND star BETWEEN 3 AND 5 * : &#%URL */ @property (nonatomic, strong) NSArray *filter; /** * , . * * 1.sortFields = @"" * 2.(sortType) * _distance * _weightkeywords * 3. * keywords_weight * keywords_distance * */ @property (nonatomic, copy) NSString *sortFields; /// , () @property (nonatomic, assign) AMapCloudSortType sortType; /// , (100, 20) @property (nonatomic, assign) NSInteger offset; /// , (>=1, 1) @property (nonatomic, assign) NSInteger page; @end #pragma mark - AMapCloudPlaceAroundSearchRequest /// @interface AMapCloudPOIAroundSearchRequest : AMapCloudSearchBaseRequest /// @property (nonatomic, copy) AMapGeoPoint *center; //<! , /// 3000 @property (nonatomic, assign) NSInteger radius; //<! , (:;:3000) /** * * * 1. _name _address * 2. keywords = @""POI * 3. keywords = @"||"POIPOI * 4. keywords = @" " * 5. city = @""keywords = @" " keywords = @"" * 6. 2000 * : keywords&#%URL */ @property (nonatomic, copy) NSString *keywords; @end /// polygon @interface AMapCloudPOIPolygonSearchRequest : AMapCloudSearchBaseRequest /// @property (nonatomic, copy) AMapGeoPolygon *polygon; //<! , /** * * * 1. _name _address * 2. keywords = @""POI * 3. keywords = @"||"POIPOI * 4. keywords = @" " * 5. city = @""keywords = @" " keywords = @"" * 6. 2000 * : keywords&#%URL */ @property (nonatomic, copy) NSString *keywords; @end /// ID @interface AMapCloudPOIIDSearchRequest : AMapCloudSearchBaseRequest @property (nonatomic, assign) NSInteger uid; //<! ,POIID @end /// @interface AMapCloudPOILocalSearchRequest : AMapCloudSearchBaseRequest /** * * * 1. _name _address * 2. keywords = @""POI * 3. keywords = @"||"POIPOI * 4. keywords = @" " * 5. city = @""keywords = @" " keywords = @"" * 6. 2000 * : keywords&#%URL */ @property (nonatomic, copy) NSString *keywords; /// 1. ///2. city = @""3. city city = @"" @property (nonatomic, copy) NSString *city; //<! ,POI @end #pragma mark - AMapCloudPOISearchResponse /// @interface AMapCloudPOISearchResponse : AMapSearchObject @property (nonatomic, assign) NSInteger count; //<! @property (nonatomic, strong) NSArray *POIs; //<! , AMapCloudPOI @end #pragma mark - AMapShareSearchBaseRequest /// , @interface AMapShareSearchBaseRequest : AMapSearchObject @end /// @interface AMapLocationShareSearchRequest : AMapShareSearchBaseRequest @property (nonatomic, copy) AMapGeoPoint *location; //<! , @property (nonatomic, copy) NSString *name; //<! ,%&@# @end /// @interface AMapPOIShareSearchRequest : AMapShareSearchBaseRequest @property (nonatomic, copy) NSString *uid; //<! POIIDIDPOIname @property (nonatomic, copy) AMapGeoPoint *location; //<! @property (nonatomic, copy) NSString *name; //<! ,%&@# @property (nonatomic, copy) NSString *address; //<! ,%&@# @end /// @interface AMapRouteShareSearchRequest : AMapShareSearchBaseRequest /// :0-; 1-; 2-; 3-; 4-; 5-; 6-; 7-; 8- /// :0-; 1-; 2-; 3-; 4-; 5-; /// @property (nonatomic, assign) NSInteger strategy; //<! 0 @property (nonatomic, assign) NSInteger type; //<! Routetype01200 @property (nonatomic, copy) AMapGeoPoint *startCoordinate; //<! @property (nonatomic, copy) AMapGeoPoint *destinationCoordinate; //<! @property (nonatomic, copy) NSString *startName; //<! ,%&@# @property (nonatomic, copy) NSString *destinationName; //<! ,%&@# @end /// @interface AMapNavigationShareSearchRequest : AMapShareSearchBaseRequest /// :0-; 1-; 2-; 3-; 4-; 5-; 6-; 7-; 8- @property (nonatomic, assign) NSInteger strategy; //!< 00 @property (nonatomic, copy) AMapGeoPoint *startCoordinate; //<! @property (nonatomic, copy) AMapGeoPoint *destinationCoordinate; //<! @end @interface AMapShareSearchResponse : AMapSearchObject @property (nonatomic, copy) NSString *shareURL; //<! @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapSearchObj.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
3,523
```objective-c // // AMapNearbyUploadInfo.h // AMapSearchKit // // Created by xiaoming han on 15/9/6. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> /// typedef NS_ENUM(NSInteger, AMapSearchCoordinateType) { AMapSearchCoordinateTypeGPS = 1, //!< GPS AMapSearchCoordinateTypeAMap = 2, //!< }; /// @interface AMapNearbyUploadInfo : NSObject<NSCopying> /** * * 32. */ @property (nonatomic, copy) NSString *userID; /// AMapSearchCoordinateTypeAMap @property (nonatomic, assign) AMapSearchCoordinateType coordinateType; /// @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @end ```
/content/code_sandbox/BigShow1949/Classes/Main/Extern/AMapSearchKit.framework/Headers/AMapNearbyUploadInfo.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
170
```objective-c // // YFSortVC.h // BigShow1949 // // Created by apple on 16/10/12. // #import <UIKit/UIKit.h> @interface YFSortVC : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFSortVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
48
```objective-c // // YFFalseCoinVC.m // BigShow1949 // // // // // #import "YFFalseCoinVC.h" int SearchFalseCurrency(int a, int s, int e); int findCoin(int coin[],int front,int back) ; int max(int ,int); @implementation YFFalseCoinVC - (void)viewDidLoad { self.view.backgroundColor = [UIColor whiteColor]; // 8 // int a[8] ={1, 1, 1, 2, 1, 1, 1, 1}; // int result = FindCounterfeitMoney(a,0,7); int coin[30]={1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; printf("%d\n",findCoin(coin,0,29)); // system("PAUSE"); // int ax= max(1,2); } int max(int a,int b) { if (a>b) return a; else if (a < b) return b; else if (a == b) return b; else return a; } //coin[]frontback029 int findCoin(int coin[],int front,int back) { int i,sumf=0,sumb=0,sum=0; if(front+1==back) // { if(coin[front]<coin[back]) return front+1; else return back+1; }else if((back-front+1)%2==0) //(back-front)/2 { for(i=front;i<=front+(back-front)/2;i++) sumf=sumf+coin[i]; //sumf(back-front)/2 for(i=front+(back-front)/2+1;i<=back;i++) sumb=sumb+coin[i]; //sumb(back-front)/2 if(sumf<sumb) return findCoin(coin,front,front+(back-front)/2); if(sumf>sumb) return findCoin(coin,front+(back-front)/2+1,back); } else { //(back-front)/21 for(i=front;i<=front+(back-front)/2-1;i++) sumf=sumf+coin[i];//sumf(back-front)/2 for(i=front+(back-front)/2+1;i<=back;i++) sumb=sumb+coin[i]; //sumb(back-front)/2 sum=coin[front+(back-front)/2]; // sum if(sumf<sumb) return findCoin(coin,front,front+(back-front)/2-1); if(sumf>sumb) // return findCoin(coin,front+(back-front)/2+1,back); else if(sumf+sum==sumb+sum) // return front+(back-front)/2+1; } return 0; } @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFFalseCoinVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
697
```objective-c // // YFHanoiVC.h // BigShow1949 // // Created by apple on 16/10/12. // #import <UIKit/UIKit.h> @interface YFHanoiVC : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFHanoiVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
48
```objective-c // // YFAlgorithmViewController.m // BigShow1949 // // Created by apple on 16/10/12. // #import "YFAlgorithmViewController.h" @implementation YFAlgorithmViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupDataArr:@[@[@"",@"YFEightQueensVC"], @[@"",@"YFHanoiVC"], @[@"",@"YFMonkeyKingVC"], @[@"",@"YFFalseCoinVC"], @[@"",@"YFSortVC"],]]; } @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFAlgorithmViewController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
116
```objective-c // // YFAlgorithmViewController.h // BigShow1949 // // Created by apple on 16/10/12. // #import "BaseTableViewController.h" @interface YFAlgorithmViewController : BaseTableViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFAlgorithmViewController.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
51
```objective-c // // YFEightQueensVC.m // BigShow1949 // // // 8X8 // // // #import "YFEightQueensVC.h" #define N 8 /* */ int place(int k); /* 10 */ void backtrack(int i);/* i */ void chessboard(); /* , */ static int sum, /* */ x[N]; /* ,x[i]iix[i] */ @implementation YFEightQueensVC - (void)viewDidLoad { self.view.backgroundColor = [UIColor whiteColor]; backtrack(0); } int place(int k) { /* kkx[k] x[j] == */ /* x[k] abs(k - j) == abs(x[j] - x[k]) */ /* 0*/ for (int j = 0; j < k; j ++) if (abs(k - j) == abs(x[j] - x[k]) || (x[j] == x[k])) return 0; return 1; } void backtrack(int t) { /* t == N N */ if (t == N) chessboard(); else for (int i = 0; i < N; i ++) { x[t] = i; // printf("a[%d]=%d",t,i); if (place(t)) backtrack(t + 1); } } void chessboard() { printf("%d:\n", ++ sum); for (int i = 0; i < N; i ++) { for (int j = 0; j < N; j ++) if (x[i] == j) printf("@ "); else printf("* "); printf("\n"); } printf("\n"); } @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFEightQueensVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
373
```objective-c // // YFEightQueensVC.h // BigShow1949 // // Created by apple on 16/10/12. // #import <UIKit/UIKit.h> @interface YFEightQueensVC : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFEightQueensVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
52
```objective-c // // YFMonkeyKingVC.h // BigShow1949 // // Created by apple on 16/10/12. // #import <UIKit/UIKit.h> @interface YFMonkeyKingVC : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFMonkeyKingVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
50
```objective-c // // YFFalseCoinVC.h // BigShow1949 // // Created by apple on 16/10/12. // #import <UIKit/UIKit.h> @interface YFFalseCoinVC : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFFalseCoinVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
50
```objective-c // // YFMonkeyKingVC.m // BigShow1949 // // 151 // #import "YFMonkeyKingVC.h" @implementation YFMonkeyKingVC - (void)viewDidLoad { self.view.backgroundColor = [UIColor whiteColor]; bool a[101]={0}; int f=0,t=0,s=0; int n = 15; int m = 3; do { ++t;// if(t>n) t=1;// // t if(!a[t]) s++; if(s==m)//3 { s=0;// printf("%d ",t);// a[t]=1;// f++;//+1 } }while(f!=n);// printf("\n%d",t); } @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFMonkeyKingVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
185
```objective-c // // YFViewLayoutViewController.h // BigShow1949 // // Created by zhht01 on 16/3/15. // #import "BaseTableViewController.h" @interface YFViewLayoutViewController : BaseTableViewController @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YFViewLayoutViewController.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
55
```objective-c // // YFViewLayoutViewController.m // BigShow1949 // // Created by zhht01 on 16/3/15. // #import "YFViewLayoutViewController.h" @interface YFViewLayoutViewController () @end @implementation YFViewLayoutViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupDataArr:@[@[@"",@"YFHorizontalScrollViewController"], @[@"",@"YFWaterflowViewController"], @[@"",@"RGCardLayoutViewController_UIStoryboard"], @[@"",@"YFHalfCircleLayoutViewController_UIStoryboard"], @[@"",@"YFSlideTitlesViewController"], @[@"",@"YFNeteaseHomeViewController"], @[@"",@"YFStackedPageVC_UIStoryboard"], @[@"YNPageView",@"YNPageViewDemoController"], @[@"ArtPageView",@"ArtPageViewController"]]]; } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YFViewLayoutViewController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
182
```objective-c // // YNPageTestViewController.m // BigShow1949 // // Created by big show on 2018/9/24. // #import "YNPageViewDemoController.h" #import "YNSuspendTopPageVC.h" #import "YNSuspendCenterPageVC.h" #import "YNSuspendTopPausePageVC.h" #import "YNSuspendCustomNavOrSuspendPositionVC.h" #import "YNTopPageVC.h" #import "YNNavPageVC.h" #import "YNLoadPageVC.h" #import "YNScrollMenuStyleVC.h" #import "YNTestPageVC.h" @interface YNPageViewDemoController () @end @implementation YNPageViewDemoController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; [self setupDataArr:@[@[@"--",@"YNVCTypeSuspendCenterPageVC"], // @[@"--",@"YNVCTypeSuspendTopPageVC"], @[@"--(QQ)",@"YNVCTypeSuspendTopPausePageVC"], @[@"--",@"YNVCTypeSuspendCustomNavOrSuspendPosition"],// @[@"()",@"YNVCTypeLoadPageVC"], @[@"",@"YNVCTypeTopPageVC"], @[@"",@"YNVCTypeNavPageVC"],// @[@"",@"YNVCTypeScrollMenuStyleVC"], @[@"",@"YNVCTypeYNTestPageVC"], ]]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIViewController *vc = nil; switch (indexPath.row) { case 0: vc = [YNSuspendTopPageVC suspendTopPageVC]; break; case 1: vc = [YNSuspendCenterPageVC suspendCenterPageVC]; break; case 2: vc = [YNSuspendTopPausePageVC suspendTopPausePageVC]; break; case 3: vc = [YNSuspendCustomNavOrSuspendPositionVC new]; break; case 4: vc = [YNTopPageVC topPageVC]; break; case 5: vc = [YNNavPageVC navPageVC]; break; case 6: vc = [YNLoadPageVC new]; break; case 7: vc = [YNScrollMenuStyleVC new]; break; case 8: vc = [YNTestPageVC testPageVC]; break; case 9: break; default: break; } [self.navigationController pushViewController:vc animated:YES]; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/YNPageViewDemoController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
625
```objective-c // // YFSortVC.m // BigShow1949 // // Created by apple on 16/10/12. // #import "YFSortVC.h" void BubbleSort(int a[], int n); // void InsertSort(int a[], int n); // void ShellSort(int a[], int n); // void QuikSort(int a[], int n); // void SelectSort(int a[], int n); // void HeapSort(int a[],int n); // void MergeSort(int a[],int b[],int ,int ); // void HeapAdjust(int array[],int i, int nLength); @implementation YFSortVC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; int a[8] = {46,55,13,42,94,5,17,70}; // int a[10] = {9,4,8,1,6,2,7,3,5,0}; BubbleSort(a, 8); // InsertSort(a, 10); // ShellSort(a, 10); // QuikSort(a, 8); // SelectSort(a, 8); // HeapSort(a,8); // int b[8]; // MergeSort(a,b,0,7); // a for (int i = 0; i < 8; i++) { printf("%d ",a[i]); } } #pragma mark - void BubbleSort(int a[], int n) { for (int i = 0; i < n; i++) for (int j = i+1; j < n; j++) if (a[j] > a[i]) { int temp =a[i]; a[i] = a[j]; a[j] = temp; } } #pragma mark - void QuikSort(int a[], int numsize) { int i=0,j=numsize-1; int val=a[0];/*val*/ if(numsize>1)/*2*/ { while(i<j)/**/ { /*vala[i]*/ for(;j>i;j--) if(a[j]<val) { a[i++]=a[j]; break; } /*vala[j]*/ for(;i<j;i++) if(a[i]>val) { a[j--]=a[i]; break; } } a[i]=val;/*vala[i]*/ QuikSort(a,i);/*i*/ QuikSort(a+i+1,numsize-1-i);/*i+1numsize-1numsize-1-i*/ } } #pragma mark - // void InsertSort(int a[], int n) { int i,j; //2 for(i = 1; i < n; i++) { if(a[i-1] < a[i]) { // temp int temp = a[i]; for(j=i-1; j>=0 && a[j]<temp; j--) a[j+1] =a [j]; // forj-- a[j+1] = temp; } } // int i,j; // // x // int x; // for ( i = 1; i < n; i++) // { // x = a[i]; // for (j = i - 1; j >= 0; j--) // if (a[j] > x) // a[j+1] = a[i]; // // // x // else // break; // // a[j+1] = x; // // } } #pragma mark - // d=512345 // d=212 // d=1 void ShellSort(int a[], int n) { int i,j,d; int x; // d10 d=n/2; while(d>=1) { for(i=d;i < n;i++) { x=a[i]; for(j=i-d;j>=0;j-=d) if(a[j]>x) a[j+d]=a[j]; else break; a[j+d]=x; } // // d1d521 d>>=1; } } #pragma mark - // /* for */ void SelectSort(int a[], int n) { for (int i = 0; i < n; i++) { int k = i; // k for (int j = i+1; j < n; j++) if (a[j] > a[k]) k = j; // a[i]a[i] int temp =a[k]; a[k] = a[i]; a[i] = temp; } } #pragma mark - void HeapSort(int array[],int length) { int tmp; /* , 3210 */ //length/2-1 for(int i=length/2-1;i>=0;--i) HeapAdjust(array,i,length); // for(int i = length-1;i>0;--i) { //() // ///Swap(&array[0],&array[i]); tmp = array[i]; array[i]=array[0]; array[0]=tmp; // heap // a[0] // for(int i=length/2-1;i>=0;--i) // a[1] a[2] HeapAdjust(array,0,i); } } //arrayinlength //iii void HeapAdjust(int array[],int i, int nLength) { int nChild; int nTemp; for(;2*i+1<nLength;i=nChild) { //=2*+1 nChild=2*i+1; // if(nChild<nLength-1 && array[nChild+1]>array[nChild]) ++nChild; // if(array[i]<array[nChild]) { nTemp = array[i]; array[i] = array[nChild]; array[nChild] = nTemp; } else // break; } } #pragma mark - /* */ void Merge(int a[],int b[],int s,int m,int e) { int i,j,k; // mejbsi for(i=m+1,j=s; s<=m && i<=e; j++) { // printf("s:%d m:%d e:%d i:%d j:%d\n",s,m,e,i,j); // b if(a[s] <= a[i]) b[j]=a[s++]; else b[j]=a[i++]; } // smie if(s <= m) { for(k = 0;k <= m-s; k++) b[j+k] = a[s+k]; } // iesm if(i <= e) { for( k=0 ; k<= e-i; k++) b[j+k] = a[i+k]; } } //n+logn void MergeSort(int a[],int b[],int s,int e) { int m, *temp; // if(s == e) { b[s] = a[s]; } else { temp = (int*)malloc((e - s+1)*sizeof(int)); m = (s + e)/2; MergeSort(a, temp, s, m); MergeSort(a, temp, m+1, e); // 037 // printf("s:%d m:%d e:%d \n",s,m,e); Merge(temp, b, s, m, e); } } @end ```
/content/code_sandbox/BigShow1949/Classes/15 - Algorithm(算法)/YFSortVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,748
```objective-c // // DemosListVC.h // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "BaseViewController.h" @interface DemosListVC : BaseViewController @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/DemosListVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
51
```objective-c // // YNPageTestViewController.h // BigShow1949 // // Created by big show on 2018/9/24. // #import "BaseTableViewController.h" @interface YNPageViewDemoController : BaseTableViewController @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/YNPageViewDemoController.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
56
```objective-c // // YNSuspendTopBaseTableViewVC.m // YNPageViewController // // Created by ZYN on 2018/6/25. // #import "YNSuspendTopBaseTableViewVC.h" #import "MJRefresh.h" #import "UIViewController+YNPageExtend.h" /// #define kOpenRefreshHeaderViewHeight 1 @interface YNSuspendTopBaseTableViewVC () @end @implementation YNSuspendTopBaseTableViewVC - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (kOpenRefreshHeaderViewHeight) { if (self.tableView.mj_header.ignoredScrollViewContentInsetTop != self.yn_pageViewController.config.tempTopHeight) { [self addTableViewRefresh]; } } } - (void)viewDidLoad { [super viewDidLoad]; } /// - (void)addTableViewRefresh { __weak typeof (self) weakSelf = self; self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (kOpenRefreshHeaderViewHeight) { [weakSelf suspendTopReloadHeaderViewHeight]; } else { [weakSelf.tableView.mj_header endRefreshing]; } }); }]; self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf.tableView.mj_footer endRefreshing]; }); }]; /// UI self.tableView.mj_header.ignoredScrollViewContentInsetTop = self.yn_pageViewController.config.tempTopHeight; } #pragma mark - Top - (void)suspendTopReloadHeaderViewHeight { /// CGFloat netWorkHeight = 900; __weak typeof (self) weakSelf = self; /// HeaderView [self.tableView.mj_header endRefreshingWithCompletionBlock:^{ YNPageViewController *VC = weakSelf.yn_pageViewController; if (VC.headerView.frame.size.height != netWorkHeight) { VC.headerView.frame = CGRectMake(0, 0, YFScreen.width, netWorkHeight); [VC reloadSuspendHeaderViewFrame]; [weakSelf addTableViewRefresh]; } }]; } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendTopPageVC/YNSuspendTopBaseTableViewVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
493
```objective-c // // SuspendTopPageVC.m // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "YNSuspendTopPageVC.h" #import "SDCycleScrollView.h" #import "BaseTableViewVC.h" #import "YNSuspendTopBaseTableViewVC.h" @interface YNSuspendTopPageVC () <YNPageViewControllerDataSource, YNPageViewControllerDelegate, SDCycleScrollViewDelegate> @property (nonatomic, copy) NSArray *imagesURLs; @end @implementation YNSuspendTopPageVC - (void)viewDidLoad { [super viewDidLoad]; } #pragma mark - Event Response #pragma mark - --Notification Event Response #pragma mark - --Button Event Response #pragma mark - --Gesture Event Response #pragma mark - System Delegate #pragma mark - Custom Delegate #pragma mark - Public Function + (instancetype)suspendTopPageVC { YNPageConfigration *configration = [YNPageConfigration defaultConfig]; configration.pageStyle = YNPageStyleSuspensionTop; configration.headerViewCouldScale = YES; configration.showTabbar = NO; configration.showNavigation = YES; configration.scrollMenu = NO; configration.aligmentModeCenter = NO; configration.lineWidthEqualFontWidth = NO; configration.showBottomLine = YES; YNSuspendTopPageVC *vc = [YNSuspendTopPageVC pageViewControllerWithControllers:[self getArrayVCs] titles:[self getArrayTitles] config:configration]; vc.dataSource = vc; vc.delegate = vc; UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, YFScreen.width, YFScreen.height)]; headerView.layer.contents = (id)[UIImage imageNamed:@"mine_header_bg"].CGImage; /// SDCycleScrollView *autoScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, YFScreen.width, 200) imageURLStringsGroup:vc.imagesURLs]; autoScrollView.delegate = vc; // vc.headerView = autoScrollView; vc.headerView = headerView; // index // vc.pageIndex = 0; return vc; } + (NSArray *)getArrayVCs { YNSuspendTopBaseTableViewVC *vc_1 = [[YNSuspendTopBaseTableViewVC alloc] init]; vc_1.cellTitle = @""; YNSuspendTopBaseTableViewVC *vc_2 = [[YNSuspendTopBaseTableViewVC alloc] init]; vc_2.cellTitle = @""; YNSuspendTopBaseTableViewVC *vc_3 = [[YNSuspendTopBaseTableViewVC alloc] init]; return @[vc_1, vc_2, vc_3]; } + (NSArray *)getArrayTitles { return @[@"", @"", @""]; } #pragma mark - Private Function #pragma mark - Getter and Setter - (NSArray *)imagesURLs { if (!_imagesURLs) { _imagesURLs = @[ @"path_to_url", @"path_to_url", @"path_to_url"]; } return _imagesURLs; } #pragma mark - YNPageViewControllerDataSource - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { YNSuspendTopBaseTableViewVC *vc = pageViewController.controllersM[index]; return [vc tableView]; } #pragma mark - YNPageViewControllerDelegate - (void)pageViewController:(YNPageViewController *)pageViewController contentOffsetY:(CGFloat)contentOffset progress:(CGFloat)progress { // NSLog(@"--- contentOffset = %f, progress = %f", contentOffset, progress); } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendTopPageVC/YNSuspendTopPageVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
799
```objective-c // // DemosListVC.m // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "DemosListVC.h" #import "YNTestPageVC.h" #import "YNTopPageVC.h" #import "YNNavPageVC.h" #import "YNSuspendCenterPageVC.h" #import "YNSuspendTopPageVC.h" #import "YNScrollMenuStyleVC.h" #import "YNLoadPageVC.h" #import "YNSuspendTopPausePageVC.h" #import "YNSuspendCustomNavOrSuspendPositionVC.h" typedef NS_ENUM(NSInteger, YNVCType) { YNVCTypeSuspendCenterPageVC = 1, YNVCTypeSuspendTopPageVC = 2, YNVCTypeTopPageVC = 3, YNVCTypeSuspendTopPausePageVC = 4, YNVCTypeSuspendCustomNavOrSuspendPosition = 5, YNVCTypeNavPageVC = 6, YNVCTypeScrollMenuStyleVC = 7, YNVCTypeLoadPageVC = 8, YNVCTypeYNTestPageVC = 100 }; @interface DemosListVC () <UITableViewDelegate, UITableViewDataSource> @property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) NSMutableArray *dataArrayM; @end @implementation DemosListVC - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Demos"; [self.view addSubview:self.tableView]; self.dataArrayM = @[@{@"title" : @"--", @"type" : @(YNVCTypeSuspendCenterPageVC)}, @{@"title" : @"--", @"type" : @(YNVCTypeSuspendTopPageVC)}, @{@"title" : @"--(QQ)", @"type" : @(YNVCTypeSuspendTopPausePageVC)}, @{@"title" : @"--", @"type" : @(YNVCTypeSuspendCustomNavOrSuspendPosition)}, @{@"title" : @"()", @"type" : @(YNVCTypeLoadPageVC)}, @{@"title" : @"", @"type" : @(YNVCTypeTopPageVC)}, @{@"title" : @"", @"type" : @(YNVCTypeNavPageVC)}, @{@"title" : @"", @"type" : @(YNVCTypeScrollMenuStyleVC)}, @{@"title" : @"", @"type" : @(YNVCTypeYNTestPageVC)} ].mutableCopy; } #pragma mark - UITableViewDelegate UITableViewDataSource - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 0.00001; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return [UIView new]; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.00001; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [UIView new]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.dataArrayM.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 55; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"identifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.textLabel.font = [UIFont systemFontOfSize:16]; } NSDictionary *dict = self.dataArrayM[indexPath.row]; cell.textLabel.text = dict[@"title"]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSDictionary *dict = self.dataArrayM[indexPath.row]; NSString *title = dict[@"title"]; YNVCType type = [dict[@"type"] integerValue]; UIViewController *vc = nil; switch (type) { case YNVCTypeSuspendTopPageVC: { vc = [YNSuspendTopPageVC suspendTopPageVC] ; } break; case YNVCTypeSuspendCenterPageVC: { vc = [YNSuspendCenterPageVC suspendCenterPageVC]; } break; case YNVCTypeSuspendTopPausePageVC: { vc = [YNSuspendTopPausePageVC suspendTopPausePageVC]; } break; case YNVCTypeSuspendCustomNavOrSuspendPosition: { vc = [YNSuspendCustomNavOrSuspendPositionVC new]; } break; case YNVCTypeTopPageVC: { vc = [YNTopPageVC topPageVC]; } break; case YNVCTypeNavPageVC: { vc = [YNNavPageVC navPageVC]; } break; case YNVCTypeLoadPageVC: { vc = [YNLoadPageVC new]; } break; case YNVCTypeScrollMenuStyleVC: { vc = [YNScrollMenuStyleVC new]; } break; case YNVCTypeYNTestPageVC: { vc = [YNTestPageVC testPageVC]; } break; } if (vc) { vc.title = title; [self.navigationController pushViewController:vc animated:YES]; } } - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStyleGrouped]; _tableView.delegate = self; _tableView.dataSource = self; } return _tableView; } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/DemosListVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,276
```objective-c // // YNSuspendTopPageVC.h // YNPageViewController // // Created by ZYN on 2018/6/25. // #import "BasePageViewController.h" @interface YNSuspendTopPageVC : BasePageViewController + (instancetype)suspendTopPageVC; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendTopPageVC/YNSuspendTopPageVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
66
```objective-c // // YNTestBaseVC.h // YNPageViewController // // Created by ZYN on 2018/5/8. // #import <UIKit/UIKit.h> @interface YNTestBaseVC : UIViewController @property (nonatomic, strong) UITableView *tableView; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/TestPageVC/YNTestBaseVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
62
```objective-c // // YNSuspendTopBaseTableViewVC.h // YNPageViewController // // Created by ZYN on 2018/6/25. // #import "BaseTableViewVC.h" @interface YNSuspendTopBaseTableViewVC : BaseTableViewVC @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendTopPageVC/YNSuspendTopBaseTableViewVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
59
```objective-c // // YNTestVC.h // YNPageViewController // // Created by ZYN on 2018/5/8. // #import <UIKit/UIKit.h> #import "YNPageViewController.h" @interface YNTestPageVC : YNPageViewController + (instancetype)testPageVC; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/TestPageVC/YNTestPageVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
68
```objective-c // // YNTestBaseVC.m // YNPageViewController // // Created by ZYN on 2018/5/8. // #import "YNTestBaseVC.h" #import "MJRefresh.h" #import "YNPageTableView.h" @interface YNTestBaseVC () <UITableViewDataSource, UITableViewDelegate> @end @implementation YNTestBaseVC - (void)viewDidLoad { [super viewDidLoad]; UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, YFScreen.width, 200)]; headerView.backgroundColor = [UIColor greenColor]; // self.tableView.tableHeaderView = headerView; [self.view addSubview:self.tableView]; // [self addTableViewRefresh]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)addTableViewRefresh { __weak typeof (self) weakSelf = self; // self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf.tableView.mj_header endRefreshing]; }); }]; self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf.tableView.mj_footer endRefreshing]; }); }]; // self.tableView.mj_header.hidden = YES; // self.tableView.backgroundColor = [UIColor clearColor]; // self.tableView.mj_header.ignoredScrollViewContentInsetTop = 244; } #pragma mark - UITableViewDelegate UITableViewDataSource - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 0.00001; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return [UIView new]; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.00001; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [UIView new]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 5; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 44; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"identifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (!cell) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; } cell.textLabel.text = [NSString stringWithFormat:@" section: %zd row:%zd", indexPath.section, indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } - (UITableView *)tableView { if (!_tableView) { _tableView = [[YNPageTableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; } return _tableView; } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/TestPageVC/YNTestBaseVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
811
```objective-c // // YNTestVC.m // YNPageViewController // // Created by ZYN on 2018/5/8. // #import "YNTestPageVC.h" #import "YNTestBaseVC.h" #import "SDCycleScrollView.h" @interface YNTestPageVC () <YNPageViewControllerDataSource, YNPageViewControllerDelegate, SDCycleScrollViewDelegate> @property (nonatomic, copy) NSArray *imagesURLs; @end @implementation YNTestPageVC - (void)viewDidLoad { [super viewDidLoad]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } //- (void)viewDidLayoutSubviews { // [super viewDidLayoutSubviews]; // // CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height; // if (statusBarHeight == 40.0f) { // self.pageVC.view.yn_y = -20; // self.pageVC.config.suspenOffsetY = 20; // } else { // self.pageVC.view.yn_y = 0; // self.pageVC.config.suspenOffsetY = 0; // } // //} #pragma mark - Event Response #pragma mark - --Notification Event Response #pragma mark - --Button Event Response #pragma mark - --Gesture Event Response #pragma mark - System Delegate #pragma mark - Custom Delegate #pragma mark - Public Function + (instancetype)testPageVC { YNPageConfigration *configration = [YNPageConfigration defaultConfig]; configration.pageStyle = YNPageStyleSuspensionTopPause; // configration.pageStyle = YNPageStyleNavigation; // configration.pageStyle = YNPageStyleTop; configration.headerViewCouldScale = YES; // configration.headerViewScaleMode = YNPageHeaderViewScaleModeCenter; configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop; configration.showTabbar = NO; configration.showNavigation = YES; configration.scrollMenu = NO; configration.aligmentModeCenter = NO; configration.lineWidthEqualFontWidth = NO; // configration.menuWidth = 250; YNTestPageVC *vc = [YNTestPageVC pageViewControllerWithControllers:[self getArrayVCs] titles:[self getArrayTitles] config:configration]; vc.dataSource = vc; vc.delegate = vc; /// SDCycleScrollView *autoScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, YFScreen.width, 200) imageURLStringsGroup:vc.imagesURLs]; autoScrollView.delegate = vc; // UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, YFScreen.width, 200)]; headerView.backgroundColor = [UIColor redColor]; vc.headerView = headerView; // vc.pageIndex = 1; // View // UIImageView *imageViewScale = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, YFScreen.width, 200)]; // imageViewScale.image = [UIImage imageNamed:@"mine_header_bg"]; // vc.scaleBackgroundView = imageViewScale; return vc; } + (NSArray *)getArrayVCs { YNTestBaseVC *vc_1 = [[YNTestBaseVC alloc] init]; YNTestBaseVC *vc_2 = [[YNTestBaseVC alloc] init]; return @[vc_1, vc_2]; } + (NSArray *)getArrayTitles { return @[@"", @""]; } #pragma mark - Private Function #pragma mark - Getter and Setter - (NSArray *)imagesURLs { if (!_imagesURLs) { _imagesURLs = @[ @"path_to_url", @"path_to_url", @"path_to_url"]; } return _imagesURLs; } #pragma mark - YNPageViewControllerDataSource - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { YNTestBaseVC *baseVC = pageViewController.controllersM[index]; return [baseVC tableView]; } #pragma mark - YNPageViewControllerDelegate - (void)pageViewController:(YNPageViewController *)pageViewController contentOffsetY:(CGFloat)contentOffset progress:(CGFloat)progress { // NSLog(@"--- contentOffset = %f, progress = %f", contentOffset, progress); } #pragma mark - SDCycleScrollViewDelegate - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index { NSLog(@"----click index %ld", index); } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/TestPageVC/YNTestPageVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
1,105
```objective-c // // SuspendCenterPageVC.m // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "YNSuspendCenterPageVC.h" #import "SDCycleScrollView.h" #import "BaseTableViewVC.h" #import "BaseCollectionViewVC.h" @interface YNSuspendCenterPageVC () <YNPageViewControllerDataSource, YNPageViewControllerDelegate, SDCycleScrollViewDelegate> @property (nonatomic, copy) NSArray *imagesURLs; @property (nonatomic, copy) NSArray *cacheKeyArray; @end @implementation YNSuspendCenterPageVC - (void)viewDidLoad { [super viewDidLoad]; } #pragma mark - Event Response #pragma mark - --Notification Event Response #pragma mark - --Button Event Response #pragma mark - --Gesture Event Response #pragma mark - System Delegate #pragma mark - Custom Delegate #pragma mark - Public Function + (instancetype)suspendCenterPageVC { YNPageConfigration *configration = [YNPageConfigration defaultConfig]; configration.pageStyle = YNPageStyleSuspensionCenter; configration.headerViewCouldScale = YES; // configration.headerViewScaleMode = YNPageHeaderViewScaleModeCenter; configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop; configration.showTabbar = NO; configration.showNavigation = YES; configration.scrollMenu = NO; configration.aligmentModeCenter = NO; configration.lineWidthEqualFontWidth = true; configration.showBottomLine = YES; return [self suspendCenterPageVCWithConfig:configration]; } + (instancetype)suspendCenterPageVCWithConfig:(YNPageConfigration *)config { YNSuspendCenterPageVC *vc = [YNSuspendCenterPageVC pageViewControllerWithControllers:[self getArrayVCs] titles:[self getArrayTitles] config:config]; vc.dataSource = vc; vc.delegate = vc; /// SDCycleScrollView *autoScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, YFScreen.width, 200) imageURLStringsGroup:vc.imagesURLs]; autoScrollView.delegate = vc; vc.headerView = autoScrollView; /// index vc.pageIndex = 2; return vc; } + (NSArray *)getArrayVCs { BaseTableViewVC *vc_1 = [[BaseTableViewVC alloc] init]; vc_1.cellTitle = @""; BaseTableViewVC *vc_2 = [[BaseTableViewVC alloc] init]; vc_2.cellTitle = @""; BaseCollectionViewVC *vc_3 = [[BaseCollectionViewVC alloc] init]; return @[vc_1, vc_2, vc_3]; } + (NSArray *)getArrayTitles { return @[@"1", @"", @""]; } #pragma mark - Private Function #pragma mark - Getter and Setter - (NSArray *)imagesURLs { if (!_imagesURLs) { _imagesURLs = @[ @"path_to_url", @"path_to_url", @"path_to_url"]; } return _imagesURLs; } - (NSArray *)cacheKeyArray { if (!_cacheKeyArray) { _cacheKeyArray = @[@"1", @"2", @"3"]; } return _cacheKeyArray; } #pragma mark - YNPageViewControllerDataSource - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { UIViewController *vc = pageViewController.controllersM[index]; if ([vc isKindOfClass:[BaseTableViewVC class]]) { return [(BaseTableViewVC *)vc tableView]; } else { return [(BaseCollectionViewVC *)vc collectionView]; } } #pragma mark - YNPageViewControllerDelegate - (void)pageViewController:(YNPageViewController *)pageViewController contentOffsetY:(CGFloat)contentOffset progress:(CGFloat)progress { // NSLog(@"--- contentOffset = %f, progress = %f", contentOffset, progress); } #pragma mark - SDCycleScrollViewDelegate - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index { NSLog(@"----click index %ld", index); } //- (NSString *)pageViewController:(YNPageViewController *)pageViewController customCacheKeyForIndex:(NSInteger)index { // return self.cacheKeyArray[index]; //} @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendCenterPageVC/YNSuspendCenterPageVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
933
```objective-c // // SuspendCenterPageVC.h // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "BasePageViewController.h" #import "YNPageConfigration.h" @interface YNSuspendCenterPageVC : BasePageViewController + (instancetype)suspendCenterPageVC; + (instancetype)suspendCenterPageVCWithConfig:(YNPageConfigration *)config; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/SuspendCenterPageVC/YNSuspendCenterPageVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
91
```objective-c // // BaseViewController.h // YNPageViewController // // Created by ZYN on 2018/6/26. // #import <UIKit/UIKit.h> @interface BaseViewController : UIViewController @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BaseViewController.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
46
```objective-c // // BasePageViewController.h // YNPageViewController // // Created by ZYN on 2018/7/27. // - API #import "YNPageViewController.h" @interface BasePageViewController : YNPageViewController @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BasePageViewController.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
56
```objective-c // // BaseVC.h // YNPageViewController // // Created by ZYN on 2018/6/22. // #import <UIKit/UIKit.h> @interface BaseTableViewVC : UIViewController @property (nonatomic, copy) NSString *cellTitle; @property (nonatomic, strong) UITableView *tableView; - (void)addTableViewRefresh; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BaseTableViewVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
76
```objective-c // // BasePageViewController.m // YNPageViewController // // Created by ZYN on 2018/7/27. // - API #import "BasePageViewController.h" #import "BaseTableViewVC.h" #import "UIView+YNPageExtend.h" #import "FTPopOverMenu.h" @interface BasePageViewController () @end @implementation BasePageViewController #pragma mark - Life Cycle - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonOnClick:event:)]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); } #pragma mark - Event Response #pragma mark - --Notification Event Response #pragma mark - --Button Event Response - (void)rightButtonOnClick:(UIBarButtonItem *)item event:(UIEvent *)event { __weak typeof(self) weakSelf = self; [FTPopOverMenu showFromEvent:event withMenuArray:@[@"", @"", @"", @"", @"", @"reload", @""] doneBlock:^(NSInteger selectedIndex) { switch (selectedIndex) { case 0: { [weakSelf scrollToTop:YES]; } break; case 1: { // [self updateMenuItemTitle:@"" index:0]; [weakSelf updateMenuItemTitles:@[@"", @"", @""]]; } break; case 2: { BaseTableViewVC *vc_1 = [[BaseTableViewVC alloc] init]; vc_1.cellTitle = @""; [weakSelf insertPageChildControllersWithTitles:@[@""] controllers:@[vc_1] index:1]; } break; case 3: { // [self removePageControllerWithTitle:@""]; [weakSelf removePageControllerWithIndex:0]; } break; case 4: { [weakSelf replaceTitlesArrayForSort:@[@"", @"", @""]]; } break; case 5: { weakSelf.titlesM = @[@"", @"", @""].mutableCopy; weakSelf.config.menuHeight = 100; weakSelf.pageIndex = 0; [weakSelf reloadData]; } break; case 6: { weakSelf.headerView.yn_height = 300; [weakSelf reloadData]; } break; } } dismissBlock:nil]; } #pragma mark - --Gesture Event Response #pragma mark - System Delegate #pragma mark - Custom Delegate #pragma mark - Public Function #pragma mark - Private Function #pragma mark - Getter and Setter @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BasePageViewController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
670
```objective-c // // BaseCollectionViewVC.h // YNPageViewController // // Created by ZYN on 2018/6/22. // #import <UIKit/UIKit.h> @interface BaseCollectionViewVC : UIViewController @property (nonatomic, strong) UICollectionView *collectionView; @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BaseCollectionViewVC.h
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
58
```objective-c // // BaseCollectionViewVC.m // YNPageViewController // // Created by ZYN on 2018/6/22. // #import "BaseCollectionViewVC.h" #import "MJRefresh.h" #define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) #define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0] @interface BaseCollectionViewVC () <UICollectionViewDelegate, UICollectionViewDataSource> @end @implementation BaseCollectionViewVC - (void)viewDidLoad { [super viewDidLoad]; [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"id"]; [self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:HeaderID]; [self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:FooterID]; [self.view addSubview:self.collectionView]; [self addCollectionViewRefresh]; } - (void)addCollectionViewRefresh { __weak typeof (self) weakSelf = self; self.collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf.collectionView.mj_header endRefreshing]; }); }]; self.collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf.collectionView.mj_footer endRefreshing]; }); }]; } #pragma mark - UICollectionViewDelegate, UICollectionViewDataSource static NSString *HeaderID = @"header"; static NSString *FooterID = @"footer"; - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { if (kind == UICollectionElementKindSectionHeader) { UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:HeaderID forIndexPath:indexPath]; headerView.backgroundColor = randomColor; return headerView; } else { // UICollectionReusableView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:FooterID forIndexPath:indexPath]; footerView.backgroundColor = randomColor; return footerView; } } /// collectinView section header BUGzPosition = 0.0 - (void)collectionView:(UICollectionView *)collectionView willDisplaySupplementaryView:(UICollectionReusableView *)view forElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath { view.layer.zPosition = 0.0; } - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section { return (CGSize){YFScreen.width * 0.5, 22}; } - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section { return (CGSize){YFScreen.width, 22}; } - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 3; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 20; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"id" forIndexPath:indexPath]; cell.backgroundColor = randomColor; return cell; } - (UICollectionView *)collectionView { if (!_collectionView) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; layout.itemSize = CGSizeMake(100, 100); _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) collectionViewLayout:layout]; _collectionView.dataSource = self; _collectionView.delegate = self; _collectionView.backgroundColor = [UIColor whiteColor]; } return _collectionView; } - (void)dealloc { NSLog(@"----- %@ delloc", self.class); } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BaseCollectionViewVC.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
916
```objective-c // // BaseViewController.m // YNPageViewController // // Created by ZYN on 2018/6/26. // #import "BaseViewController.h" @interface BaseViewController () @end @implementation BaseViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; } @end ```
/content/code_sandbox/BigShow1949/Classes/03 - ViewLayout(视图布局)/YNPageView/Demos/BaseVC/BaseViewController.m
objective-c
2016-05-05T08:19:43
2024-08-07T09:29:21
BigShow1949
BigShow1949/BigShow1949
1,121
70