Skip to content

Commit 63f1e17

Browse files
committed
Code Refactoring
1 parent d5c1d06 commit 63f1e17

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

CFAlertViewController/Cells/CFAlertActionTableViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CFAlertActionTableViewCell: UITableViewCell {
2626
return UIColor.white
2727
}
2828
public static func CF_CANCEL_ACTION_COLOR() -> UIColor {
29-
return UIColor(red: CGFloat(103.0 / 255.0), green: CGFloat(104.0 / 255.0), blue: CGFloat(217.0 / 255.0), alpha: CGFloat(1.0))
29+
return UIColor.gray.withAlphaComponent(0.3)
3030
}
3131
public static func CF_CANCEL_ACTION_TEXT_COLOR() -> UIColor {
3232
return UIColor.gray

Demo/CFAlertViewControllerDemo/Header Footer Views/TweetToIncreaseLimitView.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ - (void)enableTweetButton{
257257
#pragma mark - Actions
258258

259259
- (IBAction)tweetButtonPressed:(id)sender{
260-
self.isExpanded = !self.isExpanded;
260+
261+
if (!self.isExpanded) {
262+
self.isExpanded = YES;
263+
}
264+
else {
265+
[self.alertController dismissAlertWithAnimation:YES completion:nil];
266+
}
261267
}
262268

263269
@end

Demo/CFAlertViewControllerDemo/View Controller/HomeTableViewController.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313

1414

15-
#define DEFAULT_BTN_TITLE @"DEFAULT"
16-
#define DEFAULT_BTN_COLOR [UIColor colorWithRed:41.0/255.0 green:198.0/255.0 blue:77.0/255.0 alpha:1.0]
17-
#define DEFAULT_BTN_TITLE_COLOR [UIColor whiteColor]
15+
#define DEFAULT_BTN_TITLE @"DEFAULT"
16+
#define DEFAULT_BTN_COLOR [UIColor colorWithRed:41.0/255.0 green:198.0/255.0 blue:77.0/255.0 alpha:1.0]
17+
#define DEFAULT_BTN_TITLE_COLOR [UIColor whiteColor]
1818

19-
#define DESTRUCTIVE_BTN_TITLE @"DESTRUCTIVE"
20-
#define DESTRUCTIVE_BTN_COLOR [UIColor colorWithRed:255.0/255.0 green:75.0/255.0 blue:75.0/255.0 alpha:1.0]
21-
#define DESTRUCTIVE_BTN_TITLE_COLOR [UIColor whiteColor]
19+
#define DESTRUCTIVE_BTN_TITLE @"DESTRUCTIVE"
20+
#define DESTRUCTIVE_BTN_COLOR [UIColor colorWithRed:255.0/255.0 green:75.0/255.0 blue:75.0/255.0 alpha:1.0]
21+
#define DESTRUCTIVE_BTN_TITLE_COLOR [UIColor whiteColor]
2222

23-
#define CANCEL_BTN_TITLE @"CANCEL"
24-
#define CANCEL_BTN_COLOR [UIColor grayColor]
25-
#define CANCEL_BTN_TITLE_COLOR [UIColor grayColor]
23+
#define CANCEL_BTN_TITLE @"CANCEL"
24+
#define CANCEL_BTN_COLOR [[UIColor grayColor] colorWithAlphaComponent:0.3]
25+
#define CANCEL_BTN_TITLE_COLOR [UIColor grayColor]
2626

2727

2828

0 commit comments

Comments
 (0)