| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | 27 | #import "CSSearchVC.h" | |
| 28 | 28 | #import "CSSearchDisplayVC.h" | |
| 29 | + #import "FunctionTipsManager.h" | ||
| 29 | 30 | ||
| 30 | 31 | @interface Tweet_RootViewController () <UISearchBarDelegate, UISearchDisplayDelegate> | |
| 31 | 32 | { | |
@@ -99,9 +100,7 @@ - (void)viewDidLoad | |||
| 99 | 100 | // [self refreshFirst]; | |
| 100 | 101 | // }]; | |
| 101 | 102 | ||
| 102 | - BOOL isBadgeValid = ![CSSearchModel hasSearchBadgeShown]; | ||
| 103 | - isBadgeValid = YES; | ||
| 104 | - UIBarButtonItem *leftBarItem =[UIBarButtonItem itemWithIcon:@"search_Nav" showBadge:isBadgeValid target:self action:@selector(searchItemClicked:)]; | ||
| 103 | + UIBarButtonItem *leftBarItem =[UIBarButtonItem itemWithIcon:@"search_Nav" showBadge:NO target:self action:@selector(searchItemClicked:)]; | ||
| 105 | 104 | [self.parentViewController.navigationItem setLeftBarButtonItem:leftBarItem animated:NO]; | |
| 106 | 105 | ||
| 107 | 106 | _tweetsDict = [[NSMutableDictionary alloc] initWithCapacity:4]; | |
@@ -152,13 +151,10 @@ - (void)viewDidAppear:(BOOL)animated{ | |||
| 152 | 151 | [super viewDidAppear:animated]; | |
| 153 | 152 | ||
| 154 | 153 | UIButton *leftItemView = (UIButton *)self.parentViewController.navigationItem.leftBarButtonItem.customView; | |
| 155 | - if(![CSSearchModel hasClickedNewFeatureWithType:CSSNewFeatureTypeSearch]) { | ||
| 156 | - | ||
| 154 | + if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_Search]) { | ||
| 157 | 155 | [leftItemView addBadgePoint:3 withPointPosition:CGPointMake(35, 10)]; | |
| 158 | 156 | } | |
| 159 | 157 | ||
| 160 | - // [leftItemView addBadgePoint:3 withPosition:BadgePositionTypeDefault]; | ||
| 161 | - | ||
| 162 | 158 | [self refreshFirst]; | |
| 163 | 159 | ||
| 164 | 160 | // 键盘 | |
@@ -264,10 +260,11 @@ - (void)deleteComment:(Comment *)comment ofTweet:(Tweet *)tweet{ | |||
| 264 | 260 | #pragma mark - search | |
| 265 | 261 | ||
| 266 | 262 | - (void)searchItemClicked:(id)sender{ | |
| 267 | - | ||
| 268 | - UIButton *leftItemView = (UIButton *)self.parentViewController.navigationItem.leftBarButtonItem.customView; | ||
| 269 | - [CSSearchModel clickNewFeatureWithType:CSSNewFeatureTypeSearch]; | ||
| 270 | - [leftItemView removeBadgePoint]; | ||
| 263 | + if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_Search]) { | ||
| 264 | + [[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_Search]; | ||
| 265 | + UIButton *leftItemView = (UIButton *)self.parentViewController.navigationItem.leftBarButtonItem.customView; | ||
| 266 | + [leftItemView removeBadgePoint]; | ||
| 267 | + } | ||
| 271 | 268 | ||
| 272 | 269 | if(!_searchBar) { | |
| 273 | 270 | ||
@@ -303,13 +300,6 @@ - (void)searchItemClicked:(id)sender{ | |||
| 303 | 300 | [self hideToolBar:YES]; | |
| 304 | 301 | [_searchBar becomeFirstResponder]; | |
| 305 | 302 | ||
| 306 | - // BOOL isBadgeValid = ![CSSearchModel hasSearchBadgeShown]; | ||
| 307 | - // if (isBadgeValid) { | ||
| 308 | - // //存一下 | ||
| 309 | - // [CSSearchModel invalidSearchBadge]; | ||
| 310 | - // UIBarButtonItem *leftBarItem =[UIBarButtonItem itemWithIcon:@"search_Nav" showBadge:NO target:self action:@selector(searchItemClicked:)]; | ||
| 311 | - // [self.navigationItem setLeftBarButtonItem:leftBarItem animated:NO]; | ||
| 312 | - // } | ||
| 313 | 303 | } | |
| 314 | 304 | ||
| 315 | 305 | #pragma mark Refresh M | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,21 +8,9 @@ | |||
| 8 | 8 | ||
| 9 | 9 | #import <Foundation/Foundation.h> | |
| 10 | 10 | ||
| 11 | - typedef NS_ENUM(NSInteger, CSSNewFeatureType) { | ||
| 12 | - | ||
| 13 | - CSSNewFeatureTypeTopic = 0, | ||
| 14 | - CSSNewFeatureTypeSearch, | ||
| 15 | - CSSNewFeatureTypeHotTopic | ||
| 16 | - }; | ||
| 17 | 11 | ||
| 18 | 12 | @interface CSSearchModel : NSObject | |
| 19 | 13 | ||
| 20 | - + (BOOL)hasClickedNewFeatureWithType:(CSSNewFeatureType)type; | ||
| 21 | - + (void)clickNewFeatureWithType:(CSSNewFeatureType)type; | ||
| 22 | - | ||
| 23 | - + (BOOL)hasSearchBadgeShown; | ||
| 24 | - + (void)invalidSearchBadge; | ||
| 25 | - | ||
| 26 | 14 | + (NSArray *)getSearchHistory; | |
| 27 | 15 | + (void)addSearchHistory:(NSString *)searchString; | |
| 28 | 16 | + (void)cleanAllSearchHistory; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,34 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | 16 | @implementation CSSearchModel | |
| 17 | 17 | ||
| 18 | - + (BOOL)hasClickedNewFeatureWithType:(CSSNewFeatureType)type { | ||
| 19 | - | ||
| 20 | - NSString *key = [kNewFeature stringByAppendingString:[NSString stringWithFormat:@"_%ld", (long)type]]; | ||
| 21 | - id hasClicked = [[TMCache TemporaryCache] objectForKey:key]; | ||
| 22 | - if(!hasClicked) { | ||
| 23 | - | ||
| 24 | - [[TMCache TemporaryCache] setObject:@(NO) forKey:key]; | ||
| 25 | - }else { | ||
| 26 | - | ||
| 27 | - return [hasClicked boolValue]; | ||
| 28 | - } | ||
| 29 | - return NO; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - + (void)clickNewFeatureWithType:(CSSNewFeatureType)type { | ||
| 33 | - | ||
| 34 | - NSString *key = [kNewFeature stringByAppendingString:[NSString stringWithFormat:@"_%ld", (long)type]]; | ||
| 35 | - [[TMCache TemporaryCache] setObject:@(YES) forKey:key]; | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - + (BOOL)hasSearchBadgeShown { | ||
| 39 | - BOOL hasShown = [[[TMCache TemporaryCache] objectForKey:kHasSearchBadgeShown] boolValue]; | ||
| 40 | - return hasShown; | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - + (void)invalidSearchBadge{ | ||
| 44 | - [[TMCache TemporaryCache] setObject:@(YES) forKey:kHasSearchBadgeShown]; | ||
| 45 | - } | ||
| 46 | 18 | ||
| 47 | 19 | + (NSArray *)getSearchHistory { | |
| 48 | 20 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,13 @@ static NSString *kFunctionTipStr_MR = @"MergeRequest"; | |||
| 11 | 11 | static NSString *kFunctionTipStr_PR = @"PullRequest"; | |
| 12 | 12 | static NSString *kFunctionTipStr_ReadMe = @"ReadMe"; | |
| 13 | 13 | static NSString *kFunctionTipStr_CommitList = @"Code_CommitList"; | |
| 14 | + static NSString *kFunctionTipStr_Search = @"hasSearch"; | ||
| 15 | + static NSString *kFunctionTipStr_HotTopic = @"HotTopic"; | ||
| 16 | + static NSString *kFunctionTipStr_TweetTopic = @"TweetTopic"; | ||
| 14 | 17 | ||
| 18 | + //CSSNewFeatureTypeTopic = 0, | ||
| 19 | + //CSSNewFeatureTypeSearch, | ||
| 20 | + //CSSNewFeatureTypeHotTopic | ||
| 15 | 21 | ||
| 16 | 22 | #import <Foundation/Foundation.h> | |
| 17 | 23 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,9 @@ - (instancetype)init | |||
| 36 | 36 | // kFunctionTipStr_PR: @(YES), | |
| 37 | 37 | // kFunctionTipStr_ReadMe: @(YES), | |
| 38 | 38 | // kFunctionTipStr_CommitList: @(YES), | |
| 39 | + kFunctionTipStr_Search: @(YES), | ||
| 40 | + kFunctionTipStr_HotTopic: @(YES), | ||
| 41 | + kFunctionTipStr_TweetTopic: @(YES), | ||
| 39 | 42 | } mutableCopy]; | |
| 40 | 43 | [_tipsDict writeToFile:[self p_cacheFilePath] atomically:YES]; | |
| 41 | 44 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ | |||
| 13 | 13 | #import "TweetSendTextCell.h" | |
| 14 | 14 | #import "UsersViewController.h" | |
| 15 | 15 | #import "CSTopicCreateVC.h" | |
| 16 | - #import "CSSearchModel.h" | ||
| 16 | + #import "FunctionTipsManager.h" | ||
| 17 | 17 | ||
| 18 | 18 | @interface TweetSendTextCell () <AGEmojiKeyboardViewDelegate, AGEmojiKeyboardViewDataSource> | |
| 19 | 19 | @property (strong, nonatomic) AGEmojiKeyboardView *emojiKeyboardView; | |
@@ -127,8 +127,8 @@ - (UIView *)keyboardToolBar{ | |||
| 127 | 127 | UIButton *atButton = [self toolButtonWithToolBarFrame:keyboardToolBar.frame index:3 imageStr:@"keyboard_at" andSelecter:@selector(atButtonClicked:)]; | |
| 128 | 128 | [keyboardToolBar addSubview:atButton]; | |
| 129 | 129 | ||
| 130 | - if(![CSSearchModel hasClickedNewFeatureWithType:CSSNewFeatureTypeTopic]) { | ||
| 131 | - | ||
| 130 | + | ||
| 131 | + if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_TweetTopic]) { | ||
| 132 | 132 | [topicButton addBadgePoint:3 withPointPosition:CGPointMake(27, 7)]; | |
| 133 | 133 | } | |
| 134 | 134 | } | |
@@ -198,10 +198,11 @@ - (void)atButtonClicked:(id)sender{ | |||
| 198 | 198 | } | |
| 199 | 199 | ||
| 200 | 200 | - (void)topicButtonClicked:(id)sender{ | |
| 201 | - | ||
| 202 | - UIButton *btnTopic = (UIButton *)sender; | ||
| 203 | - [btnTopic removeBadgePoint]; | ||
| 204 | - [CSSearchModel clickNewFeatureWithType:CSSNewFeatureTypeTopic]; | ||
| 201 | + if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_TweetTopic]) { | ||
| 202 | + [[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_TweetTopic]; | ||
| 203 | + UIButton *btnTopic = (UIButton *)sender; | ||
| 204 | + [btnTopic removeBadgePoint]; | ||
| 205 | + } | ||
| 205 | 206 | ||
| 206 | 207 | @weakify(self); | |
| 207 | 208 | [CSTopicCreateVC showATSomeoneWithBlock:^(NSString *topicName) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments