├── LICENSE ├── README.md ├── TSActionAlertView.podspec ├── TSActionAlertView ├── TSActionAlertView.h ├── TSActionAlertView.m ├── UIWindow+SIUtils.h └── UIWindow+SIUtils.m ├── TSActionAlertViewEffects ├── TSGoTaobaoAlertView.h ├── TSGoTaobaoAlertView.m ├── TSGoodsEditAlertView.h ├── TSGoodsEditAlertView.m ├── TSPullDownActionAlertView.h ├── TSPullDownActionAlertView.m ├── TSTaoSearchView.h ├── TSTaoSearchView.m ├── TSWebActionAlertView.h └── TSWebActionAlertView.m ├── TSAlertActionViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── dylan.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── dylan.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── TSAlertActionViewDemo.xcscheme │ └── xcschememanagement.plist ├── TSAlertActionViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── CLOSE (4).imageset │ │ ├── CLOSE (4).png │ │ └── Contents.json │ ├── Contents.json │ ├── 合成 1_00000.imageset │ │ ├── Contents.json │ │ └── 合成 1_00000.png │ ├── 合成 1_00001.imageset │ │ ├── Contents.json │ │ └── 合成 1_00001.png │ ├── 合成 1_00002.imageset │ │ ├── Contents.json │ │ └── 合成 1_00002.png │ ├── 合成 1_00003.imageset │ │ ├── Contents.json │ │ └── 合成 1_00003.png │ ├── 合成 1_00004.imageset │ │ ├── Contents.json │ │ └── 合成 1_00004.png │ ├── 合成 1_00005.imageset │ │ ├── Contents.json │ │ └── 合成 1_00005.png │ ├── 合成 1_00006.imageset │ │ ├── Contents.json │ │ └── 合成 1_00006.png │ └── 合成 1_00007.imageset │ │ ├── Contents.json │ │ └── 合成 1_00007.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── TSActionDemoView.h ├── TSActionDemoView.m ├── ViewController.h ├── ViewController.m └── main.m └── demo_gifs ├── 1. normal.gif ├── 2. input.gif ├── 3. web.gif ├── 4. pull.gif ├── 5. jump.gif └── gifImage.gif /LICENSE: -------------------------------------------------------------------------------- 1 | ..... 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TSActionAlertView 2 | 3 | 介绍: TSActionAlertView 是用Objective-C实现的一个弹窗 4 | 5 | 2018.4.14 增加了cocoapod的支持,可以直接用 TSActionAlertView来添加到项目中 6 | 7 | ### 1. 弹窗背景有两种 TSActionAlertViewBackgroundStyle 8 | 9 | |TSActionAlertViewBackgroundStyle|说明| 10 | |:------------- | :-------------:| 11 | |TSActionAlertViewBackgroundStyleSolid | 背景半透明| 12 | | TSActionAlertViewBackgroundStyleGradient | 背景渐变| 13 | 14 | 15 | ### 2. 弹窗的出现动画有五种 TSActionAlertViewTransitionStyle 16 | 17 | |TSActionAlertViewTransitionStyle|说明| 18 | |:---|:---:| 19 | |TSActionAlertViewTransitionStyleSlideFromBottom|上来,然后下去| 20 | |TSActionAlertViewTransitionStyleFade|渐变| 21 | |TSActionAlertViewTransitionStyleBounce|弹出| 22 | |TSActionAlertViewTransitionStyleDropDown|下落| 23 | |TSActionAlertViewTransitionStyleSlideFromTop|下滑,然后上去| 24 | 25 | 26 | 效果: 27 | ![效果图加载中...](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/gifImage.gif?raw=true) 28 | 29 | ### 3. 弹窗的用法 30 | 31 | ##### 1. 继承 TSActionAlertView 32 | ##### 2. 实现添加自定义控件 33 | 34 | ``` 35 | @interface TSActionDemoView() 36 | 37 | @property (strong,nonatomic)UIButton * headerBtn;//头部视图 38 | @property (strong,nonatomic)UITextField * inputField;//输入框 39 | @property (strong,nonatomic)UIButton * sureBtn;//确定按钮 40 | @property (strong,nonatomic)UIButton * cancelBtn;//取消按钮 41 | 42 | @end 43 | ``` 44 | ##### 3. 懒加载子控件 45 | ##### 4. 给控件添加事件,可以借助提供的handler,也可以自己写 46 | 47 | ``` 48 | @property (strong,nonatomic)TSActionAlertViewStringHandler stringHandler; 49 | ``` 50 | ##### 5. 实现继承的以下方法 51 | 52 | ``` 53 | - (void)layoutContainerView{ 54 | //布局containerview的位置,就是那个看得到的视图 55 | } 56 | 57 | - (void)setupContainerViewAttributes{ 58 | //设置containerview的属性,比如切边啥的 59 | } 60 | 61 | - (void)setupContainerSubViews{ 62 | //给containerview添加子视图 63 | } 64 | 65 | - (void)layoutContainerViewSubViews{ 66 | //设置子视图的frame 67 | } 68 | ``` 69 | 70 | ### 4. 弹窗的调用和隐藏 71 | ``` 72 | TSActionDemoView * demoAlertView = [TSActionDemoView actionAlertViewWithAnimationStyle:TSActionAlertViewTransitionStyleSlideFromTop]; 73 |    [demoAlertView show]; 74 | 75 | [demoAlertView dismissAnimated:YES]; 76 | ``` 77 | 78 | ### 5. 其他功能 79 | 80 | `代理的使用`:定义了代理来在视图的出现,消失的时候进行一些回调 81 | `点击背景自动隐藏:` 设置属性 isAutoHidden=YES 82 | 83 | 遵循协议:TSActionAlertViewDelegate 84 | 85 | ``` 86 | - (void)actionAlertViewWillShow;//即将出现 87 | - (void)actionAlertViewDidShow;//已经出现 88 | - (void)actionAlertViewWillDismiss;//即将消失 89 | - (void)actionAlertViewDidDismiss;//已经消失 90 | - (void)actionAlertViewDidSelectBackGroundView;//点击了背景 91 | ``` 92 | 93 | > 具体效果请看demo 94 | > 更多用法: [简书文章地址](http://www.jianshu.com/p/9a08223c70e8) 95 | > 效果实例 只是一些参考效果,丑是没办法的... 96 | 97 | ###### 1. 正常弹窗 98 | ![正常弹窗](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/1.%20normal.gif?raw=true) 99 | 100 | ###### 2. 输入弹窗 101 | ![正常弹窗](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/2.%20input.gif?raw=true) 102 | 103 | ###### 3. web弹窗 104 | ![正常弹窗](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/3.%20web.gif?raw=true) 105 | 106 | ###### 4. 下拉列表选项弹窗 107 | ![正常弹窗](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/4.%20pull.gif?raw=true) 108 | 109 | ###### 5. 跳转弹窗 110 | ![正常弹窗](https://github.com/TsnumiDC/TSActionAlertView/blob/master/demo_gifs/5.%20jump.gif?raw=true) 111 | 112 | -------------------------------------------------------------------------------- /TSActionAlertView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint TSActionAlertView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | 12 | s.name = "TSActionAlertView" 13 | s.version = "1.0.1" 14 | s.summary = "iOS一套动画弹窗框架" 15 | 16 | 17 | #s.description = <<-DESC 18 | # DESC 19 | 20 | s.homepage = "https://github.com/TsnumiDC/TSActionAlertView" 21 | 22 | s.license = "MIT" 23 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 24 | 25 | 26 | 27 | s.author = { "Dylan Chen" => "dylan@dylancc.com" } 28 | s.social_media_url = "http://www.dylancc.com" 29 | 30 | 31 | # s.platform = :ios 32 | s.platform = :ios, "5.0" 33 | 34 | # When using multiple platforms 35 | # s.ios.deployment_target = "5.0" 36 | # s.osx.deployment_target = "10.7" 37 | # s.watchos.deployment_target = "2.0" 38 | # s.tvos.deployment_target = "9.0" 39 | 40 | 41 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 42 | # 43 | # Specify the location from where the source should be retrieved. 44 | # Supports git, hg, bzr, svn and HTTP. 45 | # 46 | 47 | s.source = { :git => "https://github.com/TsnumiDC/TSActionAlertView.git", :tag => "#{s.version}" } 48 | 49 | 50 | 51 | s.source_files = "TSActionAlertView/TSActionAlertView.{h,m}", "TSActionAlertView/UIWindow+SIUtils.{h,m}" 52 | # s.exclude_files = "Classes/Exclude" 53 | 54 | # s.public_header_files = "Classes/**/*.h" 55 | 56 | 57 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 58 | # 59 | # A list of resources included with the Pod. These are copied into the 60 | # target bundle with a build phase script. Anything else will be cleaned. 61 | # You can preserve files from being cleaned, please don't preserve 62 | # non-essential files like tests, examples and documentation. 63 | # 64 | 65 | # s.resource = "icon.png" 66 | # s.resources = "Resources/*.png" 67 | 68 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 69 | 70 | 71 | 72 | # s.framework = "SomeFramework" 73 | # s.frameworks = "SomeFramework", "AnotherFramework" 74 | 75 | # s.library = "iconv" 76 | # s.libraries = "iconv", "xml2" 77 | 78 | 79 | s.requires_arc = true 80 | 81 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 82 | # s.dependency "JSONKit", "~> 1.4" 83 | 84 | end 85 | -------------------------------------------------------------------------------- /TSActionAlertView/TSActionAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSActionAlertView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/8/8. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 写一个弹窗的父类,然后以后写弹窗就直接继承 8 | 9 | #import 10 | 11 | #define TSACTIONVIEW_CONTAINER_WIDTH (310.0) //宽度固定一下好了 12 | 13 | #define kScreenWidth ([UIScreen mainScreen].bounds.size.width) 14 | #define kScreenHeight ([UIScreen mainScreen].bounds.size.height) 15 | 16 | @class TSActionAlertView; 17 | typedef void(^TSActionAlertViewHandler)(TSActionAlertView *alertView); 18 | typedef void(^TSActionAlertViewStringHandler)(TSActionAlertView *alertView,NSString * string); 19 | 20 | //背景效果 0是渐变 1是不渐变 21 | typedef NS_ENUM(NSInteger, TSActionAlertViewBackgroundStyle) { 22 | TSActionAlertViewBackgroundStyleSolid =0, 23 | TSActionAlertViewBackgroundStyleGradient, 24 | }; 25 | //动画效果 26 | typedef NS_ENUM(NSInteger, TSActionAlertViewTransitionStyle) { 27 | TSActionAlertViewTransitionStyleSlideFromBottom = 0, 28 | TSActionAlertViewTransitionStyleFade, 29 | TSActionAlertViewTransitionStyleBounce, 30 | TSActionAlertViewTransitionStyleDropDown, 31 | TSActionAlertViewTransitionStyleSlideFromTop, 32 | }; 33 | 34 | @protocol TSActionAlertViewDelegate 35 | 36 | @optional 37 | - (void)actionAlertViewWillShow;//即将出现 38 | - (void)actionAlertViewDidShow;//已经出现 39 | - (void)actionAlertViewWillDismiss;//即将消失 40 | - (void)actionAlertViewDidDismiss;//已经消失 41 | - (void)actionAlertViewDidSelectBackGroundView;//点击了背景 42 | 43 | @end 44 | 45 | @interface TSActionAlertView : UIView 46 | 47 | @property (weak,nonatomic)id delegate; 48 | @property (nonatomic, assign) TSActionAlertViewBackgroundStyle backgroundStyle;//背景效果 49 | @property (nonatomic, assign, getter = isVisible) BOOL visible;//是否正在显示 50 | @property (nonatomic, assign) TSActionAlertViewTransitionStyle transitionStyle; 51 | @property (nonatomic, strong) UIView *containerView;//容器视图 52 | @property (nonatomic, weak) UIWindow *oldKeyWindow; 53 | @property (nonatomic, assign)BOOL isAutoHidden;//是否点击背景隐藏 54 | /** 55 | 初始化方法,传入一个动画类型 56 | @param style 动画类型 57 | @return 初始化的对象 58 | */ 59 | + (instancetype)actionAlertViewWithAnimationStyle:(TSActionAlertViewTransitionStyle)style; 60 | - (instancetype)initWithAnimationStyle:(TSActionAlertViewTransitionStyle)style; 61 | 62 | //展示和消失 63 | - (void)dismissAnimated:(BOOL)animated; 64 | - (void)show; 65 | 66 | //继承者需要实现的 67 | - (void)layoutContainerView;//布局containerview的位置,就是那个看得到的视图 68 | - (void)setupContainerViewAttributes;//设置containerview的属性,比如切边啥的 69 | - (void)setupContainerSubViews;//给containerview添加子视图 70 | - (void)layoutContainerViewSubViews;//设置子视图的frame 71 | 72 | 73 | //给控制器调用的,不用管 74 | - (void)setup; 75 | - (void)resetTransition; 76 | - (void)invalidateLayout; 77 | 78 | 79 | /* 80 | - (void)layoutContainerView{ 81 | //布局containerview的位置,就是那个看得到的视图 82 | } 83 | 84 | - (void)setupContainerViewAttributes{ 85 | //设置containerview的属性,比如切边啥的 86 | } 87 | 88 | - (void)setupContainerSubViews{ 89 | //给containerview添加子视图 90 | } 91 | 92 | - (void)layoutContainerViewSubViews{ 93 | //设置子视图的frame 94 | } 95 | 96 | */ 97 | @end 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /TSActionAlertView/TSActionAlertView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSActionAlertView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/8/8. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | 9 | #import "TSActionAlertView.h" 10 | #import "UIWindow+SIUtils.h" 11 | 12 | @class TSActionAlertViewBackgroundWindow; 13 | 14 | const UIWindowLevel windowLevelEvaluation = 1996.0; // don't overlap system's alert 15 | const UIWindowLevel windwLevelEvaluationBackground = 1985.0; // below the alert window 16 | static NSMutableArray *__si_queue; 17 | static BOOL __si_animating; 18 | static TSActionAlertViewBackgroundWindow *__si_background_window; 19 | static TSActionAlertView *__si_current_view; 20 | 21 | #pragma mark - TSActionAlertViewBackgroundWindow 声明一个Window 22 | @interface TSActionAlertViewBackgroundWindow : UIWindow 23 | @property (nonatomic, assign) TSActionAlertViewBackgroundStyle style; 24 | @end 25 | @implementation TSActionAlertViewBackgroundWindow 26 | 27 | #pragma mark Init 28 | - (id)initWithFrame:(CGRect)frame andStyle:(TSActionAlertViewBackgroundStyle)style{ 29 | self = [super initWithFrame:frame]; 30 | if (self) { 31 | self.style = style; 32 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 33 | self.opaque = NO; 34 | self.windowLevel = windwLevelEvaluationBackground; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)drawRect:(CGRect)rect{ 40 | CGContextRef context = UIGraphicsGetCurrentContext(); 41 | switch (self.style) { 42 | case TSActionAlertViewBackgroundStyleGradient:{//渐变效果 43 | [[UIColor colorWithWhite:0 alpha:0.5] set];//背景透明度 44 | CGContextFillRect(context, self.bounds); 45 | size_t locationsCount = 2; 46 | CGFloat locations[2] = {0.0f, 1.0f}; 47 | CGFloat colors[8] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f}; 48 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 49 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); 50 | CGColorSpaceRelease(colorSpace); 51 | CGPoint center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); 52 | CGFloat radius = MIN(self.bounds.size.width, self.bounds.size.height) ; 53 | CGContextDrawRadialGradient (context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation); 54 | CGGradientRelease(gradient); 55 | 56 | break; 57 | }case TSActionAlertViewBackgroundStyleSolid:{ 58 | [[UIColor colorWithWhite:0 alpha:0.3] set];//背景透明度 59 | CGContextFillRect(context, self.bounds); 60 | break; 61 | } 62 | } 63 | } 64 | @end 65 | 66 | #pragma mark - TSActionAlertViewController 声明一个controller来做actionview的容器,并加载到window上 67 | @interface TSActionAlertViewController : UIViewController 68 | @property (nonatomic, strong) TSActionAlertView *alertView; 69 | @end 70 | 71 | @implementation TSActionAlertViewController 72 | 73 | #pragma mark View life cycle 74 | 75 | - (void)loadView 76 | { 77 | self.view = self.alertView; 78 | } 79 | 80 | - (void)viewDidLoad 81 | { 82 | [super viewDidLoad]; 83 | [self.alertView setup]; 84 | } 85 | 86 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 87 | { 88 | [self.alertView resetTransition]; 89 | [self.alertView invalidateLayout]; 90 | } 91 | 92 | - ( UIInterfaceOrientationMask )supportedInterfaceOrientations 93 | { 94 | UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; 95 | if (viewController) { 96 | return [viewController supportedInterfaceOrientations]; 97 | } 98 | return UIInterfaceOrientationMaskAll; 99 | } 100 | 101 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 102 | { 103 | UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; 104 | if (viewController) { 105 | return [viewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 106 | } 107 | return YES; 108 | } 109 | 110 | - (BOOL)shouldAutorotate 111 | { 112 | UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; 113 | if (viewController) { 114 | return [viewController shouldAutorotate]; 115 | } 116 | return YES; 117 | } 118 | @end 119 | 120 | 121 | #pragma mark - TSActionAlertView 122 | 123 | @interface TSActionAlertView() 124 | 125 | @property (assign,nonatomic)CGFloat screenHeighLight;//亮度 126 | @property (nonatomic, strong) UIWindow *alertWindow; 127 | @property (nonatomic, assign, getter = isLayoutDirty) BOOL layoutDirty; 128 | 129 | + (NSMutableArray *)sharedQueue; 130 | @end 131 | @implementation TSActionAlertView 132 | 133 | + (instancetype)actionAlertViewWithAnimationStyle:(TSActionAlertViewTransitionStyle)style{ 134 | return [[self alloc]initWithAnimationStyle:style]; 135 | } 136 | 137 | - (instancetype)initWithAnimationStyle:(TSActionAlertViewTransitionStyle)style{ 138 | if (self = [super init]) { 139 | self.transitionStyle =style; 140 | _isAutoHidden = NO; 141 | } 142 | return self; 143 | } 144 | 145 | + (void)initialize{ 146 | if (self != [TSActionAlertView class]) 147 | return; 148 | 149 | //TSActionAlertView *appearance = [self appearance]; 150 | } 151 | 152 | #pragma mark Class methods 153 | 154 | + (NSMutableArray *)sharedQueue{ 155 | if (!__si_queue) { 156 | __si_queue = [NSMutableArray array]; 157 | } 158 | return __si_queue; 159 | } 160 | 161 | + (TSActionAlertView *)currentAlertView{ 162 | return __si_current_view; 163 | } 164 | 165 | + (void)setCurrentAlertView:(TSActionAlertView *)alertView{ 166 | __si_current_view = alertView; 167 | } 168 | 169 | + (BOOL)isAnimating{ 170 | return __si_animating; 171 | } 172 | 173 | + (void)setAnimating:(BOOL)animating{ 174 | __si_animating = animating; 175 | } 176 | 177 | + (void)showBackground{ 178 | if (!__si_background_window) { 179 | 180 | CGRect frame = [[UIScreen mainScreen] bounds]; 181 | if([[UIScreen mainScreen] respondsToSelector:@selector(fixedCoordinateSpace)]) 182 | { 183 | frame = [[[UIScreen mainScreen] fixedCoordinateSpace] convertRect:frame 184 | fromCoordinateSpace:[[UIScreen mainScreen] coordinateSpace]]; 185 | } 186 | 187 | __si_background_window = [[TSActionAlertViewBackgroundWindow alloc] initWithFrame:frame 188 | andStyle:[TSActionAlertView currentAlertView].backgroundStyle]; 189 | [__si_background_window makeKeyAndVisible]; 190 | __si_background_window.alpha = 0; 191 | [UIView animateWithDuration:0.3 192 | animations:^{ 193 | __si_background_window.alpha = 1; 194 | }]; 195 | } 196 | } 197 | 198 | + (void)hideBackgroundAnimated:(BOOL)animated{ 199 | if (!animated) { 200 | [__si_background_window removeFromSuperview]; 201 | __si_background_window = nil; 202 | return; 203 | } 204 | 205 | [UIView animateWithDuration:0.3 206 | animations:^{ 207 | __si_background_window.alpha = 0; 208 | } 209 | completion:^(BOOL finished) { 210 | [__si_background_window removeFromSuperview]; 211 | __si_background_window = nil; 212 | }]; 213 | } 214 | 215 | #pragma mark Public 216 | 217 | - (void)show{ 218 | 219 | if (self.isVisible) { 220 | return; 221 | } 222 | 223 | self.oldKeyWindow = [[UIApplication sharedApplication] keyWindow]; 224 | 225 | if (![[TSActionAlertView sharedQueue] containsObject:self]) { 226 | [[TSActionAlertView sharedQueue] addObject:self]; 227 | } 228 | 229 | if ([TSActionAlertView isAnimating]) { 230 | return; 231 | } 232 | 233 | if ([TSActionAlertView currentAlertView].isVisible) { 234 | TSActionAlertView *alert = [TSActionAlertView currentAlertView]; 235 | [alert dismissAnimated:YES cleanup:NO]; 236 | return; 237 | } 238 | 239 | if (self.delegate && [self.delegate respondsToSelector:@selector(actionAlertViewWillShow)]) { 240 | [self.delegate actionAlertViewWillShow]; 241 | } 242 | 243 | 244 | CGFloat currentLight = [[UIScreen mainScreen] brightness]; 245 | self.screenHeighLight =currentLight; 246 | self.visible = YES; 247 | 248 | [TSActionAlertView setAnimating:YES]; 249 | [TSActionAlertView setCurrentAlertView:self]; 250 | 251 | [TSActionAlertView showBackground]; 252 | 253 | TSActionAlertViewController *viewController = [[TSActionAlertViewController alloc] initWithNibName:nil bundle:nil]; 254 | viewController.alertView = self; 255 | 256 | if (!self.alertWindow) { 257 | UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 258 | window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 259 | window.opaque = NO; 260 | window.windowLevel = windowLevelEvaluation; 261 | window.rootViewController = viewController; 262 | self.alertWindow = window; 263 | } 264 | [self.alertWindow makeKeyAndVisible]; 265 | 266 | [self validateLayout]; 267 | 268 | [self transitionInCompletion:^{ 269 | 270 | if (self.delegate && [self.delegate respondsToSelector:@selector(actionAlertViewDidShow)]) { 271 | [self.delegate actionAlertViewDidShow]; 272 | } 273 | 274 | [TSActionAlertView setAnimating:NO]; 275 | 276 | NSInteger index = [[TSActionAlertView sharedQueue] indexOfObject:self]; 277 | if (index < [TSActionAlertView sharedQueue].count - 1) { 278 | [self dismissAnimated:YES cleanup:NO]; // dismiss to show next alert view 279 | } 280 | }]; 281 | } 282 | 283 | - (void)dismissAnimated:(BOOL)animated{ 284 | [self endEditing:YES]; 285 | [self dismissAnimated:animated cleanup:YES]; 286 | } 287 | 288 | - (void)dismissAnimated:(BOOL)animated cleanup:(BOOL)cleanup{ 289 | BOOL isVisible = self.isVisible; 290 | 291 | if (isVisible) { 292 | if (self.delegate && [self.delegate respondsToSelector:@selector(actionAlertViewWillDismiss)]) { 293 | [self.delegate actionAlertViewWillDismiss]; 294 | } 295 | } 296 | 297 | void (^dismissComplete)(void) = ^{ 298 | self.visible = NO; 299 | 300 | [self teardown]; 301 | 302 | [TSActionAlertView setCurrentAlertView:nil]; 303 | 304 | TSActionAlertView *nextAlertView; 305 | NSInteger index = [[TSActionAlertView sharedQueue] indexOfObject:self]; 306 | if (index != NSNotFound && index < [TSActionAlertView sharedQueue].count - 1) { 307 | nextAlertView = [TSActionAlertView sharedQueue][index + 1]; 308 | } 309 | 310 | if (cleanup) { 311 | [[TSActionAlertView sharedQueue] removeObject:self]; 312 | } 313 | 314 | [TSActionAlertView setAnimating:NO]; 315 | 316 | if (isVisible) { 317 | if (self.delegate && [self.delegate respondsToSelector:@selector(actionAlertViewDidDismiss)]) { 318 | [self.delegate actionAlertViewDidDismiss]; 319 | } 320 | } 321 | 322 | // check if we should show next alert 323 | if (!isVisible) { 324 | return; 325 | } 326 | 327 | if (nextAlertView) { 328 | [nextAlertView show]; 329 | } else { 330 | // show last alert view 331 | if ([TSActionAlertView sharedQueue].count > 0) { 332 | TSActionAlertView *alert = [[TSActionAlertView sharedQueue] lastObject]; 333 | [alert show]; 334 | } 335 | } 336 | }; 337 | 338 | if (animated && isVisible) { 339 | [TSActionAlertView setAnimating:YES]; 340 | [self transitionOutCompletion:dismissComplete]; 341 | 342 | if ([TSActionAlertView sharedQueue].count == 1) { 343 | [TSActionAlertView hideBackgroundAnimated:YES]; 344 | } 345 | 346 | } else { 347 | dismissComplete(); 348 | 349 | if ([TSActionAlertView sharedQueue].count == 0) { 350 | [TSActionAlertView hideBackgroundAnimated:YES]; 351 | } 352 | } 353 | 354 | UIWindow *window = self.oldKeyWindow; 355 | if (!window) { 356 | window = [UIApplication sharedApplication].windows[0]; 357 | } 358 | [window makeKeyWindow]; 359 | window.hidden = NO; 360 | } 361 | 362 | #pragma mark Transitions 363 | 364 | - (void)transitionInCompletion:(void(^)(void))completion{ 365 | 366 | switch (self.transitionStyle) { 367 | case TSActionAlertViewTransitionStyleSlideFromBottom:{ 368 | CGRect rect = self.containerView.frame; 369 | CGRect originalRect = rect; 370 | rect.origin.y = self.bounds.size.height; 371 | self.containerView.frame = rect; 372 | [UIView animateWithDuration:0.3 373 | animations:^{ 374 | self.containerView.frame = originalRect; 375 | } 376 | completion:^(BOOL finished) { 377 | if (completion) { 378 | completion(); 379 | } 380 | }]; 381 | } 382 | break; 383 | case TSActionAlertViewTransitionStyleSlideFromTop:{ 384 | CGRect rect = self.containerView.frame; 385 | CGRect originalRect = rect; 386 | rect.origin.y = -rect.size.height; 387 | self.containerView.frame = rect; 388 | [UIView animateWithDuration:0.3 389 | animations:^{ 390 | self.containerView.frame = originalRect; 391 | } 392 | completion:^(BOOL finished) { 393 | if (completion) { 394 | completion(); 395 | } 396 | }]; 397 | } 398 | break; 399 | case TSActionAlertViewTransitionStyleFade:{ 400 | self.containerView.alpha = 0; 401 | [UIView animateWithDuration:0.3 402 | animations:^{ 403 | self.containerView.alpha = 1; 404 | } 405 | completion:^(BOOL finished) { 406 | if (completion) { 407 | completion(); 408 | } 409 | }]; 410 | } 411 | break; 412 | case TSActionAlertViewTransitionStyleBounce:{ 413 | 414 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 415 | animation.values = @[@(0.01), @(1.2), @(0.9), @(1)]; 416 | animation.keyTimes = @[@(0), @(0.4), @(0.6), @(1)]; 417 | animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 418 | animation.duration = 0.5; 419 | animation.delegate = self; 420 | [animation setValue:completion forKey:@"handler"]; 421 | [self.containerView.layer addAnimation:animation forKey:@"bouce"]; 422 | } 423 | break; 424 | case TSActionAlertViewTransitionStyleDropDown:{ 425 | 426 | CGFloat y = self.containerView.center.y; 427 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.y"]; 428 | animation.values = @[@(y - self.bounds.size.height), @(y + 20), @(y - 10), @(y)]; 429 | animation.keyTimes = @[@(0), @(0.5), @(0.75), @(1)]; 430 | animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 431 | animation.duration = 0.4; 432 | animation.delegate = self; 433 | [animation setValue:completion forKey:@"handler"]; 434 | [self.containerView.layer addAnimation:animation forKey:@"dropdown"]; 435 | } 436 | break; 437 | default: 438 | break; 439 | } 440 | } 441 | 442 | - (void)transitionOutCompletion:(void(^)(void))completion{ 443 | 444 | switch (self.transitionStyle) { 445 | case TSActionAlertViewTransitionStyleSlideFromBottom:{ 446 | CGRect rect = self.containerView.frame; 447 | rect.origin.y = self.bounds.size.height; 448 | [UIView animateWithDuration:0.3 449 | delay:0 450 | options:UIViewAnimationOptionCurveEaseIn 451 | animations:^{ 452 | self.containerView.frame = rect; 453 | } 454 | completion:^(BOOL finished) { 455 | if (completion) { 456 | completion(); 457 | } 458 | }]; 459 | } 460 | break; 461 | case TSActionAlertViewTransitionStyleSlideFromTop:{ 462 | CGRect rect = self.containerView.frame; 463 | rect.origin.y = -rect.size.height; 464 | [UIView animateWithDuration:0.3 465 | delay:0 466 | options:UIViewAnimationOptionCurveEaseIn 467 | animations:^{ 468 | self.containerView.frame = rect; 469 | } 470 | completion:^(BOOL finished) { 471 | if (completion) { 472 | completion(); 473 | } 474 | }]; 475 | } 476 | break; 477 | case TSActionAlertViewTransitionStyleFade:{ 478 | [UIView animateWithDuration:0.25 479 | animations:^{ 480 | self.containerView.alpha = 0; 481 | } 482 | completion:^(BOOL finished) { 483 | if (completion) { 484 | completion(); 485 | } 486 | }]; 487 | } 488 | break; 489 | case TSActionAlertViewTransitionStyleBounce:{ 490 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 491 | animation.values = @[@(1), @(1.2), @(0.01)]; 492 | animation.keyTimes = @[@(0), @(0.4), @(1)]; 493 | animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 494 | animation.duration = 0.35; 495 | animation.delegate = self; 496 | [animation setValue:completion forKey:@"handler"]; 497 | [self.containerView.layer addAnimation:animation forKey:@"bounce"]; 498 | 499 | self.containerView.transform = CGAffineTransformMakeScale(0.01, 0.01); 500 | } 501 | break; 502 | case TSActionAlertViewTransitionStyleDropDown: 503 | { 504 | CGPoint point = self.containerView.center; 505 | point.y += self.bounds.size.height; 506 | 507 | [UIView animateWithDuration:0.3 508 | delay:0 509 | options:UIViewAnimationOptionCurveEaseIn 510 | animations:^{ 511 | self.containerView.center = point; 512 | CGFloat angle = ((CGFloat)arc4random_uniform(100) - 50.f) / 100.f; 513 | self.containerView.transform = CGAffineTransformMakeRotation(angle); 514 | } 515 | completion:^(BOOL finished) { 516 | if (completion) { 517 | completion(); 518 | } 519 | }]; 520 | } 521 | break; 522 | default: 523 | break; 524 | } 525 | } 526 | 527 | - (void)resetTransition{ 528 | [self.containerView.layer removeAllAnimations]; 529 | } 530 | 531 | #pragma mark Layout 532 | 533 | - (void)layoutSubviews 534 | { 535 | [super layoutSubviews]; 536 | [self validateLayout]; 537 | } 538 | 539 | - (void)invalidateLayout{ 540 | self.layoutDirty = YES; 541 | [self setNeedsLayout]; 542 | } 543 | 544 | - (void)validateLayout 545 | { 546 | if (!self.isLayoutDirty) { 547 | return; 548 | } 549 | self.layoutDirty = NO; 550 | 551 | self.containerView.transform = CGAffineTransformIdentity; 552 | [self layoutContainerView]; 553 | self.containerView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.containerView.bounds cornerRadius:self.containerView.layer.cornerRadius].CGPath; 554 | 555 | [self layoutContainerViewSubViews]; 556 | } 557 | 558 | #pragma mark Setup 559 | 560 | - (void)setup{ 561 | [self setupContainerView]; 562 | 563 | [self setupContainerSubViews]; 564 | 565 | [self invalidateLayout]; 566 | 567 | } 568 | 569 | - (void)teardown{ 570 | [self.containerView removeFromSuperview]; 571 | self.containerView = nil; 572 | 573 | [self.alertWindow removeFromSuperview]; 574 | self.alertWindow = nil; 575 | self.layoutDirty = NO; 576 | } 577 | 578 | - (void)setupContainerSubViews{ 579 | //设置容器视图 580 | 581 | } 582 | 583 | - (void)layoutContainerViewSubViews{ 584 | //布局容器子视图 585 | } 586 | 587 | - (void)setupContainerViewAttributes{ 588 | //给容器视图加属性 589 | } 590 | 591 | - (void)layoutContainerView{ 592 | //布局容器视图 593 | self.containerView.frame = CGRectMake(0, 0, 0, 0); 594 | } 595 | 596 | - (void)setupContainerView{ 597 | 598 | self.containerView = [[UIView alloc] initWithFrame:self.bounds]; 599 | self.containerView.backgroundColor = [UIColor whiteColor]; 600 | self.containerView.clipsToBounds = YES; 601 | [self addSubview:self.containerView]; 602 | 603 | UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(backGroundViewTouchAction)]; 604 | tap.numberOfTapsRequired =2; 605 | [self addGestureRecognizer:tap]; 606 | [self setupContainerViewAttributes]; 607 | } 608 | 609 | #pragma mark Actions 610 | 611 | //点击背景 612 | - (void)backGroundViewTouchAction{ 613 | 614 | if(self.delegate && [self.delegate respondsToSelector:@selector(actionAlertViewDidSelectBackGroundView)]){ 615 | [self.delegate actionAlertViewDidSelectBackGroundView]; 616 | } 617 | } 618 | 619 | #pragma mark CAAnimation delegate 620 | 621 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ 622 | void(^completion)(void) = [anim valueForKey:@"handler"]; 623 | if (completion) { 624 | completion(); 625 | } 626 | } 627 | 628 | -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 629 | 630 | if (_isAutoHidden) { 631 | [self dismissAnimated:YES]; 632 | } 633 | } 634 | 635 | #pragma mark Lazy 636 | 637 | @end 638 | -------------------------------------------------------------------------------- /TSActionAlertView/UIWindow+SIUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+SIUtils.h 3 | // SIAlertView 4 | // 5 | // Created by Kevin Cao on 13-11-1. 6 | // Copyright (c) 2013年 Sumi Interactive. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWindow (SIUtils) 12 | 13 | - (UIViewController *)currentViewController; 14 | 15 | #ifdef __IPHONE_7_0 16 | - (UIViewController *)viewControllerForStatusBarStyle; 17 | - (UIViewController *)viewControllerForStatusBarHidden; 18 | #endif 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TSActionAlertView/UIWindow+SIUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+SIUtils.m 3 | // 4 | // Created by Kevin Cao on 13-11-1. 5 | // Copyright (c) 2013年 Sumi Interactive. All rights reserved. 6 | // 7 | 8 | #import "UIWindow+SIUtils.h" 9 | 10 | @implementation UIWindow (SIUtils) 11 | 12 | - (UIViewController *)currentViewController 13 | { 14 | UIViewController *viewController = self.rootViewController; 15 | while (viewController.presentedViewController) { 16 | viewController = viewController.presentedViewController; 17 | } 18 | return viewController; 19 | } 20 | 21 | #ifdef __IPHONE_7_0 22 | 23 | - (UIViewController *)viewControllerForStatusBarStyle 24 | { 25 | UIViewController *currentViewController = [self currentViewController]; 26 | 27 | while ([currentViewController childViewControllerForStatusBarStyle]) { 28 | currentViewController = [currentViewController childViewControllerForStatusBarStyle]; 29 | } 30 | return currentViewController; 31 | } 32 | 33 | - (UIViewController *)viewControllerForStatusBarHidden 34 | { 35 | UIViewController *currentViewController = [self currentViewController]; 36 | 37 | while ([currentViewController childViewControllerForStatusBarHidden]) { 38 | currentViewController = [currentViewController childViewControllerForStatusBarHidden]; 39 | } 40 | return currentViewController; 41 | } 42 | 43 | #endif 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSGoTaobaoAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGoTaobaoAlertView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/9/27. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 正在跳往淘宝 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | @interface TSGoTaobaoAlertView : TSActionAlertView 12 | 13 | //初始化价格 14 | - (instancetype)initWithMuchString:(NSString *)muchString; 15 | 16 | //开始动画 17 | - (void)startAnimation; 18 | @end 19 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSGoTaobaoAlertView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSGoTaobaoAlertView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/9/27. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | 9 | #import "TSGoTaobaoAlertView.h" 10 | 11 | #define TSGOTAOBAOALERT_WIDTH 290.0 12 | 13 | @interface TSGoTaobaoAlertView() 14 | { 15 | NSString * _muchString; 16 | } 17 | @property (strong, nonatomic)UILabel * titleLabel; 18 | @property (strong, nonatomic)UIView * backView1; 19 | @property (strong, nonatomic)UIView * backView2; 20 | @property (strong, nonatomic)UIImageView * imageView;//集-淘 21 | 22 | @property (strong, nonatomic)UIImageView * animationImageView;//动画条条 23 | 24 | @property (strong, nonatomic)UILabel * muchLabel;//先领券后购买 省xx元 25 | @property (strong, nonatomic)UIView * btmBackView;//底部带边框的背景 26 | 27 | @end 28 | 29 | @implementation TSGoTaobaoAlertView 30 | 31 | #pragma mark - Init 32 | - (instancetype)initWithMuchString:(NSString *)muchString{ 33 | 34 | if (self = [super initWithAnimationStyle:TSActionAlertViewTransitionStyleFade]) { 35 | _muchString = muchString; 36 | } 37 | return self; 38 | } 39 | 40 | #pragma mark - 继承 41 | - (void)layoutContainerView{ 42 | //布局containerview的位置,就是那个看得到的视图 43 | CGFloat hight = 177; 44 | CGFloat spideLeft = (kScreenWidth - TSGOTAOBAOALERT_WIDTH)/2; 45 | CGFloat spideTop = (kScreenHeight - hight) * 0.4; 46 | self.containerView.frame = CGRectMake(spideLeft, spideTop, TSGOTAOBAOALERT_WIDTH, hight); 47 | } 48 | 49 | - (void)setupContainerViewAttributes{ 50 | //设置containerview的属性,比如切边啥的 51 | self.containerView.layer.masksToBounds = YES; 52 | self.containerView.layer.cornerRadius = 15; 53 | } 54 | 55 | - (void)setupContainerSubViews{ 56 | 57 | //给containerview添加子视图 58 | [self.containerView addSubview:self.animationImageView]; 59 | [self.containerView addSubview:self.btmBackView]; 60 | [self.containerView addSubview:self.backView1]; 61 | [self.containerView addSubview:self.backView2]; 62 | 63 | [self.containerView addSubview:self.imageView]; 64 | [self.containerView addSubview:self.titleLabel]; 65 | [self.containerView addSubview:self.muchLabel]; 66 | 67 | } 68 | 69 | - (void)layoutContainerViewSubViews{ 70 | 71 | CGFloat hight = 177; 72 | //设置子视图的frame 73 | // 67 + 15 74 | self.animationImageView.frame = CGRectMake(0, hight - (67+15), TSGOTAOBAOALERT_WIDTH, 15); 75 | self.btmBackView.frame = CGRectMake(0, hight - (67+15+15), TSGOTAOBAOALERT_WIDTH, (67+15+15)); 76 | self.backView1.frame = CGRectMake(0, 0, TSGOTAOBAOALERT_WIDTH, 57); 77 | self.backView2.frame = CGRectMake(0, 57, TSGOTAOBAOALERT_WIDTH, 38); 78 | 79 | CGFloat x = (TSGOTAOBAOALERT_WIDTH - 90 )/2; 80 | self.titleLabel.frame = CGRectMake(x, 13, 90, 21); 81 | self.imageView.frame = CGRectMake(25, 30, TSGOTAOBAOALERT_WIDTH-50, 53); 82 | self.muchLabel.frame = CGRectMake(0, 30+53+43, TSGOTAOBAOALERT_WIDTH, 28); 83 | 84 | } 85 | 86 | #pragma mark - Public 87 | - (void)startAnimation{ 88 | 89 | if(_animationImageView){ 90 | self.animationImageView.animationRepeatCount = 1000; 91 | [self.animationImageView startAnimating]; 92 | } 93 | } 94 | 95 | 96 | #pragma mark - Lazy 97 | - (UILabel *)titleLabel{ 98 | 99 | if(_titleLabel == nil ){ 100 | _titleLabel = [UILabel new]; 101 | _titleLabel.font = [UIFont systemFontOfSize:15];; 102 | _titleLabel.textColor = [UIColor whiteColor]; 103 | _titleLabel.textAlignment = NSTextAlignmentCenter; 104 | _titleLabel.text = @"正在跳往..."; 105 | } 106 | return _titleLabel; 107 | } 108 | 109 | - (UIView *)backView1{ 110 | 111 | if(_backView1 == nil) { 112 | _backView1 = [UIView new]; 113 | _backView1.backgroundColor = [UIColor orangeColor]; 114 | } 115 | return _backView1; 116 | } 117 | 118 | - (UIView *)backView2{ 119 | 120 | if(_backView2 == nil){ 121 | _backView2 = [UIView new]; 122 | _backView2.backgroundColor = [UIColor orangeColor]; 123 | } 124 | return _backView2; 125 | } 126 | 127 | - (UIImageView *)imageView{ 128 | if(_imageView == nil) { 129 | _imageView = [UIImageView new]; 130 | _imageView.backgroundColor = [UIColor clearColor]; 131 | // _imageView.image = [UIImage imageNamed:@"跳转一"]; 132 | } 133 | return _imageView; 134 | } 135 | 136 | - (UIImageView *)animationImageView{ 137 | 138 | if(_animationImageView == nil){ 139 | _animationImageView = [UIImageView new]; 140 | _animationImageView.image = [UIImage imageNamed:@"合成 1_00000"]; 141 | 142 | NSMutableArray * imageArray=[NSMutableArray array]; 143 | for (int i=0; i<8; i++) { 144 | NSString * name1=[NSString stringWithFormat:@"合成 1_0000%d",i];//两位,不足补0 145 | UIImage * image =[UIImage imageNamed:name1]; 146 | [imageArray addObject:image]; 147 | } 148 | 149 | _animationImageView.animationImages=imageArray;//设置内容图片数组 150 | _animationImageView.animationRepeatCount=1000;//设置循环次数 151 | _animationImageView.animationDuration=imageArray.count*0.05;//设置时间 152 | [_animationImageView startAnimating];//开始播放 153 | } 154 | return _animationImageView; 155 | } 156 | 157 | - (UILabel *)muchLabel{ 158 | if (_muchLabel == nil) { 159 | _muchLabel = [UILabel new]; 160 | _muchLabel.textColor = [UIColor blackColor]; 161 | _muchLabel.font = [UIFont systemFontOfSize:16]; 162 | _muchLabel.textAlignment = NSTextAlignmentCenter; 163 | 164 | NSString * muchNormalString = _muchString?_muchString:@""; 165 | NSString * muchString; 166 | if (muchNormalString.length<=0 || [muchNormalString isEqualToString:@"0"]) { 167 | muchString = @"这是一个跳转弹窗哦~~~~~"; 168 | }else{ 169 | muchString = [NSString stringWithFormat:@"这是一个跳转弹窗哦~~~~~ %@ ",muchNormalString]; 170 | } 171 | if (muchString.length>0) { 172 | NSRange range = [muchString rangeOfString:muchNormalString]; 173 | NSDictionary * attribute=@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor redColor]}; 174 | NSMutableAttributedString * st=[[NSMutableAttributedString alloc]initWithString:muchString]; 175 | [st setAttributes:attribute range:range]; 176 | _muchLabel.attributedText=st; 177 | } 178 | 179 | } 180 | return _muchLabel; 181 | } 182 | 183 | - (UIView *)btmBackView{ 184 | 185 | if (_btmBackView == nil) { 186 | _btmBackView = [UIView new]; 187 | _btmBackView.layer.masksToBounds = YES; 188 | _btmBackView.layer.cornerRadius = 15.0; 189 | _btmBackView.layer.borderWidth = 2.0; 190 | _btmBackView.layer.borderColor = [UIColor yellowColor].CGColor; 191 | } 192 | return _btmBackView ; 193 | } 194 | 195 | #pragma mark - dealloc 196 | - (void)dealloc{ 197 | 198 | NSLog(@"mark - 弹窗销毁"); 199 | } 200 | @end 201 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSGoodsEditAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGoodsEditAlertView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/9/4. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 商品详情,编辑商品说明 屏幕款 高度159 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | @interface TSGoodsEditAlertView : TSActionAlertView 12 | 13 | @property (strong, nonatomic)TSActionAlertViewStringHandler completeHandler;//完成 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSGoodsEditAlertView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSGoodsEditAlertView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/9/4. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | 9 | #import "TSGoodsEditAlertView.h" 10 | 11 | @interface TSGoodsEditAlertView() 12 | 13 | @property (strong, nonatomic)UILabel * titleLabel; 14 | @property (strong, nonatomic)UIButton * completeBtn; 15 | @property (strong, nonatomic)UITextView * inputView; 16 | 17 | 18 | @end 19 | @implementation TSGoodsEditAlertView 20 | 21 | #pragma mark - Public 22 | 23 | #pragma mark - Init 24 | - (instancetype)initWithAnimationStyle:(TSActionAlertViewTransitionStyle)style{ 25 | 26 | if(self = [super initWithAnimationStyle:style]){ 27 | //注册通知 28 | [[NSNotificationCenter defaultCenter] addObserver:self 29 | selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification 30 | object:nil]; 31 | self.delegate = self; 32 | } 33 | return self; 34 | } 35 | 36 | #pragma mark - 继承 37 | - (void)layoutContainerView{ 38 | //布局containerview的位置,就是那个看得到的视图 39 | CGFloat height = 159; 40 | self.containerView.frame = CGRectMake(0, kScreenHeight - height, kScreenWidth, height); 41 | } 42 | 43 | - (void)setupContainerViewAttributes{ 44 | //设置containerview的属性,比如切边啥的 45 | 46 | } 47 | 48 | - (void)setupContainerSubViews{ 49 | //给containerview添加子视图 50 | [self.containerView addSubview:self.titleLabel]; 51 | [self.containerView addSubview:self.completeBtn]; 52 | [self.containerView addSubview:self.inputView]; 53 | } 54 | 55 | - (void)layoutContainerViewSubViews{ 56 | //设置子视图的frame 57 | self.titleLabel.frame = CGRectMake(15, 10, 100, 17); 58 | self.completeBtn.frame = CGRectMake(kScreenWidth-82, 0, 82, 37);//48+34 59 | self.inputView.frame = CGRectMake(15, 37, kScreenWidth-30, 100); 60 | } 61 | 62 | #pragma mark - Notification 63 | - (void)keyboardWillChangeFrame:(NSNotification *)notification{ 64 | 65 | NSDictionary *userInfo = notification.userInfo; 66 | // 动画的持续时间 67 | double duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; 68 | // 键盘的frame 69 | CGRect keyboardF = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 70 | // 执行动画 71 | [UIView animateWithDuration:duration animations:^{ 72 | // 工具条的Y值 == 键盘的Y值 - 工具条的高度 73 | self.containerView.frame = CGRectMake(0, keyboardF.origin.y - 159, kScreenWidth, 159); 74 | }]; 75 | } 76 | 77 | #pragma mark - Action 78 | - (void)completeAction{ 79 | 80 | NSString * inputString = self.inputView.text; 81 | if (!inputString) { 82 | inputString = @""; 83 | } 84 | 85 | //submit操作 86 | 87 | } 88 | 89 | #pragma mark - TSActionAlertViewDelegate 90 | - (void)actionAlertViewDidShow{ 91 | 92 | [self.inputView becomeFirstResponder]; 93 | } 94 | 95 | #pragma mark - UITextViewDelegate 96 | 97 | - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ 98 | 99 | if ([text isEqualToString:@"\n"]) { 100 | [self completeAction]; 101 | return NO; 102 | } 103 | return YES; 104 | } 105 | 106 | - (void)textViewDidEndEditing:(UITextView *)textView{ 107 | 108 | //[self completeAction]; 109 | } 110 | 111 | //内容发生改变编辑 112 | - (void)textViewDidChange:(UITextView *)textView{ 113 | NSLog(@"%@",textView.text); 114 | NSLog(@"%ld",textView.text.length); 115 | [self textChange]; 116 | 117 | if ([textView.text isEqualToString:@""] ||textView.text ==nil ) { 118 | self.inputView.text = @"请输入活动说明~(150字以内)"; 119 | return; 120 | } 121 | } 122 | 123 | -(void)textChange{ 124 | static const NSInteger Max_Num_TextView = 150; 125 | if (self.inputView.text.length > Max_Num_TextView) { 126 | //对超出部分进行裁剪 127 | self.inputView.text = [self.inputView.text substringToIndex:Max_Num_TextView]; 128 | } 129 | } 130 | 131 | #pragma mark - Lazy 132 | - (UILabel *)titleLabel{ 133 | 134 | if (_titleLabel == nil) { 135 | _titleLabel = [UILabel new]; 136 | _titleLabel.text = @"商品详情"; 137 | _titleLabel.font = [UIFont systemFontOfSize:12]; 138 | _titleLabel.textColor = [UIColor grayColor]; 139 | } 140 | return _titleLabel; 141 | } 142 | 143 | - (UIButton *)completeBtn{ 144 | 145 | if (_completeBtn == nil) { 146 | _completeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 147 | [_completeBtn setTitle:@"编辑完成" forState:UIControlStateNormal]; 148 | _completeBtn.titleLabel.font = [UIFont systemFontOfSize:12]; 149 | [_completeBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal]; 150 | [_completeBtn addTarget:self action:@selector(completeAction) forControlEvents:UIControlEventTouchUpInside]; 151 | } 152 | return _completeBtn; 153 | } 154 | 155 | - (UITextView *)inputView{ 156 | 157 | if (_inputView == nil) { 158 | _inputView = [UITextView new]; 159 | _inputView.font = [UIFont systemFontOfSize:14]; 160 | _inputView.text = @"请输入活动说明~(150字以内)"; 161 | _inputView.delegate = self; 162 | _inputView.returnKeyType = UIReturnKeyDone; 163 | } 164 | return _inputView; 165 | } 166 | 167 | 168 | - (void)dealloc{ 169 | 170 | [[NSNotificationCenter defaultCenter]removeObserver:self]; 171 | } 172 | @end 173 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSPullDownActionAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSPullDownActionAlertView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/12/5. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 团队,时间的 下拉选项 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | @class TSPullDownActionAlertView; 12 | typedef void(^TSPullDownActionAlertViewlHandler)(TSPullDownActionAlertView *alertView,NSInteger index); 13 | @interface TSPullDownActionAlertView : TSActionAlertView 14 | @property (strong, nonatomic)TSPullDownActionAlertViewlHandler touchHandler; 15 | 16 | @property (strong, nonatomic)NSArray * titleArray; 17 | 18 | @property (assign, nonatomic)NSInteger index; 19 | 20 | @property (assign, nonatomic)CGFloat ts_top_Spide;//顶部距离 21 | 22 | //初始化方法 23 | - (instancetype)initWithTitleArray:(NSArray *)titleArray; 24 | 25 | 26 | @end 27 | 28 | 29 | // ================================== cell ======================================== 30 | 31 | @interface TSPullDownActionAlertViewCell : UITableViewCell 32 | 33 | +(instancetype)cellWithTableView:(UITableView *)tableView; 34 | 35 | @property (assign, nonatomic, getter = isSelect)BOOL select; 36 | @property (strong, nonatomic)NSString * title; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSPullDownActionAlertView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSPullDownActionAlertView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/12/5. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | 9 | #define TSPullDownActionAlertViewCellHeight (36.67) 10 | 11 | #import "TSPullDownActionAlertView.h" 12 | 13 | @interface TSPullDownActionAlertView() 14 | 15 | @property (strong, nonatomic)UITableView * tableView; 16 | 17 | @end 18 | 19 | @implementation TSPullDownActionAlertView 20 | 21 | - (void)setTs_top_Spide:(CGFloat)ts_top_Spide{ 22 | _ts_top_Spide = ts_top_Spide; 23 | //调整高度 24 | self.containerView.frame = CGRectMake(0, self.ts_top_Spide, kScreenWidth, self.titleArray.count * TSPullDownActionAlertViewCellHeight); 25 | self.tableView.frame = self.containerView.bounds; 26 | } 27 | 28 | - (void)setTitleArray:(NSArray *)titleArray{ 29 | _titleArray = titleArray; 30 | //调整高度 31 | self.containerView.frame = CGRectMake(0, self.ts_top_Spide, kScreenWidth, titleArray.count * TSPullDownActionAlertViewCellHeight); 32 | self.tableView.frame = self.containerView.bounds; 33 | 34 | [self.tableView reloadData]; 35 | } 36 | 37 | - (void)setIndex:(NSInteger)index{ 38 | _index = index; 39 | [self.tableView reloadData]; 40 | } 41 | 42 | #pragma mark - Init 43 | 44 | - (instancetype)initWithTitleArray:(NSArray *)titleArray{ 45 | if (self = [super initWithAnimationStyle:TSActionAlertViewTransitionStyleFade]) { 46 | 47 | self.titleArray = titleArray; 48 | self.isAutoHidden = YES; 49 | } 50 | return self; 51 | } 52 | 53 | #pragma mark - 继承 54 | - (void)layoutContainerView{ 55 | //布局containerview的位置,就是那个看得到的视图 56 | self.containerView.frame = CGRectMake(0, self.ts_top_Spide, kScreenWidth, self.titleArray.count * TSPullDownActionAlertViewCellHeight); 57 | } 58 | 59 | - (void)setupContainerViewAttributes{ 60 | //设置containerview的属性,比如切边啥的 61 | } 62 | 63 | - (void)setupContainerSubViews{ 64 | //给containerview添加子视图 65 | [self.containerView addSubview:self.tableView]; 66 | } 67 | 68 | - (void)layoutContainerViewSubViews{ 69 | //设置子视图的frame 70 | self.tableView.frame = self.containerView.bounds; 71 | } 72 | 73 | #pragma mark - UITableViewDelegate/UITableViewDataSource 74 | 75 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 76 | TSPullDownActionAlertViewCell * cell = [TSPullDownActionAlertViewCell cellWithTableView:tableView]; 77 | 78 | cell.select = NO; 79 | cell.title = self.titleArray[indexPath.row]; 80 | 81 | if (indexPath.row == self.index) { 82 | cell.select = YES; 83 | } 84 | 85 | return cell; 86 | } 87 | 88 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 89 | if (self.titleArray) { 90 | return self.titleArray.count; 91 | } 92 | 93 | return 0; 94 | } 95 | 96 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 97 | return TSPullDownActionAlertViewCellHeight; 98 | } 99 | 100 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 101 | 102 | self.index = indexPath.row; 103 | [self.tableView reloadData]; 104 | 105 | if (self.touchHandler) { 106 | self.touchHandler(self, indexPath.row); 107 | } 108 | [self dismissAnimated:NO]; 109 | } 110 | 111 | #pragma mark - Lazy 112 | - (UITableView *)tableView{ 113 | if (_tableView == nil) { 114 | _tableView = [UITableView new]; 115 | _tableView.delegate = self; 116 | _tableView.dataSource = self; 117 | _tableView.tableFooterView = [UIView new]; 118 | _tableView.showsVerticalScrollIndicator = NO; 119 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 120 | } 121 | return _tableView; 122 | } 123 | 124 | @end 125 | 126 | @interface TSPullDownActionAlertViewCell() 127 | 128 | @property (strong,nonatomic)UILabel * titleLabel; 129 | @property (strong, nonatomic)UIView * btmLineView; 130 | 131 | @end 132 | 133 | @implementation TSPullDownActionAlertViewCell 134 | 135 | - (void)setSelect:(BOOL)select{ 136 | _select = select; 137 | 138 | if (select) { 139 | self.titleLabel.textColor = [UIColor purpleColor]; 140 | }else{ 141 | self.titleLabel.textColor = [UIColor blackColor]; 142 | } 143 | } 144 | 145 | - (void)setTitle:(NSString *)title{ 146 | _title = title; 147 | self.titleLabel.text = title; 148 | } 149 | 150 | #pragma mark - Init 151 | +(instancetype)cellWithTableView:(UITableView *)tableView{ 152 | NSString * identifity=NSStringFromClass([self class]); 153 | [tableView registerClass:[self class] forCellReuseIdentifier:identifity]; 154 | TSPullDownActionAlertViewCell *cell=[tableView dequeueReusableCellWithIdentifier:identifity]; 155 | cell.selectionStyle=UITableViewCellSelectionStyleNone; 156 | if (cell==nil) { 157 | cell=[[TSPullDownActionAlertViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifity]; 158 | } 159 | return cell; 160 | } 161 | 162 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 163 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 164 | 165 | [self.contentView addSubview:self.titleLabel]; 166 | [self.contentView addSubview:self.btmLineView]; 167 | 168 | self.titleLabel.frame = CGRectMake(20, 0, 100, TSPullDownActionAlertViewCellHeight); 169 | self.btmLineView.frame = CGRectMake(0, TSPullDownActionAlertViewCellHeight -1, kScreenWidth, 1); 170 | 171 | } 172 | return self; 173 | } 174 | 175 | #pragma mark - Lazy 176 | - (UILabel *)titleLabel{ 177 | if (_titleLabel == nil) { 178 | _titleLabel = [UILabel new]; 179 | _titleLabel.font = [UIFont systemFontOfSize:14]; 180 | _titleLabel.textColor = [UIColor blackColor]; 181 | } 182 | return _titleLabel; 183 | } 184 | 185 | - (UIView *)btmLineView{ 186 | if (_btmLineView == nil) { 187 | _btmLineView = [UIView new]; 188 | _btmLineView.backgroundColor = [UIColor lightGrayColor]; 189 | } 190 | return _btmLineView; 191 | } 192 | @end 193 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSTaoSearchView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSTaoSearchView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/10/31. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 淘搜索弹窗 检测粘贴板用 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | @interface TSTaoSearchView : TSActionAlertView 12 | 13 | @property (strong, nonatomic)TSActionAlertViewHandler goHandler; 14 | 15 | + (instancetype)searchActionAlertViewWithString:(NSString *)boardString; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSTaoSearchView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSTaoSearchView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/10/31. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | 9 | #import "TSTaoSearchView.h" 10 | 11 | #define TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH (300.0) 12 | 13 | 14 | @interface TSTaoSearchView() 15 | 16 | @property (strong, nonatomic)UIButton * iconBtn; 17 | 18 | @property (strong, nonatomic)UIView * backView;//白色的底部 19 | @property (strong, nonatomic)UILabel * titleLabel; 20 | 21 | @property (strong, nonatomic)UIView * spidView; 22 | @property (strong, nonatomic)UIButton * cancleBtn; 23 | @property (strong, nonatomic)UIButton * goBtn; 24 | 25 | @end 26 | 27 | @implementation TSTaoSearchView 28 | 29 | #pragma mark - Init 30 | + (instancetype)searchActionAlertViewWithString:(NSString *)boardString{ 31 | TSTaoSearchView * search = [[TSTaoSearchView alloc]initWithAnimationStyle:TSActionAlertViewTransitionStyleDropDown]; 32 | search.titleLabel.text = boardString?boardString:@""; 33 | search.delegate = search; 34 | search.isAutoHidden = YES; 35 | return search; 36 | } 37 | 38 | #pragma mark - 继承 39 | - (void)layoutContainerView{ 40 | 41 | //布局containerview的位置,就是那个看得到的视图 334+34+27 = 395 42 | CGFloat hight = (319 + 53)/2; 43 | CGFloat spideLeft = (kScreenWidth - TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH)/2; 44 | CGFloat spideTop = (kScreenHeight - hight) * 0.4; 45 | self.containerView.frame =CGRectMake(spideLeft, spideTop, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH, hight); 46 | } 47 | 48 | - (void)setupContainerViewAttributes{ 49 | //设置containerview的属性,比如切边啥的 50 | 51 | self.containerView.backgroundColor = [UIColor clearColor]; 52 | } 53 | 54 | - (void)setupContainerSubViews{ 55 | 56 | //给containerview添加子视图 57 | [self.containerView addSubview:self.backView]; 58 | [self.backView addSubview:self.titleLabel]; 59 | 60 | [self.backView addSubview:self.spidView]; 61 | [self.backView addSubview:self.goBtn]; 62 | [self.backView addSubview:self.cancleBtn]; 63 | 64 | [self.containerView addSubview:self.iconBtn]; 65 | 66 | } 67 | 68 | - (void)layoutContainerViewSubViews{ 69 | //设置子视图的frame 70 | self.backView.frame = CGRectMake(0, 53/2.0, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH, 319/2.0); 71 | 72 | CGFloat x = (TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH - (106/2.0))/2; 73 | self.iconBtn.frame = CGRectMake(x, 0, 106/2.0, 106/2.0); 74 | 75 | self.titleLabel.frame = CGRectMake(20, 53/2.0, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH-40, (319-53)/2.0-45); 76 | self.spidView.frame = CGRectMake(0, 319/2.0-45-1, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH, 1); 77 | self.cancleBtn.frame = CGRectMake(0, 319/2.0-45, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH/2, 45); 78 | self.goBtn.frame = CGRectMake(TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH/2, 319/2.0-45, TSTAOSEARCHSALERTVIEW_CONTAINER_WIDTH/2, 45); 79 | 80 | } 81 | 82 | 83 | #pragma mark - Action 84 | - (void)cancleAction{ 85 | //取消 86 | [self dismissAnimated:YES]; 87 | //清空粘贴板 88 | // [UIPasteboard generalPasteboard].string = @""; 89 | 90 | } 91 | 92 | - (void)goAction{ 93 | //去搜索 94 | 95 | if (self.goHandler) { 96 | self.goHandler(self); 97 | } 98 | 99 | [self dismissAnimated:YES]; 100 | } 101 | 102 | 103 | #pragma mark - TSActionAlertViewDelegate 104 | - (void)actionAlertViewWillDismiss{ 105 | //清空粘贴板 106 | // [UIPasteboard generalPasteboard].string = @""; 107 | } 108 | 109 | #pragma mark - Lazy 110 | - (UIButton *)iconBtn{ 111 | if (_iconBtn == nil) { 112 | _iconBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 113 | _iconBtn.userInteractionEnabled = NO; 114 | _iconBtn.backgroundColor = [UIColor orangeColor]; 115 | // [_iconBtn setBackgroundImage:[UIImage imageNamed:@"tao_search_icon"] forState:UIControlStateNormal]; 116 | } 117 | return _iconBtn; 118 | } 119 | 120 | - (UIView *)backView{ 121 | if(_backView == nil){ 122 | _backView = [UIView new]; 123 | _backView.backgroundColor = [UIColor whiteColor]; 124 | _backView.layer.masksToBounds = YES; 125 | _backView.layer.cornerRadius = 15; 126 | } 127 | return _backView; 128 | } 129 | 130 | - (UILabel *)titleLabel{ 131 | if (_titleLabel == nil) { 132 | _titleLabel = [UILabel new]; 133 | _titleLabel.font = [UIFont systemFontOfSize:14]; 134 | _titleLabel.textAlignment = NSTextAlignmentCenter; 135 | _titleLabel.numberOfLines = 0; 136 | _titleLabel.textColor = [UIColor blackColor]; 137 | } 138 | return _titleLabel; 139 | } 140 | 141 | - (UIView *)spidView{ 142 | if (_spidView == nil) { 143 | _spidView = [UIView new]; 144 | _spidView.backgroundColor = [UIColor grayColor]; 145 | } 146 | return _spidView; 147 | } 148 | 149 | - (UIButton *)cancleBtn{ 150 | if (_cancleBtn == nil) { 151 | _cancleBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 152 | [_cancleBtn addTarget:self action:@selector(cancleAction) forControlEvents:UIControlEventTouchUpInside]; 153 | [_cancleBtn setTitle:@"取消" forState:UIControlStateNormal]; 154 | [_cancleBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 155 | _cancleBtn.titleLabel.font = [UIFont systemFontOfSize:16]; 156 | } 157 | return _cancleBtn; 158 | } 159 | 160 | - (UIButton *)goBtn{ 161 | if (_goBtn == nil) { 162 | _goBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 163 | [_goBtn addTarget:self action:@selector(goAction) forControlEvents:UIControlEventTouchUpInside]; 164 | [_goBtn setTitle:@"立即前往" forState:UIControlStateNormal]; 165 | _goBtn.titleLabel.font = [UIFont systemFontOfSize:16]; 166 | [_goBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 167 | _goBtn.backgroundColor = [UIColor orangeColor]; 168 | } 169 | return _goBtn; 170 | } 171 | @end 172 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSWebActionAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSWebActionAlertView.h 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/11/25. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 弹窗, 网页的弹窗 综合了网页的各种打开方式,以及布局 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | typedef NS_ENUM(NSInteger,TSWebActionAlertViewWebType) { 12 | 13 | TSWebActionAlertViewWebTypeDefault,//打开一个web 14 | TSWebActionAlertViewWebTypeOtherWeb,//其他web弹窗,就是站外的URL 15 | }; 16 | 17 | 18 | @interface TSWebActionAlertView : TSActionAlertView 19 | 20 | @property (strong, nonatomic)NSString * urlString; 21 | @property (assign, nonatomic)CGSize size;//宽高 为了适配不同的web, 22 | 23 | @property (assign, nonatomic)TSWebActionAlertViewWebType webType;//web类型 24 | 25 | 26 | //初始化方法 27 | + (instancetype)webActionAlertViewWithWebType:(TSWebActionAlertViewWebType)webType 28 | andURLString:(NSString *)urlString 29 | andSize:(CGSize)size; 30 | 31 | 32 | /** 33 | 初始化方法 34 | 35 | @param webType 网页的类型 如果是 TSWebActionAlertViewWebTypeOtherWeb 需要传全URL 36 | @param urlString webType = TSWebActionAlertViewWebTypeOtherWeb 的话需要传全URL 37 | @param size 可以自定义的size 38 | @return 返回创建好的弹窗 39 | */ 40 | - (instancetype)initWithWebType:(TSWebActionAlertViewWebType)webType 41 | andURLString:(NSString *)urlString 42 | andSize:(CGSize)size; 43 | 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /TSActionAlertViewEffects/TSWebActionAlertView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSWebActionAlertView.m 3 | // JiHeShi 4 | // 5 | // Created by Dylan Chen on 2017/11/25. 6 | // Copyright © 2017年 JiHes. All rights reserved. 7 | // 8 | #define TSTSWEBACTIONALERTVIEW_CONTAINER_WIDTH (260.0) 9 | 10 | #import "TSWebActionAlertView.h" 11 | #import 12 | 13 | @interface TSWebActionAlertView() 14 | 15 | @property (strong, nonatomic)WKWebView * webView; 16 | @property (strong, nonatomic)UIButton * closeBtn; 17 | 18 | @end 19 | 20 | @implementation TSWebActionAlertView 21 | 22 | //初始化方法 23 | + (instancetype)webActionAlertViewWithWebType:(TSWebActionAlertViewWebType)webType 24 | andURLString:(NSString *)urlString 25 | andSize:(CGSize)size{ 26 | 27 | return [[self alloc]initWithWebType:webType andURLString:urlString andSize:size]; 28 | } 29 | 30 | - (instancetype)initWithWebType:(TSWebActionAlertViewWebType)webType 31 | andURLString:(NSString *)urlString 32 | andSize:(CGSize)size{ 33 | 34 | if (self = [super initWithAnimationStyle:TSActionAlertViewTransitionStyleFade]) { 35 | 36 | _webType = webType; 37 | self.size = size; 38 | self.urlString = urlString; 39 | self.isAutoHidden = YES; 40 | 41 | [self loadWebView]; 42 | } 43 | return self; 44 | } 45 | 46 | #pragma mark - Private 47 | - (void)loadWebView{ 48 | //加载web 49 | 50 | 51 | NSString * urlString; 52 | switch (self.webType) { 53 | case TSWebActionAlertViewWebTypeDefault:{ 54 | 55 | NSString * baseReam = @"www.domain.com"; 56 | urlString = [NSString stringWithFormat:@"%@%@",baseReam,self.urlString]; 57 | } 58 | break; 59 | case TSWebActionAlertViewWebTypeOtherWeb:{ 60 | //全URL 61 | urlString = [NSString stringWithFormat:@"%@",self.urlString]; 62 | } 63 | break; 64 | 65 | default: 66 | break; 67 | } 68 | [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]]; 69 | 70 | } 71 | 72 | #pragma mark - 继承 73 | - (void)layoutContainerView{ 74 | 75 | //布局containerview的位置,就是那个看得到的视图 334+34+27 = 395 76 | CGFloat hight = 200; 77 | CGFloat wid = TSTSWEBACTIONALERTVIEW_CONTAINER_WIDTH; 78 | 79 | if (self.size.height != 0) { 80 | hight = self.size.height; 81 | wid = self.size.width; 82 | } 83 | 84 | CGFloat spideLeft = (kScreenWidth - wid)/2; 85 | CGFloat spideTop = (kScreenHeight - hight) * 0.4; 86 | self.containerView.frame =CGRectMake(spideLeft, spideTop, wid, hight); 87 | } 88 | 89 | - (void)setupContainerViewAttributes{ 90 | //设置containerview的属性,比如切边啥的 91 | 92 | self.containerView.backgroundColor = [UIColor whiteColor]; 93 | self.containerView.layer.masksToBounds = YES; 94 | self.containerView.layer.cornerRadius = 5; 95 | } 96 | 97 | - (void)setupContainerSubViews{ 98 | 99 | //给containerview添加子视图 100 | [self.containerView addSubview:self.webView]; 101 | [self.containerView addSubview:self.closeBtn]; 102 | } 103 | 104 | - (void)layoutContainerViewSubViews{ 105 | //设置子视图的frame 106 | self.webView.frame = self.containerView.bounds; 107 | CGFloat wid = TSTSWEBACTIONALERTVIEW_CONTAINER_WIDTH; 108 | if (self.size.height != 0) { 109 | wid = self.size.width; 110 | } 111 | 112 | CGFloat x = wid - 25 - 8; 113 | self.closeBtn.frame = CGRectMake( x, 0, 25, 25); 114 | 115 | } 116 | 117 | #pragma mark - Action 118 | 119 | - (void)cloaseAction{ 120 | [self dismissAnimated:YES]; 121 | } 122 | 123 | #pragma mark - Lazy 124 | - (WKWebView *)webView{ 125 | if (_webView == nil) { 126 | _webView = [WKWebView new]; 127 | } 128 | return _webView; 129 | } 130 | 131 | - (UIButton *)closeBtn{ 132 | if (_closeBtn == nil) { 133 | _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 134 | [_closeBtn setImage:[UIImage imageNamed:@"CLOSE (4)"] forState:UIControlStateNormal]; 135 | [_closeBtn addTarget:self action:@selector(cloaseAction) forControlEvents:UIControlEventTouchUpInside]; 136 | } 137 | return _closeBtn; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FC103DDC1F42CF5E00526E4E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103DDB1F42CF5E00526E4E /* main.m */; }; 11 | FC103DDF1F42CF5E00526E4E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103DDE1F42CF5E00526E4E /* AppDelegate.m */; }; 12 | FC103DE21F42CF5E00526E4E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103DE11F42CF5E00526E4E /* ViewController.m */; }; 13 | FC103DE51F42CF5E00526E4E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FC103DE31F42CF5E00526E4E /* Main.storyboard */; }; 14 | FC103DE71F42CF5E00526E4E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FC103DE61F42CF5E00526E4E /* Assets.xcassets */; }; 15 | FC103DEA1F42CF5E00526E4E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FC103DE81F42CF5E00526E4E /* LaunchScreen.storyboard */; }; 16 | FC103E121F42CF7C00526E4E /* TSActionAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103E0F1F42CF7C00526E4E /* TSActionAlertView.m */; }; 17 | FC103E131F42CF7C00526E4E /* UIWindow+SIUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103E111F42CF7C00526E4E /* UIWindow+SIUtils.m */; }; 18 | FC103E161F42CF8500526E4E /* TSActionDemoView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC103E141F42CF8500526E4E /* TSActionDemoView.m */; }; 19 | FC8D3F411FD7F6F700AF5B28 /* TSWebActionAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D3F371FD7F6F600AF5B28 /* TSWebActionAlertView.m */; }; 20 | FC8D3F421FD7F6F700AF5B28 /* TSTaoSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D3F381FD7F6F600AF5B28 /* TSTaoSearchView.m */; }; 21 | FC8D3F431FD7F6F700AF5B28 /* TSGoodsEditAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D3F3C1FD7F6F700AF5B28 /* TSGoodsEditAlertView.m */; }; 22 | FC8D3F441FD7F6F700AF5B28 /* TSGoTaobaoAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D3F3E1FD7F6F700AF5B28 /* TSGoTaobaoAlertView.m */; }; 23 | FC8D3F451FD7F6F700AF5B28 /* TSPullDownActionAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D3F401FD7F6F700AF5B28 /* TSPullDownActionAlertView.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | FC103DD71F42CF5E00526E4E /* TSAlertActionViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TSAlertActionViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | FC103DDB1F42CF5E00526E4E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | FC103DDD1F42CF5E00526E4E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 30 | FC103DDE1F42CF5E00526E4E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 31 | FC103DE01F42CF5E00526E4E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 32 | FC103DE11F42CF5E00526E4E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 33 | FC103DE41F42CF5E00526E4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | FC103DE61F42CF5E00526E4E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 35 | FC103DE91F42CF5E00526E4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 36 | FC103DEB1F42CF5E00526E4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | FC103E0E1F42CF7C00526E4E /* TSActionAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSActionAlertView.h; sourceTree = ""; }; 38 | FC103E0F1F42CF7C00526E4E /* TSActionAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSActionAlertView.m; sourceTree = ""; }; 39 | FC103E101F42CF7C00526E4E /* UIWindow+SIUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+SIUtils.h"; sourceTree = ""; }; 40 | FC103E111F42CF7C00526E4E /* UIWindow+SIUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+SIUtils.m"; sourceTree = ""; }; 41 | FC103E141F42CF8500526E4E /* TSActionDemoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSActionDemoView.m; sourceTree = ""; }; 42 | FC103E151F42CF8500526E4E /* TSActionDemoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSActionDemoView.h; sourceTree = ""; }; 43 | FC8D3F371FD7F6F600AF5B28 /* TSWebActionAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSWebActionAlertView.m; sourceTree = ""; }; 44 | FC8D3F381FD7F6F600AF5B28 /* TSTaoSearchView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSTaoSearchView.m; sourceTree = ""; }; 45 | FC8D3F391FD7F6F600AF5B28 /* TSGoodsEditAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGoodsEditAlertView.h; sourceTree = ""; }; 46 | FC8D3F3A1FD7F6F600AF5B28 /* TSTaoSearchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSTaoSearchView.h; sourceTree = ""; }; 47 | FC8D3F3B1FD7F6F700AF5B28 /* TSPullDownActionAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSPullDownActionAlertView.h; sourceTree = ""; }; 48 | FC8D3F3C1FD7F6F700AF5B28 /* TSGoodsEditAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGoodsEditAlertView.m; sourceTree = ""; }; 49 | FC8D3F3D1FD7F6F700AF5B28 /* TSGoTaobaoAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGoTaobaoAlertView.h; sourceTree = ""; }; 50 | FC8D3F3E1FD7F6F700AF5B28 /* TSGoTaobaoAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGoTaobaoAlertView.m; sourceTree = ""; }; 51 | FC8D3F3F1FD7F6F700AF5B28 /* TSWebActionAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSWebActionAlertView.h; sourceTree = ""; }; 52 | FC8D3F401FD7F6F700AF5B28 /* TSPullDownActionAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSPullDownActionAlertView.m; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | FC103DD41F42CF5E00526E4E /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | FC103DCE1F42CF5E00526E4E = { 67 | isa = PBXGroup; 68 | children = ( 69 | FC8D3F361FD7F6DA00AF5B28 /* TSActionAlertViewEffects */, 70 | FC103E0D1F42CF7C00526E4E /* TSActionAlertView */, 71 | FC103DD91F42CF5E00526E4E /* TSAlertActionViewDemo */, 72 | FC103DD81F42CF5E00526E4E /* Products */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | FC103DD81F42CF5E00526E4E /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | FC103DD71F42CF5E00526E4E /* TSAlertActionViewDemo.app */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | FC103DD91F42CF5E00526E4E /* TSAlertActionViewDemo */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | FC103E151F42CF8500526E4E /* TSActionDemoView.h */, 88 | FC103E141F42CF8500526E4E /* TSActionDemoView.m */, 89 | FC103DDD1F42CF5E00526E4E /* AppDelegate.h */, 90 | FC103DDE1F42CF5E00526E4E /* AppDelegate.m */, 91 | FC103DE01F42CF5E00526E4E /* ViewController.h */, 92 | FC103DE11F42CF5E00526E4E /* ViewController.m */, 93 | FC103DE31F42CF5E00526E4E /* Main.storyboard */, 94 | FC103DE61F42CF5E00526E4E /* Assets.xcassets */, 95 | FC103DE81F42CF5E00526E4E /* LaunchScreen.storyboard */, 96 | FC103DEB1F42CF5E00526E4E /* Info.plist */, 97 | FC103DDA1F42CF5E00526E4E /* Supporting Files */, 98 | ); 99 | path = TSAlertActionViewDemo; 100 | sourceTree = ""; 101 | }; 102 | FC103DDA1F42CF5E00526E4E /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | FC103DDB1F42CF5E00526E4E /* main.m */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | FC103E0D1F42CF7C00526E4E /* TSActionAlertView */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | FC103E0E1F42CF7C00526E4E /* TSActionAlertView.h */, 114 | FC103E0F1F42CF7C00526E4E /* TSActionAlertView.m */, 115 | FC103E101F42CF7C00526E4E /* UIWindow+SIUtils.h */, 116 | FC103E111F42CF7C00526E4E /* UIWindow+SIUtils.m */, 117 | ); 118 | path = TSActionAlertView; 119 | sourceTree = ""; 120 | }; 121 | FC8D3F361FD7F6DA00AF5B28 /* TSActionAlertViewEffects */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | FC8D3F391FD7F6F600AF5B28 /* TSGoodsEditAlertView.h */, 125 | FC8D3F3C1FD7F6F700AF5B28 /* TSGoodsEditAlertView.m */, 126 | FC8D3F3D1FD7F6F700AF5B28 /* TSGoTaobaoAlertView.h */, 127 | FC8D3F3E1FD7F6F700AF5B28 /* TSGoTaobaoAlertView.m */, 128 | FC8D3F3B1FD7F6F700AF5B28 /* TSPullDownActionAlertView.h */, 129 | FC8D3F401FD7F6F700AF5B28 /* TSPullDownActionAlertView.m */, 130 | FC8D3F3A1FD7F6F600AF5B28 /* TSTaoSearchView.h */, 131 | FC8D3F381FD7F6F600AF5B28 /* TSTaoSearchView.m */, 132 | FC8D3F3F1FD7F6F700AF5B28 /* TSWebActionAlertView.h */, 133 | FC8D3F371FD7F6F600AF5B28 /* TSWebActionAlertView.m */, 134 | ); 135 | path = TSActionAlertViewEffects; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | FC103DD61F42CF5E00526E4E /* TSAlertActionViewDemo */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = FC103E041F42CF5E00526E4E /* Build configuration list for PBXNativeTarget "TSAlertActionViewDemo" */; 144 | buildPhases = ( 145 | FC103DD31F42CF5E00526E4E /* Sources */, 146 | FC103DD41F42CF5E00526E4E /* Frameworks */, 147 | FC103DD51F42CF5E00526E4E /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | ); 153 | name = TSAlertActionViewDemo; 154 | productName = TSAlertActionViewDemo; 155 | productReference = FC103DD71F42CF5E00526E4E /* TSAlertActionViewDemo.app */; 156 | productType = "com.apple.product-type.application"; 157 | }; 158 | /* End PBXNativeTarget section */ 159 | 160 | /* Begin PBXProject section */ 161 | FC103DCF1F42CF5E00526E4E /* Project object */ = { 162 | isa = PBXProject; 163 | attributes = { 164 | LastUpgradeCheck = 0830; 165 | ORGANIZATIONNAME = "Dylan Chen"; 166 | TargetAttributes = { 167 | FC103DD61F42CF5E00526E4E = { 168 | CreatedOnToolsVersion = 8.3.3; 169 | DevelopmentTeam = 26J52EZXXR; 170 | ProvisioningStyle = Automatic; 171 | }; 172 | }; 173 | }; 174 | buildConfigurationList = FC103DD21F42CF5E00526E4E /* Build configuration list for PBXProject "TSAlertActionViewDemo" */; 175 | compatibilityVersion = "Xcode 3.2"; 176 | developmentRegion = English; 177 | hasScannedForEncodings = 0; 178 | knownRegions = ( 179 | en, 180 | Base, 181 | ); 182 | mainGroup = FC103DCE1F42CF5E00526E4E; 183 | productRefGroup = FC103DD81F42CF5E00526E4E /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | FC103DD61F42CF5E00526E4E /* TSAlertActionViewDemo */, 188 | ); 189 | }; 190 | /* End PBXProject section */ 191 | 192 | /* Begin PBXResourcesBuildPhase section */ 193 | FC103DD51F42CF5E00526E4E /* Resources */ = { 194 | isa = PBXResourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | FC103DEA1F42CF5E00526E4E /* LaunchScreen.storyboard in Resources */, 198 | FC103DE71F42CF5E00526E4E /* Assets.xcassets in Resources */, 199 | FC103DE51F42CF5E00526E4E /* Main.storyboard in Resources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXResourcesBuildPhase section */ 204 | 205 | /* Begin PBXSourcesBuildPhase section */ 206 | FC103DD31F42CF5E00526E4E /* Sources */ = { 207 | isa = PBXSourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | FC8D3F421FD7F6F700AF5B28 /* TSTaoSearchView.m in Sources */, 211 | FC8D3F451FD7F6F700AF5B28 /* TSPullDownActionAlertView.m in Sources */, 212 | FC103DE21F42CF5E00526E4E /* ViewController.m in Sources */, 213 | FC8D3F441FD7F6F700AF5B28 /* TSGoTaobaoAlertView.m in Sources */, 214 | FC103DDF1F42CF5E00526E4E /* AppDelegate.m in Sources */, 215 | FC103E121F42CF7C00526E4E /* TSActionAlertView.m in Sources */, 216 | FC103DDC1F42CF5E00526E4E /* main.m in Sources */, 217 | FC8D3F411FD7F6F700AF5B28 /* TSWebActionAlertView.m in Sources */, 218 | FC8D3F431FD7F6F700AF5B28 /* TSGoodsEditAlertView.m in Sources */, 219 | FC103E161F42CF8500526E4E /* TSActionDemoView.m in Sources */, 220 | FC103E131F42CF7C00526E4E /* UIWindow+SIUtils.m in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXSourcesBuildPhase section */ 225 | 226 | /* Begin PBXVariantGroup section */ 227 | FC103DE31F42CF5E00526E4E /* Main.storyboard */ = { 228 | isa = PBXVariantGroup; 229 | children = ( 230 | FC103DE41F42CF5E00526E4E /* Base */, 231 | ); 232 | name = Main.storyboard; 233 | sourceTree = ""; 234 | }; 235 | FC103DE81F42CF5E00526E4E /* LaunchScreen.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | FC103DE91F42CF5E00526E4E /* Base */, 239 | ); 240 | name = LaunchScreen.storyboard; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXVariantGroup section */ 244 | 245 | /* Begin XCBuildConfiguration section */ 246 | FC103E021F42CF5E00526E4E /* Debug */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ANALYZER_NONNULL = YES; 251 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 252 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 253 | CLANG_CXX_LIBRARY = "libc++"; 254 | CLANG_ENABLE_MODULES = YES; 255 | CLANG_ENABLE_OBJC_ARC = YES; 256 | CLANG_WARN_BOOL_CONVERSION = YES; 257 | CLANG_WARN_CONSTANT_CONVERSION = YES; 258 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 259 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INFINITE_RECURSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 265 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 266 | CLANG_WARN_UNREACHABLE_CODE = YES; 267 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 268 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 269 | COPY_PHASE_STRIP = NO; 270 | DEBUG_INFORMATION_FORMAT = dwarf; 271 | ENABLE_STRICT_OBJC_MSGSEND = YES; 272 | ENABLE_TESTABILITY = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu99; 274 | GCC_DYNAMIC_NO_PIC = NO; 275 | GCC_NO_COMMON_BLOCKS = YES; 276 | GCC_OPTIMIZATION_LEVEL = 0; 277 | GCC_PREPROCESSOR_DEFINITIONS = ( 278 | "DEBUG=1", 279 | "$(inherited)", 280 | ); 281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 283 | GCC_WARN_UNDECLARED_SELECTOR = YES; 284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 285 | GCC_WARN_UNUSED_FUNCTION = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 288 | MTL_ENABLE_DEBUG_INFO = YES; 289 | ONLY_ACTIVE_ARCH = YES; 290 | SDKROOT = iphoneos; 291 | }; 292 | name = Debug; 293 | }; 294 | FC103E031F42CF5E00526E4E /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ALWAYS_SEARCH_USER_PATHS = NO; 298 | CLANG_ANALYZER_NONNULL = YES; 299 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BOOL_CONVERSION = YES; 305 | CLANG_WARN_CONSTANT_CONVERSION = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 308 | CLANG_WARN_EMPTY_BODY = YES; 309 | CLANG_WARN_ENUM_CONVERSION = YES; 310 | CLANG_WARN_INFINITE_RECURSION = YES; 311 | CLANG_WARN_INT_CONVERSION = YES; 312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 313 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 314 | CLANG_WARN_UNREACHABLE_CODE = YES; 315 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 316 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 317 | COPY_PHASE_STRIP = NO; 318 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 319 | ENABLE_NS_ASSERTIONS = NO; 320 | ENABLE_STRICT_OBJC_MSGSEND = YES; 321 | GCC_C_LANGUAGE_STANDARD = gnu99; 322 | GCC_NO_COMMON_BLOCKS = YES; 323 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 324 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 325 | GCC_WARN_UNDECLARED_SELECTOR = YES; 326 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 327 | GCC_WARN_UNUSED_FUNCTION = YES; 328 | GCC_WARN_UNUSED_VARIABLE = YES; 329 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 330 | MTL_ENABLE_DEBUG_INFO = NO; 331 | SDKROOT = iphoneos; 332 | VALIDATE_PRODUCT = YES; 333 | }; 334 | name = Release; 335 | }; 336 | FC103E051F42CF5E00526E4E /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 340 | DEVELOPMENT_TEAM = 26J52EZXXR; 341 | INFOPLIST_FILE = TSAlertActionViewDemo/Info.plist; 342 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 343 | PRODUCT_BUNDLE_IDENTIFIER = TS.TSAlertActionViewDemo; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | }; 346 | name = Debug; 347 | }; 348 | FC103E061F42CF5E00526E4E /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | DEVELOPMENT_TEAM = 26J52EZXXR; 353 | INFOPLIST_FILE = TSAlertActionViewDemo/Info.plist; 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 355 | PRODUCT_BUNDLE_IDENTIFIER = TS.TSAlertActionViewDemo; 356 | PRODUCT_NAME = "$(TARGET_NAME)"; 357 | }; 358 | name = Release; 359 | }; 360 | /* End XCBuildConfiguration section */ 361 | 362 | /* Begin XCConfigurationList section */ 363 | FC103DD21F42CF5E00526E4E /* Build configuration list for PBXProject "TSAlertActionViewDemo" */ = { 364 | isa = XCConfigurationList; 365 | buildConfigurations = ( 366 | FC103E021F42CF5E00526E4E /* Debug */, 367 | FC103E031F42CF5E00526E4E /* Release */, 368 | ); 369 | defaultConfigurationIsVisible = 0; 370 | defaultConfigurationName = Release; 371 | }; 372 | FC103E041F42CF5E00526E4E /* Build configuration list for PBXNativeTarget "TSAlertActionViewDemo" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | FC103E051F42CF5E00526E4E /* Debug */, 376 | FC103E061F42CF5E00526E4E /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | /* End XCConfigurationList section */ 382 | }; 383 | rootObject = FC103DCF1F42CF5E00526E4E /* Project object */; 384 | } 385 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dylan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dylan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/xcuserdata/dylan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/xcuserdata/dylan.xcuserdatad/xcschemes/TSAlertActionViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo.xcodeproj/xcuserdata/dylan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TSAlertActionViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FC103DD61F42CF5E00526E4E 16 | 17 | primary 18 | 19 | 20 | FC103DEF1F42CF5E00526E4E 21 | 22 | primary 23 | 24 | 25 | FC103DFA1F42CF5E00526E4E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TSAlertActionViewDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TSAlertActionViewDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | @property (strong,nonatomic)ViewController * root; 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | // Override point for customization after application launch. 22 | 23 | // NSArray *windows = [[UIApplication sharedApplication] windows]; 24 | // for(UIWindow *window in windows) { 25 | // if(window.rootViewController == nil){ 26 | // UIViewController* vc = [[UIViewController alloc]initWithNibName:nil bundle:nil]; 27 | // window.rootViewController = vc; 28 | // } 29 | // } 30 | // 31 | // self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 32 | // self.window.backgroundColor = [UIColor whiteColor]; 33 | // [self.window makeKeyAndVisible]; 34 | // self.root = [ViewController new]; 35 | // [self.window setRootViewController:self.root]; 36 | 37 | return YES; 38 | } 39 | 40 | 41 | - (void)applicationWillResignActive:(UIApplication *)application { 42 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 43 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 44 | } 45 | 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application { 48 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 49 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 50 | } 51 | 52 | 53 | - (void)applicationWillEnterForeground:(UIApplication *)application { 54 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 55 | } 56 | 57 | 58 | - (void)applicationDidBecomeActive:(UIApplication *)application { 59 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 60 | } 61 | 62 | 63 | - (void)applicationWillTerminate:(UIApplication *)application { 64 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/CLOSE (4).imageset/CLOSE (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/CLOSE (4).imageset/CLOSE (4).png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/CLOSE (4).imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "CLOSE (4).png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00000.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00000.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00000.imageset/合成 1_00000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00000.imageset/合成 1_00000.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00001.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00001.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00001.imageset/合成 1_00001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00001.imageset/合成 1_00001.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00002.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00002.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00002.imageset/合成 1_00002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00002.imageset/合成 1_00002.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00003.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00003.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00003.imageset/合成 1_00003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00003.imageset/合成 1_00003.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00004.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00004.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00004.imageset/合成 1_00004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00004.imageset/合成 1_00004.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00005.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00005.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00005.imageset/合成 1_00005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00005.imageset/合成 1_00005.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00006.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00006.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00006.imageset/合成 1_00006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00006.imageset/合成 1_00006.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00007.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "合成 1_00007.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Assets.xcassets/合成 1_00007.imageset/合成 1_00007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/TSAlertActionViewDemo/Assets.xcassets/合成 1_00007.imageset/合成 1_00007.png -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/TSActionDemoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSActionDemoView.h 3 | // TSAlertActionDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import "TSActionAlertView.h" 10 | 11 | @interface TSActionDemoView : TSActionAlertView 12 | 13 | @property (strong,nonatomic)TSActionAlertViewStringHandler stringHandler; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/TSActionDemoView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TSActionDemoView.m 3 | // TSAlertActionDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import "TSActionDemoView.h" 10 | 11 | #define ScreenWidth ([UIScreen mainScreen].bounds.size.width) 12 | #define ScreenHeight ([UIScreen mainScreen].bounds.size.height) 13 | 14 | @interface TSActionDemoView() 15 | 16 | @property (strong,nonatomic)UIButton * headerBtn;//头部视图 17 | @property (strong,nonatomic)UITextField * inputField;//输入框 18 | @property (strong,nonatomic)UIButton * sureBtn;//确定按钮 19 | @property (strong,nonatomic)UIButton * cancelBtn;//取消按钮 20 | 21 | @end 22 | @implementation TSActionDemoView 23 | 24 | - (instancetype)init{ 25 | if (self = [super init]) { 26 | //改变一些本身的属性简易在这里改 27 | //change some propertys for TSActionAlertView 28 | 29 | } 30 | return self; 31 | } 32 | 33 | - (void)layoutContainerView{ 34 | //布局containerview的位置,就是那个看得到的视图 35 | //layout self.containerView self.containerview is the alertView 36 | CGFloat hight = 222; 37 | CGFloat spideLeft = (ScreenWidth - TSACTIONVIEW_CONTAINER_WIDTH)/2; 38 | CGFloat spideTop = (ScreenHeight - hight) * 0.4; 39 | self.containerView.frame = CGRectMake(spideLeft, spideTop,TSACTIONVIEW_CONTAINER_WIDTH, hight); 40 | 41 | } 42 | 43 | - (void)setupContainerViewAttributes{ 44 | //设置containerview的属性,比如切边啥的 45 | //add propertys for self.containerView 46 | 47 | self.containerView.layer.masksToBounds = YES; 48 | self.containerView.layer.cornerRadius = 15; 49 | 50 | } 51 | 52 | - (void)setupContainerSubViews{ 53 | //给containerview添加子视图 54 | //add subviews for self.containerView 55 | [self.containerView addSubview:self.headerBtn]; 56 | [self.containerView addSubview:self.inputField]; 57 | [self.containerView addSubview:self.sureBtn]; 58 | [self.containerView addSubview:self.cancelBtn]; 59 | } 60 | 61 | - (void)layoutContainerViewSubViews{ 62 | //设置子视图的frame 63 | self.headerBtn.frame = CGRectMake(0, 0, TSACTIONVIEW_CONTAINER_WIDTH, 80); 64 | self.inputField.frame = CGRectMake(TSACTIONVIEW_CONTAINER_WIDTH *0.1 , 90, TSACTIONVIEW_CONTAINER_WIDTH* 0.8, 50); 65 | self.cancelBtn.frame = CGRectMake(17, 160, (TSACTIONVIEW_CONTAINER_WIDTH - 17*3)/2, 44); 66 | self.sureBtn.frame = CGRectMake(17*2 + (TSACTIONVIEW_CONTAINER_WIDTH - 17*3)/2, 160, (TSACTIONVIEW_CONTAINER_WIDTH - 17*3)/2, 44); 67 | } 68 | 69 | 70 | #pragma mark - Action 71 | - (void)sureAction{ 72 | //确定操作 73 | if (self.stringHandler) { 74 | self.stringHandler(self, self.inputField.text); 75 | } 76 | } 77 | 78 | - (void)cancaleAction{ 79 | //取消操作 80 | [self dismissAnimated:YES]; 81 | } 82 | #pragma mark - Lazy 83 | 84 | //头部视图 85 | - (UIButton *)headerBtn{ 86 | if (_headerBtn == nil) { 87 | _headerBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 88 | _headerBtn.backgroundColor = [UIColor redColor]; 89 | [_headerBtn setTitle:@"Alert Title" forState:UIControlStateNormal]; 90 | _headerBtn.userInteractionEnabled = NO; 91 | } 92 | return _headerBtn; 93 | } 94 | 95 | //输入框 96 | - (UITextField *)inputField{ 97 | if (_inputField == nil){ 98 | _inputField = [UITextField new]; 99 | _inputField.textAlignment = NSTextAlignmentCenter; 100 | _inputField.placeholder = @"phone number"; 101 | _inputField.layer.borderColor = [UIColor lightGrayColor].CGColor;\ 102 | _inputField.layer.borderWidth = 1; 103 | _inputField.layer.cornerRadius = 5; 104 | _inputField.layer.masksToBounds = YES; 105 | } 106 | return _inputField ; 107 | } 108 | 109 | //确定 110 | - (UIButton *)sureBtn{ 111 | if (_sureBtn == nil) { 112 | _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 113 | _sureBtn.backgroundColor = [UIColor redColor]; 114 | [_sureBtn setTitle:@"Accept" forState:UIControlStateNormal]; 115 | _sureBtn.layer.cornerRadius = 5; 116 | _sureBtn.layer.masksToBounds = YES; 117 | [_sureBtn addTarget:self action:@selector(sureAction) forControlEvents:UIControlEventTouchUpInside]; 118 | } 119 | return _sureBtn; 120 | } 121 | 122 | //取消 123 | - (UIButton *)cancelBtn{ 124 | if (_cancelBtn == nil) { 125 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 126 | [_cancelBtn setTitle:@"Cancle" forState:UIControlStateNormal]; 127 | _cancelBtn.backgroundColor =[UIColor lightGrayColor]; 128 | _cancelBtn.layer.cornerRadius = 5; 129 | _cancelBtn.layer.masksToBounds = YES; 130 | [_cancelBtn addTarget:self action:@selector(cancaleAction) forControlEvents:UIControlEventTouchUpInside]; 131 | } 132 | return _cancelBtn; 133 | } 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TSAlertActionViewDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TSAlertActionViewDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "TSActionDemoView.h" 11 | #import "TSTaoSearchView.h" 12 | #import "TSGoodsEditAlertView.h" 13 | #import "TSWebActionAlertView.h" 14 | #import "TSPullDownActionAlertView.h" 15 | #import "TSGoTaobaoAlertView.h" 16 | 17 | @interface ViewController () 18 | @property (weak, nonatomic) IBOutlet UIButton *showBtn; 19 | 20 | @property (strong,nonatomic)UITableView * tableView; 21 | 22 | @property (strong,nonatomic)NSMutableArray * dataArray; 23 | 24 | @property (strong, nonatomic)NSMutableArray * effectArray; 25 | 26 | @property (strong, nonatomic)TSPullDownActionAlertView *pullDownAlertView; 27 | 28 | @end 29 | 30 | @implementation ViewController 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | 35 | [self configSubViews]; 36 | 37 | [self layoutSubViews]; 38 | // Do any additional setup after loading the view, typically from a nib. 39 | } 40 | 41 | - (void)configSubViews{ 42 | 43 | [self.view addSubview:self.tableView]; 44 | } 45 | 46 | - (void)layoutSubViews{ 47 | 48 | self.tableView.frame = CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height); 49 | } 50 | 51 | #pragma mark - UITableViewDelegate/UITableViewDataSource 52 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ 53 | return 2; 54 | } 55 | 56 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 57 | return 30; 58 | } 59 | 60 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ 61 | return 20; 62 | } 63 | 64 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ 65 | return [[UIView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 20)]; 66 | } 67 | 68 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 69 | 70 | UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 71 | if (cell == nil) { 72 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 73 | } 74 | 75 | if (indexPath.section == 0) { 76 | cell.textLabel.text = self.dataArray[indexPath.row]; 77 | }else{ 78 | cell.textLabel.text = self.effectArray[indexPath.row]; 79 | } 80 | return cell; 81 | } 82 | 83 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 84 | 85 | if (indexPath.section == 0) { 86 | TSActionAlertViewBackgroundStyle backgroundStyle; 87 | TSActionAlertViewTransitionStyle transitionStyle; 88 | BOOL isautoHidden = NO; 89 | 90 | switch (indexPath.row) { 91 | case 0:{ 92 | backgroundStyle = TSActionAlertViewBackgroundStyleGradient; 93 | transitionStyle = TSActionAlertViewTransitionStyleSlideFromBottom; 94 | } 95 | break; 96 | case 1:{ 97 | backgroundStyle = TSActionAlertViewBackgroundStyleGradient; 98 | transitionStyle = TSActionAlertViewTransitionStyleFade; 99 | } 100 | break; 101 | case 2:{ 102 | backgroundStyle = TSActionAlertViewBackgroundStyleGradient; 103 | transitionStyle = TSActionAlertViewTransitionStyleBounce; 104 | } 105 | break; 106 | case 3:{ 107 | backgroundStyle = TSActionAlertViewBackgroundStyleGradient; 108 | transitionStyle = TSActionAlertViewTransitionStyleDropDown; 109 | } 110 | break; 111 | case 4:{ 112 | backgroundStyle = TSActionAlertViewBackgroundStyleGradient; 113 | transitionStyle = TSActionAlertViewTransitionStyleSlideFromTop; 114 | } 115 | break; 116 | case 5:{ 117 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 118 | transitionStyle = TSActionAlertViewTransitionStyleSlideFromBottom; 119 | } 120 | break; 121 | case 6:{ 122 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 123 | transitionStyle = TSActionAlertViewTransitionStyleFade; 124 | } 125 | break; 126 | case 7:{ 127 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 128 | transitionStyle = TSActionAlertViewTransitionStyleBounce; 129 | } 130 | break; 131 | case 8:{ 132 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 133 | transitionStyle = TSActionAlertViewTransitionStyleDropDown; 134 | } 135 | break; 136 | case 9:{ 137 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 138 | transitionStyle = TSActionAlertViewTransitionStyleSlideFromTop; 139 | } 140 | break; 141 | case 10:{ 142 | backgroundStyle = TSActionAlertViewBackgroundStyleSolid; 143 | transitionStyle = TSActionAlertViewTransitionStyleSlideFromTop; 144 | isautoHidden = YES; 145 | } 146 | break; 147 | 148 | default:{ 149 | backgroundStyle = 0; 150 | transitionStyle = 0; 151 | } 152 | break; 153 | } 154 | 155 | TSActionDemoView * demoAlertView = [TSActionDemoView actionAlertViewWithAnimationStyle:transitionStyle]; 156 | demoAlertView.backgroundStyle = backgroundStyle; 157 | demoAlertView.isAutoHidden = isautoHidden; 158 | 159 | typeof(TSActionDemoView) __weak *weakView = demoAlertView; 160 | [demoAlertView setStringHandler:^(TSActionAlertView *alertView,NSString * string){ 161 | typeof(TSActionDemoView) __strong *strongView = weakView; 162 | 163 | NSLog(@"Get string: %@",string); 164 | [strongView dismissAnimated:YES]; 165 | }]; 166 | 167 | [demoAlertView show]; 168 | }else{ 169 | switch (indexPath.row) { 170 | case 0: { 171 | TSTaoSearchView * taoSearchView = [TSTaoSearchView searchActionAlertViewWithString:@"这是弹窗内容~"]; 172 | [taoSearchView show]; 173 | } 174 | break; 175 | case 1: { 176 | TSGoodsEditAlertView * editAlertView = [[TSGoodsEditAlertView alloc]initWithAnimationStyle:TSActionAlertViewTransitionStyleFade]; 177 | editAlertView.isAutoHidden = YES; 178 | [editAlertView setCompleteHandler:^(TSActionAlertView *alertView,NSString * string){ 179 | 180 | }]; 181 | [editAlertView show]; 182 | } 183 | break; 184 | case 2: { 185 | TSWebActionAlertView * webAlert = [TSWebActionAlertView webActionAlertViewWithWebType:TSWebActionAlertViewWebTypeOtherWeb andURLString:@"https://www.baidu.com" andSize:CGSizeMake(320, 200)]; 186 | [webAlert show]; 187 | } 188 | break; 189 | case 3: { 190 | [self.pullDownAlertView show]; 191 | } 192 | break; 193 | case 4: { 194 | TSGoTaobaoAlertView * goTaobaoAlert = [[TSGoTaobaoAlertView alloc]initWithMuchString:@"123.00"]; 195 | goTaobaoAlert.isAutoHidden = YES; 196 | [goTaobaoAlert startAnimation]; 197 | 198 | [goTaobaoAlert show]; 199 | } 200 | break; 201 | 202 | default: 203 | break; 204 | } 205 | } 206 | 207 | } 208 | 209 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 210 | 211 | if(section == 0){ 212 | return self.dataArray.count; 213 | 214 | }else{ 215 | return self.effectArray.count; 216 | } 217 | } 218 | 219 | #pragma mark - Lazy 220 | - (UITableView *)tableView{ 221 | 222 | if (_tableView== nil) { 223 | _tableView = [UITableView new]; 224 | _tableView.delegate = self; 225 | _tableView.dataSource = self; 226 | [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; 227 | _tableView.tableFooterView = [UIView new]; 228 | } 229 | return _tableView; 230 | } 231 | 232 | - (NSMutableArray *)dataArray{ 233 | 234 | if (_dataArray == nil) { 235 | NSArray * array = @[ 236 | @"背景:渐变 动画:上来,然后下去", 237 | @"背景:渐变 动画:渐变", 238 | @"背景:渐变 动画:弹出", 239 | @"背景:渐变 动画:下落", 240 | @"背景:渐变 动画:下滑,然后上去", 241 | @"背景:半透明 动画:上来,然后下去", 242 | @"背景:半透明 动画:渐变", 243 | @"背景:半透明 动画:弹出", 244 | @"背景:半透明 动画:下落", 245 | @"背景:半透明 动画:下滑,然后上去", 246 | @"点击背景自动隐藏" 247 | ]; 248 | _dataArray = [NSMutableArray arrayWithArray:array]; 249 | } 250 | return _dataArray; 251 | } 252 | 253 | - (NSMutableArray *)effectArray{ 254 | if (_effectArray == nil) { 255 | NSArray * array = @[ 256 | @"效果: 正常展示弹窗", 257 | @"效果: 输入弹窗", 258 | @"效果: 打开一个网页", 259 | @"效果: 下拉选项", 260 | @"效果: 跳转动画" 261 | ]; 262 | _effectArray = [NSMutableArray arrayWithArray:array]; 263 | } 264 | return _effectArray; 265 | } 266 | 267 | #pragma mark - Lazy 268 | - (TSPullDownActionAlertView *)pullDownAlertView{ 269 | if (!_pullDownAlertView) { 270 | _pullDownAlertView = [[TSPullDownActionAlertView alloc]initWithTitleArray:@[@"选项1",@"选项2",@"选项3",@"选项4",@"选项5"]]; 271 | _pullDownAlertView.ts_top_Spide = 270; 272 | } 273 | return _pullDownAlertView; 274 | } 275 | @end 276 | -------------------------------------------------------------------------------- /TSAlertActionViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TSAlertActionViewDemo 4 | // 5 | // Created by Dylan Chen on 2017/8/15. 6 | // Copyright © 2017年 Dylan Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo_gifs/1. normal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/1. normal.gif -------------------------------------------------------------------------------- /demo_gifs/2. input.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/2. input.gif -------------------------------------------------------------------------------- /demo_gifs/3. web.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/3. web.gif -------------------------------------------------------------------------------- /demo_gifs/4. pull.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/4. pull.gif -------------------------------------------------------------------------------- /demo_gifs/5. jump.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/5. jump.gif -------------------------------------------------------------------------------- /demo_gifs/gifImage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TsnumiDC/TSActionAlertView/c4990edd9f3514cfbc9986526443eead2de10669/demo_gifs/gifImage.gif --------------------------------------------------------------------------------