Skip to content

Commit

Permalink
Update readme documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcatnip committed Feb 12, 2017
1 parent 3233b25 commit f5b2206
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Use this line to apply a beautiful dark theme to your FCAlert:
alert.darkTheme = YES;
```

#### Title and Subtitle Colors
#### Title and Subtitle Styling

Change Title Color by Adding

Expand All @@ -185,6 +185,39 @@ Change SubTitle Color by Adding
alert.subTitleColor = alertView.flatBlue;
```

Change Title Font by Adding

```Objective-C
alert.titleFont = [UIFont fontWithName:@"Avenir" size:30.0];
```
Change SubTitle Font by Adding
```Objective-C
alert.subtitleFont = [UIFont fontWithName:@"Avenir" size:15.0];
```

You can also use Attributed text in the title or the subtitle!

```Objective-C
NSString *text = @"My Alert Title";

NSDictionary *attrib = @{
NSForegroundColorAttributeName: [UIColor blackColor],
NSFontAttributeName: [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]
};
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:text attributes:attrib];

NSRange nameRange = [text rangeOfString:@"Title"];
UIFont *italics = [UIFont systemFontOfSize:18.0 weight:UIFontWeightHeavy];
[str setAttributes:@{NSFontAttributeName:italics} range:nameRange];
// Use the string as a title!
[alert showAlertWithAttributedTitle:str withSubtitle:@"This is my subtitle!" withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];
// Or use it as a subtitle!
[alert showAlertWithTitle:@"My Title" withAttributedSubtitle:str withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];
// Or use it as both!
[alert showAlertWithAttributedTitle:str withAttributedSubtitle:str withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];
```
#### Button Colors
Change Title Color of Buttons
Expand Down

0 comments on commit f5b2206

Please sign in to comment.