Skip to content

Commit

Permalink
last
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerMartin committed May 31, 2017
1 parent 788076e commit 4ee35ca
Show file tree
Hide file tree
Showing 593 changed files with 57,306 additions and 467 deletions.
2,263 changes: 2,195 additions & 68 deletions iDearQRCode.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions iDearQRCode/BaseQRCode/BaseModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// BaseModel.h
// iDearQRCode
//
// Created by Mortimer on 17/5/22.
// Copyright © 2017年 Mortimer. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BaseModel : NSObject

@property (nonatomic , copy) NSString * URL;
@property (nonatomic , copy) NSString * name;
@property (nonatomic , copy) NSString * doSometing;
@property (nonatomic , copy) NSString * join_time;

@property (nonatomic , assign) NSInteger count;
@property (nonatomic , assign) CGFloat height;
@property (nonatomic , copy) NSString * pickId;

@end
13 changes: 13 additions & 0 deletions iDearQRCode/BaseQRCode/BaseModel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BaseModel.m
// iDearQRCode
//
// Created by Mortimer on 17/5/22.
// Copyright © 2017年 Mortimer. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

@end
23 changes: 23 additions & 0 deletions iDearQRCode/BaseQRCode/BaseTableViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// BaseTableViewCell.h
// iDearQRCode
//
// Created by Mortimer on 17/5/22.
// Copyright © 2017年 Mortimer. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
selectCellNormal = 0,
selectCellDelete,
selectCellCombine,
selectCellError
} selectCellType;
@interface BaseTableViewCell : UITableViewCell





@end
43 changes: 43 additions & 0 deletions iDearQRCode/BaseQRCode/BaseTableViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// BaseTableViewCell.m
// iDearQRCode
//
// Created by Mortimer on 17/5/22.
// Copyright © 2017年 Mortimer. All rights reserved.
//

#import "BaseTableViewCell.h"


@implementation BaseTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = back_Color;
[self setupDefaultCell];
}
return self;
}

-(void)setupDefaultCell{

}






- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

@end
6 changes: 6 additions & 0 deletions iDearQRCode/BaseQRCode/BaseViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@
titleFont:(UIFont*)titleFont
leftBarButtonItem:(UIBarButtonItem*)leftItem
rightBarButtonItem:(UIBarButtonItem*)rightItem;


/**
刷新ResultVC的数据
*/
-(void)upResultViewData;
@end
119 changes: 111 additions & 8 deletions iDearQRCode/BaseQRCode/BaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,34 @@
//

#import "BaseViewController.h"

@interface BaseViewController ()<UITableViewDelegate , UITableViewDataSource>
#import "ResultDisplayController.h"
#import "UIScrollView+EmptyDataSet.h"
#import "PickDetailVc.h"
#import "PreloadDetailVC.h"
@interface BaseViewController ()<UITableViewDelegate , UITableViewDataSource ,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate,ResultDisplayControllerDelegate>

@property (nonatomic, assign) BOOL statusBarStyle;
@property (nonatomic, assign) BOOL statusBarHidden;
@property (nonatomic , strong) ResultDisplayController * resultVC;

@end

@implementation BaseViewController
static NSString * identifier = @"UITableViewCell" ;
- (void)viewDidLoad {
[super viewDidLoad];

[self setIsExtendLayout:NO];

[self yd_removeNavgationBarLine];
// [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[self setIsExtendLayout:NO];

self.view.backgroundColor = [UIColor colorWithHexString:@"#eff4f4"];
[self yd_removeNavgationBarLine];


if ([self isKindOfClass:NSClassFromString(@"PickingVC")] || [self isKindOfClass:NSClassFromString(@"PreloadViewController")]) {
[self setupSearchView];
}


self.view.backgroundColor = [UIColor colorWithHexString:@"#eff4f4"];
// Do any additional setup after loading the view.
}

Expand All @@ -33,6 +43,47 @@ - (void)didReceiveMemoryWarning {
// Dispose of any resources that can be recreated.
}


