// // ShadowView.m // 千模 // // Created by Drew on 2018/10/25. // Copyright © 2018 MUMEI. All rights reserved. // #import "ShadowView.h" #import "SkillOrderController.h" #import "MyOrderController.h" @interface ShadowView () @property(weak, nonatomic) IBOutlet UIView *contentView; @property(weak, nonatomic) IBOutlet UIImageView *item1; @property(weak, nonatomic) IBOutlet UIImageView *item2; @property(weak, nonatomic) IBOutlet UIImageView *item3; @property(weak, nonatomic) IBOutlet UIImageView *item4; @end @implementation ShadowView - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self initView]; } return self; } - (instancetype)initWithCoder:(NSCoder *)aDecoder { if (self = [super initWithCoder:aDecoder]) { [self initView]; } return self; } - (void)initView { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *className = NSStringFromClass([self class]); UIView *view = [[bundle loadNibNamed:className owner:self options:nil] firstObject]; view.frame = self.bounds; [self addSubview:view]; self.contentView.layer.cornerRadius = 12; self.item1.userInteractionEnabled = YES; self.item2.userInteractionEnabled = YES; self.item3.userInteractionEnabled = YES; self.item4.userInteractionEnabled = YES; self.contentView.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1].CGColor; self.contentView.layer.cornerRadius = 12; self.contentView.layer.shadowColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.08].CGColor; self.contentView.layer.shadowOffset = CGSizeMake(0, 6); self.contentView.layer.shadowOpacity = 1; self.contentView.layer.shadowRadius = 12; } - (IBAction)tapItem:(id)sender { NSInteger type = 1; switch (((UITapGestureRecognizer *) sender).view.tag) { case 1: type = 2; break; case 2: type = 3; break; case 3: type = 5; break; case 4: type = 1; break; default: break; } // SkillOrderController *vc = [[SkillOrderController alloc] init]; // [[self findViewController].navigationController pushViewController:vc animated:YES]; MyOrderController *vc = [[MyOrderController alloc] init]; vc.hidesBottomBarWhenPushed = YES; [[self findViewController].navigationController pushViewController:vc animated:YES]; } - (UIViewController *)findViewController { id target = self; while (target) { target = ((UIResponder *) target).nextResponder; if ([target isKindOfClass:[UIViewController class]]) { break; } } return target; } @end