//
// SlCustomAlertView.h
// MyDemo
//
// Created by SunLu on 2017/1/6.
// Copyright © 2017年 Sl. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Masonry.h>
@interface SlAlertViewManager : NSObject
@end
typedef void(^Sl_ocIndex)(NSIndexPath *indexPath ,NSDictionary *info);
@interface Sl_AlertSecurityChooseView : UIView
@property(nonatomic,copy) Sl_ocIndex rowIndex;
-(instancetype)initWithFrame:(CGRect)frame list:(NSArray *)wifiArray title:(NSString *)title selectedRow:(Sl_ocIndex)selectedRow;
-(void)reloadViewWithWiFiList:(NSArray *)wifiArray;
@end
typedef NS_ENUM(NSInteger ,IPUIViewMode)
{
IPUIViewModeMessageRightButtonHighlight = 0,
IPUIViewModeMessageLeftButtonHighlight = 1,
IPUIViewModeNameAndPassword = 2,
};
typedef void(^Sl_clickBlock)(UIButton *clickedBtn, id object);
typedef void(^Sl_confirmBtnBlock)(UIButton *clickedBtn, id object);
@interface SlCustomAlertView : UIView
@property(nonatomic,strong) UIView *contentView;
@property(nonatomic,strong) UIButton *cancel;
@property(nonatomic,strong) UIButton *other;
@property(nonatomic,copy) Sl_clickBlock block;
@property (nonatomic, copy) Sl_confirmBtnBlock Sl_confirmBtnBlock;
+(void)dismissView;
+(void)dismissAllView;
/***************************************信息警告*************************************/
@property(nonatomic,strong) UILabel *title;
@property(nonatomic,strong) UILabel *message;
@property(nonatomic,strong) UIButton *confirmBtn;
/*
title 提示框标题文本
messages 提示语文本数组
msgColors 提示语文本颜色数组,显示的颜色值一一对应 提示语
leftButtonStr 左侧按钮标题
rightButtonStr 右侧按钮标题
height 提示框高度,可以不传,程序可自适应高度
textAlignment 提示文本对齐方式
clickedBtnIndex button事件回调(必须实现)
*/
+(void) showRightButtonHighlightWithTitle:(NSString *)title messages:(NSArray *)messages msgColors:(NSArray *)msgColors leftButton:(NSString *)leftButtonStr rightButton:(NSString *)rightButtonStr viewHeight:(CGFloat)height textAlignment:(NSTextAlignment)textAlignment clickedButton:(Sl_clickBlock)clickedBtnIndex;
+(void) showLeftButtonHighlightWithTitle:(NSString *)title messages:(NSArray *)messages msgColors:(NSArray *)msgColors leftButton:(NSString *)leftButtonStr rightButton:(NSString *)rightButtonStr viewHeight:(CGFloat)height textAlignment:(NSTextAlignment)textAlignment clickedButton:(Sl_clickBlock)clickedBtnIndex;
/***************************************信息警告*************************************/
/***************************************name and pw*************************************/
@property(nonatomic,strong) UITextField *nameTexF;
@property(nonatomic,strong) UITextField *securityTexF;
@property(nonatomic,strong) UITextField *passwordTexF;
@property(nonatomic,assign) BOOL canEdName;
+(void)showWithTitle:(NSString *)title inputName:(NSString *)name inputPassword:(NSString *)pw canEditName:(BOOL)canEdName clickedBtn:(Sl_clickBlock)clicked;
//just password
+(void)showPwdInWithTitle:(NSString *)title cancel:(NSString*)cancel ok:(NSString*)ok clickedBtn:(Sl_clickBlock)clicked;
/***************************************name and pw*************************************/
/*************************************** imageAlertView *************************************/
@property(nonatomic,strong) UIImageView *imageView;
+(void)showTitle:(NSString *)title message:(NSString *)msg image:(UIImage *)img iamgeSize:(CGSize)size buttenTitle:(NSString *)btnTitle lickedBtn:(Sl_clickBlock)clicked;
/*************************************** imageAlertView *************************************/
@end
/*************************************** 类扩展 *************************************/
/********** UIColor 类扩展 *********/
@interface UIColor (Extern)
+ (UIColor *)colorWithHexString:(NSString *)color;
//从十六进制字符串获取颜色,
//color:支持@“#123456”、 @“0X123456”、 @“123456”三种格式
+ (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha;
@end
@interface UIImage (SLColorImage)
+ (UIImage*)imageWithColor:(UIColor*)color;
@end
/********** UIButton 类扩展 *********/
@interface UIButton (Extern)
+ (UIButton *)buttonWithImage:(NSString *)image
highlightImage:(NSString *)highlightImage
tag:(NSInteger)tag;
+ (UIButton *)buttonWithColor:(UIColor *)color title:(NSString *)title;
+ (UIButton *)buttonWithBgColor:(UIColor *)color titleColor:(UIColor *)titleColor title:(NSString *)title;
+ (UIButton *)buttonWithImage:(UIImage *)image;
@end
/********** UIButton 类扩展 *********/
@interface UIView (Category)
- (void )CutCircleWithRadius:(CGFloat)radius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
- (void )CutCircleWithRadius:(CGFloat)radius byRoundingCorners:(UIRectCorner)corners;
@end