Skip to content

Commit a926a56

Browse files
committed
second
1 parent ccc2a64 commit a926a56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+28008
-3
lines changed

Weibo/.DS_Store

0 Bytes
Binary file not shown.

Weibo/Weibo.xcodeproj/project.pbxproj

+814
Large diffs are not rendered by default.

Weibo/Weibo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Weibo/Weibo.xcworkspace/contents.xcworkspacedata

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Weibo/Weibo/QYAccessToken.m

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ +(NSString *)getFilePath{
6666
//1.获取沙盒目录
6767
NSString *documentsPath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
6868
//2.合并路径
69-
7069
return [documentsPath stringByAppendingPathComponent:@"AccessToken"];
7170

7271
}

Weibo/Weibo/QYHomeVC.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ -(NSArray *)statusArray{
4141
-(void)requestHomeList{
4242
//GET请求方法
4343
//1合并URL
44-
NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"%@?access_token=%@",[BASEURL stringByAppendingPathComponent:GETHOMELISTPATH],[QYAccessToken shareHandel].access_token]];
44+
NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"%@?access_token=%@&page=1",[BASEURL stringByAppendingPathComponent:GETHOMELISTPATH],[QYAccessToken shareHandel].access_token]];
4545
//2.请求数据
4646
__weak QYHomeVC *home=self;
4747
NSURLSession *seession=[NSURLSession sharedSession];

Weibo/Weibo/QYLoginVc.m

-1
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,3 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
192192
*/
193193

194194
@end
195-
"MTm

Weibo/Weibo/QYMainVC.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// QYMainVC.h
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/13.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface QYMainVC : UITabBarController
12+
13+
@end

Weibo/Weibo/QYMainVC.m

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// QYMainVC.m
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/13.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import "QYMainVC.h"
10+
11+
@interface QYMainVC ()
12+
13+
@end
14+
15+
@implementation QYMainVC
16+
17+
- (void)viewDidLoad {
18+
[super viewDidLoad];
19+
20+
//设置中间的 + 号
21+
[self setTabBar];
22+
// Do any additional setup after loading the view.
23+
}
24+
25+
-(void)setTabBar{
26+
CGFloat btnW = 50;
27+
CGFloat btnH = 40;
28+
CGFloat btnX = self.tabBar.center.x - btnW / 2.0;
29+
CGFloat btnY = (CGRectGetHeight(self.tabBar.frame) - btnH) / 2.0;
30+
//创建并添加btn
31+
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
32+
[self.tabBar addSubview:btn];
33+
btn.frame = CGRectMake(btnX, btnY, btnW, btnH);
34+
35+
//设置背景颜色
36+
[btn setBackgroundColor:[UIColor orangeColor]];
37+
//设置图片
38+
[btn setImage:[UIImage imageNamed:@"tabbar_compose_icon_add"] forState:UIControlStateNormal];
39+
//添加事件监听
40+
[btn addTarget:self action:@selector(composeAction:) forControlEvents:UIControlEventTouchUpInside];
41+
//设置圆角
42+
btn.layer.cornerRadius = 5;
43+
btn.layer.masksToBounds = YES;
44+
}
45+
46+
-(void)composeAction:(UIButton *)composeItme{
47+
48+
}
49+
- (void)didReceiveMemoryWarning {
50+
[super didReceiveMemoryWarning];
51+
// Dispose of any resources that can be recreated.
52+
}
53+
54+
/*
55+
#pragma mark - Navigation
56+
57+
// In a storyboard-based application, you will often want to do a little preparation before navigation
58+
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
59+
// Get the new view controller using [segue destinationViewController].
60+
// Pass the selected object to the new view controller.
61+
}
62+
*/
63+
64+
@end

Weibo/Weibo/QYMessageVC.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// QYMessageVC.h
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/14.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface QYMessageVC : UITableViewController
12+
13+
@end

