-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostFooterView.h
93 lines (68 loc) · 2.77 KB
/
PostFooterView.h
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
//
// PAPpostFooterView2.h
// Teamstory
//
//
typedef enum {
PAPPhotoHeaderButtonsNone2 = 0,
PAPPhotoHeaderButtonsLike2 = 1 << 0,
PAPPhotoHeaderButtonsComment2 = 1 << 1,
PAPPhotoHeaderButtonsUser2 = 1 << 2,
PAPPhotoHeaderButtonsDefault2 = PAPPhotoHeaderButtonsLike2 | PAPPhotoHeaderButtonsComment2 | PAPPhotoHeaderButtonsUser2
} PAPPhotoHeaderButtons2;
@protocol PostFooterViewDelegate;
@interface PostFooterView : UIView
/*! @name Creating Photo Header View */
/*!
Initializes the view with the specified interaction elements.
@param buttons A bitmask specifying the interaction elements which are enabled in the view
*/
- (id)initWithFrame:(CGRect)frame buttons:(PAPPhotoHeaderButtons2)otherButtons;
/// The photo associated with this view
@property (nonatomic,strong) PFObject *photo;
/// The bitmask which specifies the enabled interaction elements in the view
@property (nonatomic, readonly, assign) PAPPhotoHeaderButtons2 buttons;
/*! @name Accessing Interaction Elements */
/// The Like Photo button
@property (nonatomic,readonly) UIButton *likeButton;
@property (nonatomic,strong) UILabel *likeTitle;
@property (nonatomic,strong) UILabel *likeCountLabel;
/// The Comment On Photo button
@property (nonatomic,readonly) UIButton *commentButton;
@property (nonatomic, strong) UILabel *commentTitle;
@property (nonatomic,strong) UILabel *commentCountLabel;
/*! @name Delegate */
@property (nonatomic,weak) id <PostFooterViewDelegate> delegate;
/*! @name Modifying Interaction Elements Status */
/*!
Configures the Like Button to match the given like status.
@param liked a BOOL indicating if the associated photo is liked by the user
*/
- (void)setLikeStatus:(BOOL)liked;
/*!
Enable the like button to start receiving actions.
@param enable a BOOL indicating if the like button should be enabled.
*/
- (void)shouldEnableLikeButton:(BOOL)enable;
- (void)setLikeCount:(NSNumber *)count;
- (void)setCommentCount:(NSNumber *)count;
@end
/*!
The protocol defines methods a delegate of a PostFooterViewDelegate should implement.
All methods of the protocol are optional.
*/
@protocol PostFooterViewDelegate <NSObject>
@optional
/*!
Sent to the delegate when the like photo button is tapped
@param photo the PFObject for the photo that is being liked or disliked
*/
- (void)postFooterView:(PostFooterView *)postFooterView didTapLikePhotoButton:(UIButton *)button photo:(PFObject *)photo;
/*!
Sent to the delegate when the comment on photo button is tapped
@param photo the PFObject for the photo that will be commented on
*/
- (void)postFooterView:(PostFooterView *)postFooterView didTapCommentForPost:(PFObject *)post;
- (void) moreActionButton_inflator:(PFUser *)user photo:(PFObject *)photo;
- (void) shareButton:(PFUser *)shareUser setPhoto:(PFObject *)photo;
@end