Skip to content

Commit

Permalink
image issues with FCAlertView
Browse files Browse the repository at this point in the history
  • Loading branch information
nimati committed Aug 13, 2016
1 parent f4e9681 commit 5ea8e65
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions FCAlertView/Classes/FCAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -463,22 +463,36 @@ - (void)drawRect:(CGRect)rect {

}

+(NSBundle *)getResourcesBundle
{
NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle bundleForClass:[self class]] URLForResource:@"MyBundle" withExtension:@"bundle"]];
return bundle;
}

-(UIImage *)loadImageFromResourceBundle:(NSString *)imageName
{
NSBundle *bundle = [FCAlertView getResourcesBundle];
NSString *imageFileName = [NSString stringWithFormat:@"%@.png",imageName];
UIImage *image = [UIImage imageNamed:imageFileName inBundle:bundle compatibleWithTraitCollection:nil];
return image;
}

#pragma mark - Default Types of Alerts

- (void) makeAlertTypeWarning {
vectorImage = [UIImage imageNamed:@"close-round.png"];
vectorImage = [self loadImageFromResourceBundle:@"close-round.png"];
alertViewWithVector = 1;
self.colorScheme = self.flatRed;
}

- (void) makeAlertTypeCaution {
vectorImage = [UIImage imageNamed:@"alert.png"];
vectorImage = [self loadImageFromResourceBundle:@"alert.png"];
alertViewWithVector = 1;
self.colorScheme = self.flatOrange;
}

- (void) makeAlertTypeSuccess {
vectorImage = [UIImage imageNamed:@"checkmark-round.png"];
vectorImage = [self loadImageFromResourceBundle:@"checkmark-round.png"];
alertViewWithVector = 1;
self.colorScheme = self.flatGreen;
}
Expand Down

0 comments on commit 5ea8e65

Please sign in to comment.