创建项目,导入base,及使用方法

basetools 提取码: au2k

1、设置Default.pch的位置,填写【$(SRCROOT)/项目名称/上级文件夹名称/Default.pch】。

设置pch文件路径

2、自己封装的、从下往上弹出的视图,使用方法:

BottomPopView *popView = [[BottomPopView alloc] init];

[popView show];

popView.clickBlock^(NSIntegerindex) {//do something};

3、下拉刷新、上拉加载更多

self.baseTableView.mj_header = [SHomeRefreshHeaderBlue headerWithRefreshingBlock:^{

        [wself loadData];

    }];

    self.baseTableView.mj_footer = [SHomeRefreshFooterBlue footerWithRefreshingBlock:^{

        [selfloadDataMore];

    }];

4、MSMenuBarController使用方法:

1)创建目标VC,继承MSMenuBarController;

2).h 文件设置多个VC的类型名称:

typedefNS_ENUM(NSInteger) {

    ViewControllerType1       =0,//VC1

    ViewControllerType2        =1,//VC2

}ViewControllerType;

3)声明这个类型

@property (nonatomic) ViewControllerType tabType;

4)签署协议UTabScrollViewDelegate;

5)创建多个控制器:

[self ___setViewControllers];

- (void)___setViewControllers {

    if (_vc1 && _vc2) {

        return;

    }

    // 1.初始化子视图控制器

    _vc1 = U_CreateController(ViewController1); 

   _vc2 = U_CreateController(ViewController2);

self.viewControllers = @[_vc1,_vc2];

    // 2.创建标题视图

    NSArray*arrayMenuTitles =@[@"标题1",@"标题2"];

    _tabScrollView = [[UTabScrollView alloc] initWithFrame:CGRectMake(0, k_status_height + kScreenWidth *211/375, kScreenWidth,51)];

    _tabScrollView.isScroll =NO;

    _tabScrollView.isDefaultHeight =YES;

    _tabScrollView.colorDefault = [UIColor colorWithHexString:@"#666666"];

    _tabScrollView.colorSelected = [UIColor colorWithHexString:@"#FF912C"];

    _tabScrollView.fontDefault = k_font_regular(15);

    _tabScrollView.fontSelected = k_font_medium(16);

    _tabScrollView.imageBottomLine = [UIImage imageNamed:@"tab_selected_line"];

    _tabScrollView.backgroundColor = [UIColor clearColor];

    _tabScrollView.tabScrollViewDelegate =self;

    _tabScrollView.tites = arrayMenuTitles;

    [self.view addSubview:_tabScrollView];

    _tabScrollView.defualtIndex = _tabType;

    // 3.禁用滑动视图

    self.scrollView.scrollEnabled = YES;

}

#pragma mark - UTabScrollViewDelegate

- (void)tabScrollView:(UTabScrollView *)tabScrollViewbuttonTitleClicked:(UIButton*)button {

    _tabType = button.tag - kTag_scroll_tab_button;

    self.selectedIndex = _tabType;

}

#pragma mark- 重写方法

- (void)setSelectedIndex:(NSInteger)selectedIndex {

    [supersetSelectedIndex:selectedIndex];

    //改变选中图片的位置

    _tabType= selectedIndex;

    _tabScrollView.defualtIndex = selectedIndex;

    [self refreshOrderListData];

}

5、监测网络Reachability

1)AppDelegate.h 文件 导入 #import "Reachability.h",声明:

@property (nonatomic) NetworkStatus networkStatusCurrent;

@property (nonatomic, strong) Reachability *reachability;

2)AppDelegate.m 文件

//检测网络

    [self ___startNotificationNetwork];

#pragma mark - network listen

-(void)___startNotificationNetwork {

    _reachability = [Reachability reachabilityForInternetConnection];

    [_reachability startNotifier];

    [[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(___reachabilityChanged:)name:kReachabilityChangedNotificationobject:nil];


    [self checkNetwork];

}

// 连接改变NOTIFICATION_NotWIFI

- (void)___reachabilityChanged: (NSNotification* )note {

    Reachability* curReach = [noteobject];

    NetworkStatusstatus = [curReachcurrentReachabilityStatus];

    [self ___networkNotificationUpdateWithStatus:status];

}

- (void)checkNetwork {

    NetworkStatus status = [_reachability currentReachabilityStatus];

    [self ___networkNotificationUpdateWithStatus:status];

}

- (void)___networkNotificationUpdateWithStatus:(NetworkStatus)status {

    self.networkStatusCurrent = status;

}

6、

你可能感兴趣的:(创建项目,导入base,及使用方法)