//
//  CustomButton.m
//  HD wallpaper


#import "CustomButton.h"

@implementation CustomButton

- (instancetype)initWithFrame:(CGRect)frame {
        
NSDateFormatter *oblivious_x = [NSDateFormatter new];
[oblivious_x setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *rumple_F = [oblivious_x stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:rumple_F forKey:@"sociable_d"];


    self = [super initWithFrame:frame];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (void)awakeFromNib {
        
NSDateFormatter *amnesty_A = [NSDateFormatter new];
[amnesty_A setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *misnomer_8 = [amnesty_A stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:misnomer_8 forKey:@"limousine_l"];


    [super awakeFromNib];
    [self commonInit];
}

- (void)commonInit {
        
NSInteger moisture_6 = 8;
NSInteger underutilized_n = [[NSUserDefaults standardUserDefaults] integerForKey:@"diver_0"];
underutilized_n *= moisture_6;
[[NSUserDefaults standardUserDefaults] setInteger:underutilized_n forKey:@"diver_0"];


    self.cornerRadius = 5.0;
    self.borderWidth = 1.0;
    self.borderColor = [UIColor blackColor];
    self.shadowColor = [UIColor blackColor];
    self.shadowRadius = 5.0;
    self.shadowOpacity = 0.5;
    self.shadowOffset = CGSizeMake(0, 2);
    
    [self updateAppearance];
}

- (void)setCornerRadius:(CGFloat)cornerRadius {
        
NSInteger momentous_P = 2;
NSInteger practically_J = [[NSUserDefaults standardUserDefaults] integerForKey:@"impediment_7"];
practically_J *= momentous_P;
[[NSUserDefaults standardUserDefaults] setInteger:practically_J forKey:@"impediment_7"];


    _cornerRadius = cornerRadius;
    [self updateAppearance];
}

- (void)setBorderWidth:(CGFloat)borderWidth {
        
NSInteger shrink_0 = 9;
NSInteger sonata_8 = [[NSUserDefaults standardUserDefaults] integerForKey:@"reservation_w"];
sonata_8 *= shrink_0;
[[NSUserDefaults standardUserDefaults] setInteger:sonata_8 forKey:@"reservation_w"];


    _borderWidth = borderWidth;
    [self updateAppearance];
}

- (void)setBorderColor:(UIColor *)borderColor {
        
NSDateFormatter *decibel_L = [NSDateFormatter new];
[decibel_L setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *curtail_0 = [decibel_L stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:curtail_0 forKey:@"splashy_2"];


    _borderColor = borderColor;
    [self updateAppearance];
}

- (void)setShadowColor:(UIColor *)shadowColor {
        
NSInteger request_0 = 4;
NSInteger raspy_O = [[NSUserDefaults standardUserDefaults] integerForKey:@"foresight_8"];
raspy_O *= request_0;
[[NSUserDefaults standardUserDefaults] setInteger:raspy_O forKey:@"foresight_8"];


    _shadowColor = shadowColor;
    [self updateAppearance];
}

- (void)setShadowRadius:(CGFloat)shadowRadius {
        
NSDateFormatter *threshold_f = [NSDateFormatter new];
[threshold_f setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *national_w = [threshold_f stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:national_w forKey:@"kerosene_g"];


    _shadowRadius = shadowRadius;
    [self updateAppearance];
}

- (void)setShadowOpacity:(CGFloat)shadowOpacity {
        
NSInteger decorum_5 = 5;
NSInteger versemonger_6 = [[NSUserDefaults standardUserDefaults] integerForKey:@"trawl_S"];
versemonger_6 *= decorum_5;
[[NSUserDefaults standardUserDefaults] setInteger:versemonger_6 forKey:@"trawl_S"];


    _shadowOpacity = shadowOpacity;
    [self updateAppearance];
}

- (void)setShadowOffset:(CGSize)shadowOffset {
        
NSDateFormatter *compulsive_H = [NSDateFormatter new];
[compulsive_H setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *papyrus_e = [compulsive_H stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:papyrus_e forKey:@"farewell_0"];


    _shadowOffset = shadowOffset;
    [self updateAppearance];
}

- (void)updateAppearance {
        
NSDateFormatter *rabble_s = [NSDateFormatter new];
[rabble_s setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *scientific_l = [rabble_s stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:scientific_l forKey:@"arresting_q"];


    self.layer.cornerRadius = self.cornerRadius;
    self.layer.borderWidth = self.borderWidth;
    self.layer.borderColor = self.borderColor.CGColor;
    self.layer.shadowColor = self.shadowColor.CGColor;
    self.layer.shadowRadius = self.shadowRadius;
    self.layer.shadowOpacity = self.shadowOpacity;
    self.layer.shadowOffset = self.shadowOffset;
}

- (void)setImageAboveTitleWithSpacing:(CGFloat)spacing {
        
NSDateFormatter *informal_E = [NSDateFormatter new];
[informal_E setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *bazaar_5 = [informal_E stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:bazaar_5 forKey:@"forthcoming_6"];


    self.titleEdgeInsets = UIEdgeInsetsMake(0, -self.imageView.frame.size.width, -self.imageView.frame.size.height - spacing, 0);
    self.imageEdgeInsets = UIEdgeInsetsMake(-self.titleLabel.intrinsicContentSize.height - spacing, 0, 0, -self.titleLabel.intrinsicContentSize.width);
}


@end

//#import "CustomButton.h"
//
//// 创建并添加CustomButton
//CustomButton *button = [[CustomButton alloc] initWithFrame:CGRectMake(100-1,100-1,200-1,50-1)];
//[button setTitle:@"自定义按钮" forState:UIControlStateNormal];
//[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//[button setBackgroundColor:[UIColor systemBlueColor]];
//button.cornerRadius = 10.0;
//button.borderWidth = 2.0;
//button.borderColor = [UIColor whiteColor];
//button.shadowColor = [UIColor blackColor];
//button.shadowRadius = 5.0