Weibo/Weibo/QYMessageVC.m

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//
2+
// QYMessageVC.m
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/14.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import "QYMessageVC.h"
10+
11+
@interface QYMessageVC ()
12+
13+
@end
14+
15+
@implementation QYMessageVC
16+
17+
- (void)viewDidLoad {
18+
[super viewDidLoad];
19+
20+
// Uncomment the following line to preserve selection between presentations.
21+
// self.clearsSelectionOnViewWillAppear = NO;
22+
23+
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
24+
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
25+
}
26+
27+
- (void)didReceiveMemoryWarning {
28+
[super didReceiveMemoryWarning];
29+
// Dispose of any resources that can be recreated.
30+
}
31+
32+
#pragma mark - Table view data source
33+
34+
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
35+
return 0;
36+
}
37+
38+
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
39+
#warning Incomplete implementation, return the number of rows
40+
return 0;
41+
}
42+
43+
/*
44+
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
45+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
46+
47+
// Configure the cell...
48+
49+
return cell;
50+
}
51+
*/
52+
53+
/*
54+
// Override to support conditional editing of the table view.
55+
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
56+
// Return NO if you do not want the specified item to be editable.
57+
return YES;
58+
}
59+
*/
60+
61+
/*
62+
// Override to support editing the table view.
63+
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
64+
if (editingStyle == UITableViewCellEditingStyleDelete) {
65+
// Delete the row from the data source
66+
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
67+
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
68+
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
69+
}
70+
}
71+
*/
72+
73+
/*
74+
// Override to support rearranging the table view.
75+
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
76+
}
77+
*/
78+
79+
/*
80+
// Override to support conditional rearranging of the table view.
81+
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
82+
// Return NO if you do not want the item to be re-orderable.
83+
return YES;
84+
}
85+
*/
86+
87+
/*
88+
#pragma mark - Navigation
89+
90+
// In a storyboard-based application, you will often want to do a little preparation before navigation
91+
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
92+
// Get the new view controller using [segue destinationViewController].
93+
// Pass the selected object to the new view controller.
94+
}
95+
*/
96+
97+
@end

Weibo/Weibo/QYMySelfVC.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// QYMySelfVC.h
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/14.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface QYMySelfVC : UITableViewController
12+
13+
@end

Weibo/Weibo/QYMySelfVC.m

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
//
2+
// QYMySelfVC.m
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/5/14.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import "QYMySelfVC.h"
10+
11+
@interface QYMySelfVC ()
12+
@property (weak, nonatomic) IBOutlet UIView *headerView;
13+
14+
@property (strong, nonatomic) UIImageView *imageView;
15+
16+
@property (nonatomic) CGRect bgFrame;
17+
18+
@end
19+
20+
@implementation QYMySelfVC
21+
22+
-(UIImageView *)imageView{
23+
if (_imageView == nil) {
24+
_imageView = [[UIImageView alloc] initWithFrame:_headerView.bounds];
25+
_imageView.contentMode = UIViewContentModeScaleAspectFill;
26+
_imageView.image = [UIImage imageNamed:@"headerView"];
27+
_imageView.clipsToBounds = YES;
28+
}
29+
return _imageView;
30+
}
31+
32+
- (void)viewDidLoad {
33+
[super viewDidLoad];
34+
35+
}
36+
37+
//视图已经显示的时候调用
38+
-(void)viewDidAppear:(BOOL)animated{
39+
[super viewDidAppear:animated];
40+
[_headerView addSubview:self.imageView];
41+
_bgFrame = self.imageView.frame;
42+
}
43+
44+
#pragma mark -UIScrollViewDelegate
45+
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
46+
CGPoint offset = self.tableView.contentOffset;
47+
48+
NSInteger offsetY = -offset.y;
49+
50+
if (offsetY > 0) {
51+
CGRect frame = self.bgFrame;
52+
frame.size.height += offsetY;
53+
frame.origin.y -= offsetY;
54+
self.imageView.frame = frame;
55+
}
56+
}
57+
58+
#pragma mark - Table view data source
59+
60+
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
61+
#warning Incomplete implementation, return the number of sections
62+
return 0;
63+
}
64+
65+
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
66+
#warning Incomplete implementation, return the number of rows
67+
return 0;
68+
}
69+
70+
/*
71+
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
72+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
73+
74+
// Configure the cell...
75+
76+
return cell;
77+
}
78+
*/
79+
80+
/*
81+
// Override to support conditional editing of the table view.
82+
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
83+
// Return NO if you do not want the specified item to be editable.
84+
return YES;
85+
}
86+
*/
87+
88+
/*
89+
// Override to support editing the table view.
90+
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
91+
if (editingStyle == UITableViewCellEditingStyleDelete) {
92+
// Delete the row from the data source
93+
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
94+
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
95+
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
96+
}
97+
}
98+
*/
99+
100+
/*
101+
// Override to support rearranging the table view.
102+
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
103+
}
104+
*/
105+
106+
/*
107+
// Override to support conditional rearranging of the table view.
108+
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
109+
// Return NO if you do not want the item to be re-orderable.
110+
return YES;
111+
}
112+
*/
113+
114+
/*
115+
#pragma mark - Navigation
116+
117+
// In a storyboard-based application, you will often want to do a little preparation before navigation
118+
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
119+
// Get the new view controller using [segue destinationViewController].
120+
// Pass the selected object to the new view controller.
121+
}
122+
*/
123+
124+
@end

Weibo/Weibo/QYSetingVC.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// QYSetingVC.h
3+
// Weibo
4+
//
5+
// Created by qingyun on 16/6/20.
6+
// Copyright © 2016年 QingYun. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface QYSetingVC : UITableViewController
12+
13+
@end

0 commit comments

Comments
 (0)