FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Coding-iOS/Coding_iOS/Controllers/Topic/CSLikesVC.m at master · codingYWJ/Coding-iOS · GitHub
codingYWJ
/
Coding-iOS
Public
forked from
coding/Coding-iOS
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Coding-iOS
/
Coding_iOS
/
Controllers
/
Topic
/
CSLikesVC.m
Copy path
More file actions
More file actions
Latest commit
History
History
History
108 lines (89 loc) · 3.58 KB
Breadcrumbs
Coding-iOS
/
Coding_iOS
/
Controllers
/
Topic
/
CSLikesVC.m
Copy path
File metadata and controls
108 lines (89 loc) · 3.58 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//
//
CSLikesVC.m
//
Coding_iOS
//
//
Created by pan Shiyu on 15/7/27.
//
Copyright (c) 2015年 Coding. All rights reserved.
//
#
import
"
CSLikesVC.h
"
#
import
"
User.h
"
#
import
"
UserCell.h
"
#
import
"
UserInfoViewController.h
"
#
import
"
Coding_NetAPIManager.h
"
#
import
"
ODRefreshControl.h
"
@interface
CSLikesVC
()
@property
(
strong
,
nonatomic
) UITableView *myTableView;
@property
(
strong
,
nonatomic
)
NSMutableArray
*searchResults;
@property
(
strong
,
nonatomic
) ODRefreshControl *myRefreshControl;
@property
(
nonatomic
,
strong
)
NSArray
*userlist;
@end
@implementation
CSLikesVC
- (
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self.
title
=
@"
全部参与者
"
;
_myTableView = ({
UITableView *tableView = [[UITableView
alloc
]
initWithFrame:
self
.view.bounds
style:
UITableViewStylePlain];
tableView.
backgroundColor
= [UIColor
clearColor
];
[tableView
registerClass:
[UserCell
class
]
forCellReuseIdentifier:
kCellIdentifier_UserCell
];
tableView.
delegate
= self;
tableView.
dataSource
= self;
tableView.
separatorStyle
= UITableViewCellSeparatorStyleNone;
[
self
.view
addSubview:
tableView];
[tableView
mas_makeConstraints:
^(MASConstraintMaker *make) {
make.
edges
.
equalTo
(self.
view
);
}];
tableView;
});
//
_myRefreshControl = [[ODRefreshControl alloc] initInScrollView:self.myTableView];
//
[_myRefreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
_userlist = @[];
[
self
refresh
];
}
- (
void
)
refresh
{
[[Coding_NetAPIManager
sharedManager
]
request_JoinedUsers_WithTopicID:
_topicID
page:
1
andBlock:
^(
NSArray
*datalist,
NSError
*error) {
if
(datalist) {
//
NSMutableArray *fiteredList = [NSMutableArray array];
//
[datalist enumerateObjectsUsingBlock:^(User *obj, NSUInteger idx, BOOL *stop) {
//
if ([Login curLoginUser] && [obj.global_key isEqualToString:[Login curLoginUser].global_key]) {
//
//
}else{
//
[fiteredList addObject:obj];
//
}
//
}];
self.
userlist
= datalist;
[
self
.myTableView
reloadData
];
}
}];
}
- (
void
)
dealloc
{
_myTableView.
delegate
=
nil
;
_myTableView.
dataSource
=
nil
;
}
#
pragma mark
Table M
- (
NSInteger
)
tableView
:
(UITableView *)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_userlist.
count
;
}
- (UITableViewCell *)
tableView
:
(UITableView *)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*)
indexPath
{
UserCell *cell = [tableView
dequeueReusableCellWithIdentifier:
kCellIdentifier_UserCell
];
if
(cell ==
nil
) {
cell = [[UserCell
alloc
]
initWithStyle:
UITableViewCellStyleDefault
reuseIdentifier:
kCellIdentifier_UserCell
];
}
User *curUser = [_userlist
objectAtIndex:
indexPath.row];
cell.
bounds
=
CGRectMake
(
0
,
0
,
kScreen_Width
, [UserCell
cellHeight
]);
cell.
curUser
= curUser;
cell.
usersType
= UsersTypeTweetLikers;
[tableView
addLineforPlainCell:
cell
forRowAtIndexPath:
indexPath
withLeftSpace:
60
];
return
cell;
}
- (CGFloat)
tableView
:
(UITableView *)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*)
indexPath
{
return
[UserCell
cellHeight
];
}
- (
void
)
tableView
:
(UITableView *)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*)
indexPath
{
[tableView
deselectRowAtIndexPath:
indexPath
animated:
YES
];
User *user = [_userlist
objectAtIndex:
indexPath.row];
UserInfoViewController *vc = [[UserInfoViewController
alloc
]
init
];
vc.
curUser
= user;
[
self
.navigationController
pushViewController:
vc
animated:
YES
];
}
@end
Back
|
FazBrowse Home
|
New Git URL