-(void)setupSearchView{
ResultDisplayController * result = [[ResultDisplayController alloc] init];
result.delegate = self;
// result.Classtitle = title;
_resultVC = result;
WeakObj(self);
result.upPickStatusStytle=^{
__strong typeof(self) strongSelf = selfWeak;
[strongSelf changeStatusBarStyle:NO statusBarHidden:NO changeStatusBarAnimated:NO];
};
self.searchView = [[UISearchController alloc] initWithSearchResultsController:result];
self.searchView.searchResultsUpdater = result;
result.datas = [self.dataSource mutableCopy];

self.searchView.hidesNavigationBarDuringPresentation = NO;
self.searchView.searchBar.placeholder = @"搜索";

self.searchView.searchBar.tintColor = text_Color1;
self.searchView.searchBar.barTintColor = [UIColor whiteColor];

UIView *searchTextField = nil;

if (iOS7) {
searchTextField = [[[self.searchView.searchBar.subviews firstObject] subviews] lastObject];
}else{
for (UIView * subView in self.searchView.searchBar.subviews) {
if ([subView isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) {
searchTextField = subView;
}
}
}
searchTextField.backgroundColor = back_Color;

}

-(void)upResultViewData{
[_resultVC.datas removeAllObjects];
_resultVC.datas = [self.dataSource mutableCopy];
}

#pragma mark UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
Expand All @@ -54,6 +105,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0.01;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0.01;
}
-(void)setupRightItem:(NSString *)title{
[self removeRightItem];
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
Expand All @@ -79,6 +137,42 @@ -(void)change{

}

#pragma mark ResultDisplayDelegate
-(void)didSelectRow:(NSIndexPath *)indexPath{

[self dismissViewControllerAnimated:NO completion:nil];
if ([self isKindOfClass:NSClassFromString(@"PickingVC")] ) {

PickDetailVc * detail = [[PickDetailVc alloc] init];
[self.navigationController pushViewController:detail animated:YES];
}else if ([self isKindOfClass:NSClassFromString(@"PreloadViewController")]){
PreloadDetailVC * detail = [[PreloadDetailVC alloc] init];
[self.navigationController pushViewController:detail animated:YES];
}

}

#pragma mark DZNEmptyDataSetSource
//返回图片
//-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView{
//
//}
//返回标题文字
-(NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView{
NSString *text = @"没有数据";
NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:18.0], NSForegroundColorAttributeName: text_Color1};
return [[NSAttributedString alloc] initWithString:text attributes:attribute];
}
//空白区域点击事件
-(void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view{

}

-(UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView{

return back_Color;
}

#pragma mark - private
/**
* 去除nav 上的line
Expand Down Expand Up @@ -193,14 +287,18 @@ - (void)layoutNavigationBar:(UIImage*)backGroundImage

- (UITableView * )tableView{
if (!_tableView){
_tableView = [[UITableView alloc] init];
_tableView = [[UITableView alloc] init];//WithFrame:[UIScreen mainScreen].bounds style:UITableViewStyleGrouped
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableFooterView = [UIView new];
// 4.设置我们分割线颜色(clearColor相当于取消系统分割线)
// self.tableView.separatorColor = [UIColor clearColor];
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:identifier];
_tableView.backgroundColor = [UIColor colorWithHexString:@"#eff4f4"];
_tableView.emptyDataSetSource = self;
_tableView.emptyDataSetDelegate = self;
// self.tableView.sectionFooterHeight = 0.01f;
_tableView.showsVerticalScrollIndicator = NO;
// 5.设置分割线样式
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
Expand Down Expand Up @@ -228,6 +326,11 @@ - (BOOL)prefersStatusBarHidden {

return self.statusBarHidden;
}

-(void)dealloc{
_resultVC.delegate = nil;
NSLog(@"%@",[self class]);
}
//-(UIStatusBarStyle)preferredStatusBarStyle{
// return UIStatusBarStyleLightContent;
//}
Expand Down
7 changes: 5 additions & 2 deletions iDearQRCode/MainVC/QRCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#import "QRCViewController.h"
#import "SheetView.h"
#import "personViewController.h"
#import "UIImage+Normalimage.h"
#import "UIImage+Common.h"

#import "PickingVC.h"
#import "PreloadViewController.h"
@interface QRCViewController ()
{
UIView *_autoMarginViews;
Expand Down Expand Up @@ -112,7 +113,9 @@ -(void)clickAction:(UIButton *)sender{
break;
case 1:
{
NSLog(@"1");
PreloadViewController * preload = [[PreloadViewController alloc] init];
[self.navigationController pushViewController:preload animated:YES];

}
break;
case 2:
Expand Down
Loading

0 comments on commit 4ee35ca

Please sign in to comment.