Initial commit

This commit is contained in:
ifish
2017-08-15 16:59:01 +08:00
commit bdc83e07ef
5766 changed files with 423223 additions and 0 deletions
@@ -0,0 +1,19 @@
//
// FounderButton.h
// P2PPlayingbackVC
//
// Created by apple on 16/7/19.
// Copyright © 2016年 yuanHongQiang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UIViewExt.h"
@interface FounderButton : UIButton
@property(nonatomic,assign)NSInteger yTag;
@property(nonatomic,assign)CGSize buttonImageViewSize;
@property(nonatomic,assign)CGFloat buttonImageLeftOffset;
@property(nonatomic,assign)CGFloat buttonImageUpOffset;
/**这个方法建议不要使用,会出现布局的问题,请使用 setImage的方法*/
-(void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state NS_DEPRECATED_IOS(2_0, 3_0);
@end
@@ -0,0 +1,34 @@
//
// YTheNaviBar.h
// YTheNaviBar
//
// Created by apple on 16/8/8.
// Copyright © 2016年 apple. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UIViewExt.h"
#import "FounderButton.h"
NS_ASSUME_NONNULL_BEGIN
@interface YTheNaviBar : UIControl
@property(nonatomic,assign)NSInteger yTag;
@property(nonatomic,assign)CGFloat yBarLeftSpace;
@property(nonatomic,assign)CGFloat yBarRightSpace;
@property(nonatomic,strong,nullable)UIColor* yBarColor;
@property(nonatomic,strong,nullable)UIImage* yBarImage;
@property(nonatomic,strong,nullable)UIColor* yBarBottomLineColor;
@property(nonatomic,assign)CGFloat yBarBottomLineHeight;
@property(nonatomic,copy,nullable)NSAttributedString* yBarTextLeft;
@property(nonatomic,copy,nullable)NSAttributedString* yBarTextCenter;
@property(nonatomic,copy,nullable)NSAttributedString* yBarTextRight;
/**传入的按钮必需有宽值*/
@property(nonatomic,copy,nullable)NSArray<FounderButton*>* yBarButtonsLeft;
/**传入的按钮必需有宽值*/
@property(nonatomic,copy,nullable)NSArray<FounderButton*>* yBarButtonsRight;
-(NSAttributedString*)gtTextWithString:(nullable NSString*)str
withColor:(nullable UIColor*)color
withFont:(nullable UIFont*)font
withAlignment:(NSTextAlignment)alig;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,39 @@
//
// YFonc.h
// YFonc
//
// Created by apple on 16/7/15.
// Copyright © 2016年 yuanHongQiang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#ifndef RGBA
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#endif
@interface YFonc : NSObject
#pragma mark - 数值类
+(CGSize)gtTextCGSize:(NSString* __nullable)string withTextMaxWidth:(CGFloat)textMaxWidth withFont:(UIFont* __nullable)font;//获取文本的最佳尺寸,布局时经常用到
+(CGSize)gtAttributeTextCGSize:(NSAttributedString* __nullable)string withTextMaxWidth:(CGFloat)textMaxWidth withFont:(UIFont* __nullable)font;//获取多属性文本的尺寸
+(CGSize)gtImageThumbnailSize:(UIImage* __nullable)image maxWidth:(CGFloat)width maxHeight:(CGFloat)heigh;//获取图片缩略图的尺寸
+(NSInteger)gtVersionCompareWithOld:(NSString* __nullable)oldVer withNew:(NSString* __nullable)newVer;//比较两个版本号,更大返回1,相等或者无法比较返回0,更旧返回-1
+(CGFloat)gtItemBestSpaceWithMinSpace:(CGFloat)space withItemWidth:(CGFloat)itw withViewWidth:(CGFloat)width;//获取最佳间距,用于表格格子的平均间距
+(BOOL)gtIsLandscape;//获取当前屏幕是否是横屏
#pragma mark - 文本类
+(NSString* __nullable)gtFileSizeToString:(CGFloat)size;//文件大小单位的转换
#pragma mark - 富文本类
+(NSAttributedString* __nullable)gtTextWithString:(NSString* __nullable)str withColor:(UIColor* __nullable)color withFont:(UIFont* __nullable)font withAlignment:(NSTextAlignment)alig;//获取一个带颜色,大小,对齐的基本富文本
#pragma mark - 颜色类
+(UIColor* __nullable)gtColorWithHexString:(NSString* __nullable)color;//十六进制颜色转换
#pragma mark - 图片类
+(UIImage* __nullable)gtQRImageWithString:(NSString* __nullable)str withColor:(UIColor* __nullable)color withWidth:(CGFloat)width;//得到二维码
+(UIImage* __nullable)gtImageFromColor:(UIColor* __nullable)color;//从颜色转图片
+(UIImage* __nullable)gtSegImageFromImageLeft:(UIImage* __nullable)imageL imageRight:(UIImage* __nullable)imageR size:(CGSize)size;//得到左右比例正确的图片拼接
+(UIImage* __nullable)gtRoundedCornerImageWithCornerRadius:(CGFloat)cornerRadius withImage:(UIImage* __nullable)theImage;//得到圆角图片
+(UIImage* __nullable)gtImageFromLayer:(CALayer* __nullable)layer;//从layer得到图片,可以用作屏幕截图
@end
@@ -0,0 +1,45 @@
//
// YMsgBox.h
// YMsgBox
//
// Created by apple on 16/8/11.
// Copyright © 2016年 YuanHongQiang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FXBlurView.h"
#import "UIViewExt.h"
#import "YTargetAndAction.h"
#import "YFonc.h"
typedef NS_ENUM(NSInteger,YMsgBoxMsgType){
YMsgBoxMsgTypeButtonBeClick
};
@interface YMsgBox : UIViewController<UITextFieldDelegate>
@property(nonatomic,assign)NSInteger theTag;
@property(nonatomic,copy,nullable)NSString* theTagString;
@property(nonatomic,strong,nullable)NSMutableDictionary<NSString*,id>* theTagUserInfo;
@property(nonatomic,assign)CGFloat yMsgWidth;//弹窗宽度,默认为275像素
@property(nonatomic,assign)CGFloat yMsgMinHeight;//弹窗的最小高度,默认为140
@property(nonatomic,strong,nullable)UIColor* yMsgBackgroundColor;//弹窗的背景,默认为半透明黑色
@property(nonatomic,assign)BOOL yMsgShowAeroGlass;//显示Aero特效,默认为不显示
@property(nonatomic,strong,nullable)UIFont* yMsgInputFont;//输入框的字体,默认13号
@property(nonatomic,strong,nullable)UITextField* yMsgTextField;//输入框,把输入框的地址暴露出来是为了让外部监控这个输入框,注意,一旦它的delegate被替换之后,消息窗自身将无法再监听之
@property(nonatomic,strong,nullable)UIColor* yMsgButtonBorderColor;//按钮边线的颜色,默认无
@property(nonatomic,strong,nullable)UIColor* yMsgTextFieldBorderColor;//输入框边线的颜色,默认无
@property(nonatomic,strong,nullable)UIColor* yMsgTextFieldBottomLineColor;//输入框底线的颜色,默认为 154,162,193
@property(nonatomic,copy,nullable)NSAttributedString* yMsgTitle;//弹窗的标题
@property(nonatomic,copy,nullable)NSAttributedString* yMsgText;//弹窗的正文内容
@property(nonatomic,copy,nullable)NSString* yMsgInputText;//输入框的文本
@property(nonatomic,copy,nullable)NSString* yMsgInputPlaceholder;//输入框的提示语
@property(nonatomic,copy,nullable)NSArray<UIButton*>* yMsgButtons;
/**-1表示单击了背景,-2表示单击了键盘的return键,其它按钮索引从0开始*/
@property(nonatomic,assign,readonly)NSInteger yMsgButtonIndex;
-(void)showMsgBoxInViewController:(nullable UIViewController*)vc;//显示弹窗
-(void)showMsgBox;//显示弹窗
-(void)hideMsgBox;//销毁弹窗
-(void)hideKeyBoard;//隐藏键盘
-(void)addTarget:(nullable id)target withAction:(nullable SEL)action forEvent:(YMsgBoxMsgType)type;//添加事件回调
@end
@@ -0,0 +1,37 @@
//
// YSlider.h
// YSlider
//
// Created by apple on 16/7/20.
// Copyright © 2016年 yuanHongQiang. All rights reserved.
//
/**************************
说明:本Slider对 UIControlEventValueChanged
UIControlEventTouchDown
UIControlEventTouchUpInside
UIControlEventTouchUpOutside
这4种状态改变消息提供了友好支持,至于其它的状态,暂未支持,因为没必要
**************************/
#import <UIKit/UIKit.h>
#import "UIViewExt.h"
@interface YSlider : UIControl
@property(nonatomic)CGFloat value;//默认是0.0
@property(nonatomic)BOOL continues;//默认是YES 是否不断的发送值改变的事件
@property(nonatomic,assign)CGSize thumbSize;//滑块尺寸,默认为25,25
@property(nonatomic,assign)BOOL thumbBeRound;//滑块要不要变圆形,默认为YES
@property(nonatomic,assign)CGFloat trackHeight;//轨道高度,默认为3
@property(nonatomic,assign)BOOL hideThumb;//默认是NO 是否隐藏滑块,隐藏之后,就成了一个纯粹的进度条了
@property(nonatomic,assign)BOOL canChangeValueByTouch;//是否可以通过点击任意位置来改变滑块的值,默认是NO,不允许
- (void)setValue:(CGFloat)value animated:(BOOL)animated;
- (void)setThumbImage:(nullable UIImage *)image forState:(UIControlState)state;
- (void)setMinimumTrackImage:(nullable UIImage *)image forState:(UIControlState)state;
- (void)setMaximumTrackImage:(nullable UIImage *)image forState:(UIControlState)state;
- (void)setThumbColor:(nullable UIColor *)color forState:(UIControlState)state;
- (void)setMinimumTrackColor:(nullable UIColor *)color forState:(UIControlState)state;
- (void)setMaximumTrackColor:(nullable UIColor *)color forState:(UIControlState)state;
@end
@@ -0,0 +1,15 @@
//
// YTargetAndAction.h
// YTargetAndAction
//
// Created by apple on 16/9/20.
// Copyright © 2016年 YuanHongQiang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface YTargetAndAction : NSObject
-(void)addTarget:(nullable id)target withAction:(nullable SEL)action forEvent:(NSInteger)event withObject:(nullable id)object;
-(void)sendActionForEvent:(NSInteger)event;
-(void)deleteTarget:(nullable id)target withAction:(nullable SEL)action forEvent:(NSInteger)event;
-(void)deleteTarget:(nullable id)target;
-(void)deleteTarget:(nullable id)target forEvent:(NSInteger)event;
@end