Showing
100 changed files
with
1 additions
and
1835 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
No preview for this file type
No preview for this file type
liberate.framework/HHNetCheckVC.storyboardc/fEB-FG-Fhx-view-IMt-19-iaw.nib/objects-11.0+.nib
deleted
100644 → 0
No preview for this file type
1 | -// | ||
2 | -// MJRefreshAutoFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshAutoFooter : HHMJRefreshFooter | ||
14 | -/** 是否自动刷新(默认为YES) */ | ||
15 | -@property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; | ||
16 | - | ||
17 | -/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ | ||
18 | -@property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh HHMJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); | ||
19 | - | ||
20 | -/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ | ||
21 | -@property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; | ||
22 | - | ||
23 | -/** 自动触发次数, 默认为 1, 仅在拖拽 ScrollView 时才生效, | ||
24 | - | ||
25 | - 如果为 -1, 则为无限触发 | ||
26 | - */ | ||
27 | -@property (nonatomic) NSInteger autoTriggerTimes; | ||
28 | -@end | ||
29 | - | ||
30 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshAutoGifFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshAutoStateFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshAutoGifFooter : HHMJRefreshAutoStateFooter | ||
14 | -@property (weak, nonatomic, readonly) UIImageView *gifView; | ||
15 | - | ||
16 | -/** 设置state状态下的动画图片images 动画持续时间duration*/ | ||
17 | -- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(HHMJRefreshState)state; | ||
18 | -- (void)setImages:(NSArray *)images forState:(HHMJRefreshState)state; | ||
19 | -@end | ||
20 | - | ||
21 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshAutoNormalFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshAutoStateFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshAutoNormalFooter : HHMJRefreshAutoStateFooter | ||
14 | -@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView; | ||
15 | - | ||
16 | -/** 菊花的样式 */ | ||
17 | -@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle HHMJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property"); | ||
18 | -@end | ||
19 | - | ||
20 | - | ||
21 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshAutoStateFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/6/13. | ||
6 | -// Copyright © 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshAutoFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshAutoStateFooter : HHMJRefreshAutoFooter | ||
14 | -/** 文字距离圈圈、箭头的距离 */ | ||
15 | -@property (assign, nonatomic) CGFloat labelLeftInset; | ||
16 | -/** 显示刷新状态的label */ | ||
17 | -@property (weak, nonatomic, readonly) UILabel *stateLabel; | ||
18 | - | ||
19 | -/** 设置state状态下的文字 */ | ||
20 | -- (void)setTitle:(NSString *)title forState:(HHMJRefreshState)state; | ||
21 | - | ||
22 | -/** 隐藏刷新状态的文字 */ | ||
23 | -@property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; | ||
24 | -@end | ||
25 | - | ||
26 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshBackFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshBackFooter : HHMJRefreshFooter | ||
14 | - | ||
15 | -@end | ||
16 | - | ||
17 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshBackGifFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshBackStateFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshBackGifFooter : HHMJRefreshBackStateFooter | ||
14 | -@property (weak, nonatomic, readonly) UIImageView *gifView; | ||
15 | - | ||
16 | -/** 设置state状态下的动画图片images 动画持续时间duration*/ | ||
17 | -- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(HHMJRefreshState)state; | ||
18 | -- (void)setImages:(NSArray *)images forState:(HHMJRefreshState)state; | ||
19 | -@end | ||
20 | - | ||
21 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshBackNormalFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshBackStateFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshBackNormalFooter : HHMJRefreshBackStateFooter | ||
14 | -@property (weak, nonatomic, readonly) UIImageView *arrowView; | ||
15 | -@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView; | ||
16 | - | ||
17 | -/** 菊花的样式 */ | ||
18 | -@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle HHMJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property"); | ||
19 | -@end | ||
20 | - | ||
21 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshBackStateFooter.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/6/13. | ||
6 | -// Copyright © 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshBackFooter.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshBackStateFooter : HHMJRefreshBackFooter | ||
14 | -/** 文字距离圈圈、箭头的距离 */ | ||
15 | -@property (assign, nonatomic) CGFloat labelLeftInset; | ||
16 | -/** 显示刷新状态的label */ | ||
17 | -@property (weak, nonatomic, readonly) UILabel *stateLabel; | ||
18 | -/** 设置state状态下的文字 */ | ||
19 | -- (void)setTitle:(NSString *)title forState:(HHMJRefreshState)state; | ||
20 | - | ||
21 | -/** 获取state状态下的title */ | ||
22 | -- (NSString *)titleForState:(HHMJRefreshState)state; | ||
23 | -@end | ||
24 | - | ||
25 | -NS_ASSUME_NONNULL_END |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// MJRefreshComponent.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 15/3/4. | ||
7 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
8 | -// 刷新控件的基类 | ||
9 | - | ||
10 | -#import <UIKit/UIKit.h> | ||
11 | -#import "HHMJRefreshConst.h" | ||
12 | -#import "UIView+HHMJExtension.h" | ||
13 | -#import "UIScrollView+HHMJExtension.h" | ||
14 | -#import "UIScrollView+HHMJRefresh.h" | ||
15 | -#import "NSBundle+HHMJRefresh.h" | ||
16 | - | ||
17 | -NS_ASSUME_NONNULL_BEGIN | ||
18 | - | ||
19 | -/** 刷新控件的状态 */ | ||
20 | -typedef NS_ENUM(NSInteger, HHMJRefreshState) { | ||
21 | - /** 普通闲置状态 */ | ||
22 | - MJRefreshStateIdle = 1, | ||
23 | - /** 松开就可以进行刷新的状态 */ | ||
24 | - MJRefreshStatePulling, | ||
25 | - /** 正在刷新中的状态 */ | ||
26 | - MJRefreshStateRefreshing, | ||
27 | - /** 即将刷新的状态 */ | ||
28 | - MJRefreshStateWillRefresh, | ||
29 | - /** 所有数据加载完毕,没有更多的数据了 */ | ||
30 | - MJRefreshStateNoMoreData | ||
31 | -}; | ||
32 | - | ||
33 | -/** 进入刷新状态的回调 */ | ||
34 | -typedef void (^HHMJRefreshComponentRefreshingBlock)(void) HHMJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead"); | ||
35 | -/** 开始刷新后的回调(进入刷新状态后的回调) */ | ||
36 | -typedef void (^HHMJRefreshComponentBeginRefreshingCompletionBlock)(void) HHMJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead"); | ||
37 | -/** 结束刷新后的回调 */ | ||
38 | -typedef void (^HHMJRefreshComponentEndRefreshingCompletionBlock)(void) HHMJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead"); | ||
39 | - | ||
40 | -/** 刷新用到的回调类型 */ | ||
41 | -typedef void (^HHMJRefreshComponentAction)(void); | ||
42 | - | ||
43 | -/** 刷新控件的基类 */ | ||
44 | -@interface HHMJRefreshComponent : UIView | ||
45 | -{ | ||
46 | - /** 记录scrollView刚开始的inset */ | ||
47 | - UIEdgeInsets _scrollViewOriginalInset; | ||
48 | - /** 父控件 */ | ||
49 | - __weak UIScrollView *_scrollView; | ||
50 | -} | ||
51 | -#pragma mark - 刷新回调 | ||
52 | -/** 正在刷新的回调 */ | ||
53 | -@property (copy, nonatomic, nullable) HHMJRefreshComponentAction refreshingBlock; | ||
54 | -/** 设置回调对象和回调方法 */ | ||
55 | -- (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action; | ||
56 | - | ||
57 | -/** 回调对象 */ | ||
58 | -@property (weak, nonatomic) id refreshingTarget; | ||
59 | -/** 回调方法 */ | ||
60 | -@property (assign, nonatomic) SEL refreshingAction; | ||
61 | -/** 触发回调(交给子类去调用) */ | ||
62 | -- (void)executeRefreshingCallback; | ||
63 | - | ||
64 | -#pragma mark - 刷新状态控制 | ||
65 | -/** 进入刷新状态 */ | ||
66 | -- (void)beginRefreshing; | ||
67 | -- (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock; | ||
68 | -/** 开始刷新后的回调(进入刷新状态后的回调) */ | ||
69 | -@property (copy, nonatomic, nullable) HHMJRefreshComponentAction beginRefreshingCompletionBlock; | ||
70 | -/** 带动画的结束刷新的回调 */ | ||
71 | -@property (copy, nonatomic, nullable) HHMJRefreshComponentAction endRefreshingAnimateCompletionBlock HHMJRefreshDeprecated("first deprecated in 3.3.0 - Use `endRefreshingAnimationBeginAction` instead"); | ||
72 | -@property (copy, nonatomic, nullable) HHMJRefreshComponentAction endRefreshingAnimationBeginAction; | ||
73 | -/** 结束刷新的回调 */ | ||
74 | -@property (copy, nonatomic, nullable) HHMJRefreshComponentAction endRefreshingCompletionBlock; | ||
75 | -/** 结束刷新状态 */ | ||
76 | -- (void)endRefreshing; | ||
77 | -- (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock; | ||
78 | -/** 是否正在刷新 */ | ||
79 | -@property (assign, nonatomic, readonly, getter=isRefreshing) BOOL refreshing; | ||
80 | - | ||
81 | -/** 刷新状态 一般交给子类内部实现 */ | ||
82 | -@property (assign, nonatomic) HHMJRefreshState state; | ||
83 | - | ||
84 | -#pragma mark - 交给子类去访问 | ||
85 | -/** 记录scrollView刚开始的inset */ | ||
86 | -@property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset; | ||
87 | -/** 父控件 */ | ||
88 | -@property (weak, nonatomic, readonly) UIScrollView *scrollView; | ||
89 | - | ||
90 | -#pragma mark - 交给子类们去实现 | ||
91 | -/** 初始化 */ | ||
92 | -- (void)prepare NS_REQUIRES_SUPER; | ||
93 | -/** 摆放子控件frame */ | ||
94 | -- (void)placeSubviews NS_REQUIRES_SUPER; | ||
95 | -/** 当scrollView的contentOffset发生改变的时候调用 */ | ||
96 | -- (void)scrollViewContentOffsetDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER; | ||
97 | -/** 当scrollView的contentSize发生改变的时候调用 */ | ||
98 | -- (void)scrollViewContentSizeDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER; | ||
99 | -/** 当scrollView的拖拽状态发生改变的时候调用 */ | ||
100 | -- (void)scrollViewPanStateDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER; | ||
101 | - | ||
102 | - | ||
103 | -#pragma mark - 其他 | ||
104 | -/** 拉拽的百分比(交给子类重写) */ | ||
105 | -@property (assign, nonatomic) CGFloat pullingPercent; | ||
106 | -/** 根据拖拽比例自动切换透明度 */ | ||
107 | -@property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha HHMJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); | ||
108 | -/** 根据拖拽比例自动切换透明度 */ | ||
109 | -@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha; | ||
110 | -@end | ||
111 | - | ||
112 | -@interface UILabel(MJRefresh) | ||
113 | -+ (instancetype)mj_label; | ||
114 | -- (CGFloat)mj_textWidth; | ||
115 | -@end | ||
116 | - | ||
117 | - | ||
118 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshConfig.h | ||
3 | -// | ||
4 | -// Created by Frank on 2018/11/27. | ||
5 | -// Copyright © 2018 小码哥. All rights reserved. | ||
6 | -// | ||
7 | - | ||
8 | -#import <Foundation/Foundation.h> | ||
9 | - | ||
10 | -NS_ASSUME_NONNULL_BEGIN | ||
11 | - | ||
12 | -@interface HHMJRefreshConfig : NSObject | ||
13 | - | ||
14 | -/** 默认使用的语言版本, 默认为 nil. 将随系统的语言自动改变 */ | ||
15 | -@property (copy, nonatomic, nullable) NSString *languageCode; | ||
16 | - | ||
17 | -/** @return Singleton Config instance */ | ||
18 | -+ (instancetype)defaultConfig; | ||
19 | - | ||
20 | -- (instancetype)init NS_UNAVAILABLE; | ||
21 | -+ (instancetype)new NS_UNAVAILABLE; | ||
22 | - | ||
23 | -@end | ||
24 | - | ||
25 | -NS_ASSUME_NONNULL_END |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -#import <UIKit/UIKit.h> | ||
4 | -#import <objc/message.h> | ||
5 | - | ||
6 | -// 弱引用 | ||
7 | -#define MJWeakSelf __weak typeof(self) weakSelf = self; | ||
8 | - | ||
9 | -// 日志输出 | ||
10 | -#ifdef DEBUG | ||
11 | -#define HHMJRefreshLog(...) NSLog(__VA_ARGS__) | ||
12 | -#else | ||
13 | -#define HHMJRefreshLog(...) | ||
14 | -#endif | ||
15 | - | ||
16 | -// 过期提醒 | ||
17 | -#define HHMJRefreshDeprecated(DESCRIPTION) __attribute__((deprecated(DESCRIPTION))) | ||
18 | - | ||
19 | -// 运行时objc_msgSend | ||
20 | -#define HHMJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) | ||
21 | -#define HHMJRefreshMsgTarget(target) (__bridge void *)(target) | ||
22 | - | ||
23 | -// RGB颜色 | ||
24 | -#define HHMJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] | ||
25 | - | ||
26 | -// 文字颜色 | ||
27 | -#define HHMJRefreshLabelTextColor HHMJRefreshColor(90, 90, 90) | ||
28 | - | ||
29 | -// 字体大小 | ||
30 | -#define HHMJRefreshLabelFont [UIFont boldSystemFontOfSize:14] | ||
31 | - | ||
32 | -// 常量 | ||
33 | -UIKIT_EXTERN const CGFloat HHMJRefreshLabelLeftInset; | ||
34 | -UIKIT_EXTERN const CGFloat HHMJRefreshHeaderHeight; | ||
35 | -UIKIT_EXTERN const CGFloat HHMJRefreshFooterHeight; | ||
36 | -UIKIT_EXTERN const CGFloat HHMJRefreshFastAnimationDuration; | ||
37 | -UIKIT_EXTERN const CGFloat HHMJRefreshSlowAnimationDuration; | ||
38 | - | ||
39 | -UIKIT_EXTERN NSString *const HHMJRefreshKeyPathContentOffset; | ||
40 | -UIKIT_EXTERN NSString *const HHMJRefreshKeyPathContentSize; | ||
41 | -UIKIT_EXTERN NSString *const HHMJRefreshKeyPathContentInset; | ||
42 | -UIKIT_EXTERN NSString *const HHMJRefreshKeyPathPanState; | ||
43 | - | ||
44 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderLastUpdatedTimeKey; | ||
45 | - | ||
46 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderIdleText; | ||
47 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderPullingText; | ||
48 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderRefreshingText; | ||
49 | - | ||
50 | -UIKIT_EXTERN NSString *const HHMJRefreshAutoFooterIdleText; | ||
51 | -UIKIT_EXTERN NSString *const HHMJRefreshAutoFooterRefreshingText; | ||
52 | -UIKIT_EXTERN NSString *const HHMJRefreshAutoFooterNoMoreDataText; | ||
53 | - | ||
54 | -UIKIT_EXTERN NSString *const HHMJRefreshBackFooterIdleText; | ||
55 | -UIKIT_EXTERN NSString *const HHMJRefreshBackFooterPullingText; | ||
56 | -UIKIT_EXTERN NSString *const HHMJRefreshBackFooterRefreshingText; | ||
57 | -UIKIT_EXTERN NSString *const HHMJRefreshBackFooterNoMoreDataText; | ||
58 | - | ||
59 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderLastTimeText; | ||
60 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderDateTodayText; | ||
61 | -UIKIT_EXTERN NSString *const HHMJRefreshHeaderNoneLastDateText; | ||
62 | - | ||
63 | -// 状态检查 | ||
64 | -#define MJRefreshCheckState \ | ||
65 | -HHMJRefreshState oldState = self.state; \ | ||
66 | -if (state == oldState) return; \ | ||
67 | -[super setState:state]; | ||
68 | - | ||
69 | -// 异步主线程执行,不强持有Self | ||
70 | -#define MJRefreshDispatchAsyncOnMainQueue(x) \ | ||
71 | -__weak typeof(self) weakSelf = self; \ | ||
72 | -dispatch_async(dispatch_get_main_queue(), ^{ \ | ||
73 | -typeof(weakSelf) self = weakSelf; \ | ||
74 | -{x} \ | ||
75 | -}); |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// MJRefreshFooter.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 15/3/5. | ||
7 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
8 | -// 上拉刷新控件 | ||
9 | - | ||
10 | -#import "HHMJRefreshComponent.h" | ||
11 | - | ||
12 | -NS_ASSUME_NONNULL_BEGIN | ||
13 | - | ||
14 | -@interface HHMJRefreshFooter : HHMJRefreshComponent | ||
15 | -/** 创建footer */ | ||
16 | -+ (instancetype)footerWithRefreshingBlock:(HHMJRefreshComponentAction)refreshingBlock; | ||
17 | -/** 创建footer */ | ||
18 | -+ (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; | ||
19 | - | ||
20 | -/** 提示没有更多的数据 */ | ||
21 | -- (void)endRefreshingWithNoMoreData; | ||
22 | -- (void)noticeNoMoreData HHMJRefreshDeprecated("使用endRefreshingWithNoMoreData"); | ||
23 | - | ||
24 | -/** 重置没有更多的数据(消除没有更多数据的状态) */ | ||
25 | -- (void)resetNoMoreData; | ||
26 | - | ||
27 | -/** 忽略多少scrollView的contentInset的bottom */ | ||
28 | -@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; | ||
29 | - | ||
30 | -/** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ | ||
31 | -@property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden HHMJRefreshDeprecated("已废弃此属性,开发者请自行控制footer的显示和隐藏"); | ||
32 | -@end | ||
33 | - | ||
34 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshGifHeader.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshStateHeader.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshGifHeader : HHMJRefreshStateHeader | ||
14 | -@property (weak, nonatomic, readonly) UIImageView *gifView; | ||
15 | - | ||
16 | -/** 设置state状态下的动画图片images 动画持续时间duration*/ | ||
17 | -- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(HHMJRefreshState)state; | ||
18 | -- (void)setImages:(NSArray *)images forState:(HHMJRefreshState)state; | ||
19 | -@end | ||
20 | - | ||
21 | -NS_ASSUME_NONNULL_END |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// MJRefreshHeader.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 15/3/4. | ||
7 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
8 | -// 下拉刷新控件:负责监控用户下拉的状态 | ||
9 | - | ||
10 | -#import "HHMJRefreshComponent.h" | ||
11 | - | ||
12 | -NS_ASSUME_NONNULL_BEGIN | ||
13 | - | ||
14 | -@interface HHMJRefreshHeader : HHMJRefreshComponent | ||
15 | -/** 创建header */ | ||
16 | -+ (instancetype)headerWithRefreshingBlock:(HHMJRefreshComponentAction)refreshingBlock; | ||
17 | -/** 创建header */ | ||
18 | -+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; | ||
19 | - | ||
20 | -/** 这个key用来存储上一次下拉刷新成功的时间 */ | ||
21 | -@property (copy, nonatomic) NSString *lastUpdatedTimeKey; | ||
22 | -/** 上一次下拉刷新成功的时间 */ | ||
23 | -@property (strong, nonatomic, readonly, nullable) NSDate *lastUpdatedTime; | ||
24 | - | ||
25 | -/** 忽略多少scrollView的contentInset的top */ | ||
26 | -@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; | ||
27 | -@end | ||
28 | - | ||
29 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshNormalHeader.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshStateHeader.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshNormalHeader : HHMJRefreshStateHeader | ||
14 | -@property (weak, nonatomic, readonly) UIImageView *arrowView; | ||
15 | -@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView; | ||
16 | - | ||
17 | - | ||
18 | -/** 菊花的样式 */ | ||
19 | -@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle HHMJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property"); | ||
20 | -@end | ||
21 | - | ||
22 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MJRefreshStateHeader.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 15/4/24. | ||
6 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "HHMJRefreshHeader.h" | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface HHMJRefreshStateHeader : HHMJRefreshHeader | ||
14 | -#pragma mark - 刷新时间相关 | ||
15 | -/** 利用这个block来决定显示的更新时间文字 */ | ||
16 | -@property (copy, nonatomic, nullable) NSString *(^lastUpdatedTimeText)(NSDate * _Nullable lastUpdatedTime); | ||
17 | -/** 显示上一次刷新时间的label */ | ||
18 | -@property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; | ||
19 | - | ||
20 | -#pragma mark - 状态相关 | ||
21 | -/** 文字距离圈圈、箭头的距离 */ | ||
22 | -@property (assign, nonatomic) CGFloat labelLeftInset; | ||
23 | -/** 显示刷新状态的label */ | ||
24 | -@property (weak, nonatomic, readonly) UILabel *stateLabel; | ||
25 | -/** 设置state状态下的文字 */ | ||
26 | -- (void)setTitle:(NSString *)title forState:(HHMJRefreshState)state; | ||
27 | -@end | ||
28 | - | ||
29 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// MASCompositeConstraint.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 21/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASConstraint.h" | ||
10 | -#import "MASUtilities.h" | ||
11 | - | ||
12 | -/** | ||
13 | - * A group of MASConstraint objects | ||
14 | - */ | ||
15 | -@interface MASCompositeConstraint : MASConstraint | ||
16 | - | ||
17 | -/** | ||
18 | - * Creates a composite with a predefined array of children | ||
19 | - * | ||
20 | - * @param children child MASConstraints | ||
21 | - * | ||
22 | - * @return a composite constraint | ||
23 | - */ | ||
24 | -- (id)initWithChildren:(NSArray *)children; | ||
25 | - | ||
26 | -@end |
1 | -// | ||
2 | -// MASConstraint+Private.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Nick Tymchenko on 29/04/14. | ||
6 | -// Copyright (c) 2014 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASConstraint.h" | ||
10 | - | ||
11 | -@protocol MASConstraintDelegate; | ||
12 | - | ||
13 | - | ||
14 | -@interface MASConstraint () | ||
15 | - | ||
16 | -/** | ||
17 | - * Whether or not to check for an existing constraint instead of adding constraint | ||
18 | - */ | ||
19 | -@property (nonatomic, assign) BOOL updateExisting; | ||
20 | - | ||
21 | -/** | ||
22 | - * Usually MASConstraintMaker but could be a parent MASConstraint | ||
23 | - */ | ||
24 | -@property (nonatomic, weak) id<MASConstraintDelegate> delegate; | ||
25 | - | ||
26 | -/** | ||
27 | - * Based on a provided value type, is equal to calling: | ||
28 | - * NSNumber - setOffset: | ||
29 | - * NSValue with CGPoint - setPointOffset: | ||
30 | - * NSValue with CGSize - setSizeOffset: | ||
31 | - * NSValue with MASEdgeInsets - setInsets: | ||
32 | - */ | ||
33 | -- (void)setLayoutConstantWithValue:(NSValue *)value; | ||
34 | - | ||
35 | -@end | ||
36 | - | ||
37 | - | ||
38 | -@interface MASConstraint (Abstract) | ||
39 | - | ||
40 | -/** | ||
41 | - * Sets the constraint relation to given NSLayoutRelation | ||
42 | - * returns a block which accepts one of the following: | ||
43 | - * MASViewAttribute, UIView, NSValue, NSArray | ||
44 | - * see readme for more details. | ||
45 | - */ | ||
46 | -- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; | ||
47 | - | ||
48 | -/** | ||
49 | - * Override to set a custom chaining behaviour | ||
50 | - */ | ||
51 | -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; | ||
52 | - | ||
53 | -@end | ||
54 | - | ||
55 | - | ||
56 | -@protocol MASConstraintDelegate <NSObject> | ||
57 | - | ||
58 | -/** | ||
59 | - * Notifies the delegate when the constraint needs to be replaced with another constraint. For example | ||
60 | - * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks | ||
61 | - */ | ||
62 | -- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; | ||
63 | - | ||
64 | -- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; | ||
65 | - | ||
66 | -@end |
1 | -// | ||
2 | -// MASConstraint.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 22/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | - | ||
11 | -/** | ||
12 | - * Enables Constraints to be created with chainable syntax | ||
13 | - * Constraint can represent single NSLayoutConstraint (MASViewConstraint) | ||
14 | - * or a group of NSLayoutConstraints (MASComposisteConstraint) | ||
15 | - */ | ||
16 | -@interface MASConstraint : NSObject | ||
17 | - | ||
18 | -// Chaining Support | ||
19 | - | ||
20 | -/** | ||
21 | - * Modifies the NSLayoutConstraint constant, | ||
22 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
23 | - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight | ||
24 | - */ | ||
25 | -- (MASConstraint * (^)(MASEdgeInsets insets))insets; | ||
26 | - | ||
27 | -/** | ||
28 | - * Modifies the NSLayoutConstraint constant, | ||
29 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
30 | - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight | ||
31 | - */ | ||
32 | -- (MASConstraint * (^)(CGFloat inset))inset; | ||
33 | - | ||
34 | -/** | ||
35 | - * Modifies the NSLayoutConstraint constant, | ||
36 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
37 | - * NSLayoutAttributeWidth, NSLayoutAttributeHeight | ||
38 | - */ | ||
39 | -- (MASConstraint * (^)(CGSize offset))sizeOffset; | ||
40 | - | ||
41 | -/** | ||
42 | - * Modifies the NSLayoutConstraint constant, | ||
43 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
44 | - * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY | ||
45 | - */ | ||
46 | -- (MASConstraint * (^)(CGPoint offset))centerOffset; | ||
47 | - | ||
48 | -/** | ||
49 | - * Modifies the NSLayoutConstraint constant | ||
50 | - */ | ||
51 | -- (MASConstraint * (^)(CGFloat offset))offset; | ||
52 | - | ||
53 | -/** | ||
54 | - * Modifies the NSLayoutConstraint constant based on a value type | ||
55 | - */ | ||
56 | -- (MASConstraint * (^)(NSValue *value))valueOffset; | ||
57 | - | ||
58 | -/** | ||
59 | - * Sets the NSLayoutConstraint multiplier property | ||
60 | - */ | ||
61 | -- (MASConstraint * (^)(CGFloat multiplier))multipliedBy; | ||
62 | - | ||
63 | -/** | ||
64 | - * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy | ||
65 | - */ | ||
66 | -- (MASConstraint * (^)(CGFloat divider))dividedBy; | ||
67 | - | ||
68 | -/** | ||
69 | - * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority | ||
70 | - */ | ||
71 | -- (MASConstraint * (^)(MASLayoutPriority priority))priority; | ||
72 | - | ||
73 | -/** | ||
74 | - * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow | ||
75 | - */ | ||
76 | -- (MASConstraint * (^)(void))priorityLow; | ||
77 | - | ||
78 | -/** | ||
79 | - * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium | ||
80 | - */ | ||
81 | -- (MASConstraint * (^)(void))priorityMedium; | ||
82 | - | ||
83 | -/** | ||
84 | - * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh | ||
85 | - */ | ||
86 | -- (MASConstraint * (^)(void))priorityHigh; | ||
87 | - | ||
88 | -/** | ||
89 | - * Sets the constraint relation to NSLayoutRelationEqual | ||
90 | - * returns a block which accepts one of the following: | ||
91 | - * MASViewAttribute, UIView, NSValue, NSArray | ||
92 | - * see readme for more details. | ||
93 | - */ | ||
94 | -- (MASConstraint * (^)(id attr))equalTo; | ||
95 | - | ||
96 | -/** | ||
97 | - * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual | ||
98 | - * returns a block which accepts one of the following: | ||
99 | - * MASViewAttribute, UIView, NSValue, NSArray | ||
100 | - * see readme for more details. | ||
101 | - */ | ||
102 | -- (MASConstraint * (^)(id attr))greaterThanOrEqualTo; | ||
103 | - | ||
104 | -/** | ||
105 | - * Sets the constraint relation to NSLayoutRelationLessThanOrEqual | ||
106 | - * returns a block which accepts one of the following: | ||
107 | - * MASViewAttribute, UIView, NSValue, NSArray | ||
108 | - * see readme for more details. | ||
109 | - */ | ||
110 | -- (MASConstraint * (^)(id attr))lessThanOrEqualTo; | ||
111 | - | ||
112 | -/** | ||
113 | - * Optional semantic property which has no effect but improves the readability of constraint | ||
114 | - */ | ||
115 | -- (MASConstraint *)with; | ||
116 | - | ||
117 | -/** | ||
118 | - * Optional semantic property which has no effect but improves the readability of constraint | ||
119 | - */ | ||
120 | -- (MASConstraint *)and; | ||
121 | - | ||
122 | -/** | ||
123 | - * Creates a new MASCompositeConstraint with the called attribute and reciever | ||
124 | - */ | ||
125 | -- (MASConstraint *)left; | ||
126 | -- (MASConstraint *)top; | ||
127 | -- (MASConstraint *)right; | ||
128 | -- (MASConstraint *)bottom; | ||
129 | -- (MASConstraint *)leading; | ||
130 | -- (MASConstraint *)trailing; | ||
131 | -- (MASConstraint *)width; | ||
132 | -- (MASConstraint *)height; | ||
133 | -- (MASConstraint *)centerX; | ||
134 | -- (MASConstraint *)centerY; | ||
135 | -- (MASConstraint *)baseline; | ||
136 | - | ||
137 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
138 | - | ||
139 | -- (MASConstraint *)firstBaseline; | ||
140 | -- (MASConstraint *)lastBaseline; | ||
141 | - | ||
142 | -#endif | ||
143 | - | ||
144 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
145 | - | ||
146 | -- (MASConstraint *)leftMargin; | ||
147 | -- (MASConstraint *)rightMargin; | ||
148 | -- (MASConstraint *)topMargin; | ||
149 | -- (MASConstraint *)bottomMargin; | ||
150 | -- (MASConstraint *)leadingMargin; | ||
151 | -- (MASConstraint *)trailingMargin; | ||
152 | -- (MASConstraint *)centerXWithinMargins; | ||
153 | -- (MASConstraint *)centerYWithinMargins; | ||
154 | - | ||
155 | -#endif | ||
156 | - | ||
157 | - | ||
158 | -/** | ||
159 | - * Sets the constraint debug name | ||
160 | - */ | ||
161 | -- (MASConstraint * (^)(id key))key; | ||
162 | - | ||
163 | -// NSLayoutConstraint constant Setters | ||
164 | -// for use outside of mas_updateConstraints/mas_makeConstraints blocks | ||
165 | - | ||
166 | -/** | ||
167 | - * Modifies the NSLayoutConstraint constant, | ||
168 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
169 | - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight | ||
170 | - */ | ||
171 | -- (void)setInsets:(MASEdgeInsets)insets; | ||
172 | - | ||
173 | -/** | ||
174 | - * Modifies the NSLayoutConstraint constant, | ||
175 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
176 | - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight | ||
177 | - */ | ||
178 | -- (void)setInset:(CGFloat)inset; | ||
179 | - | ||
180 | -/** | ||
181 | - * Modifies the NSLayoutConstraint constant, | ||
182 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
183 | - * NSLayoutAttributeWidth, NSLayoutAttributeHeight | ||
184 | - */ | ||
185 | -- (void)setSizeOffset:(CGSize)sizeOffset; | ||
186 | - | ||
187 | -/** | ||
188 | - * Modifies the NSLayoutConstraint constant, | ||
189 | - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following | ||
190 | - * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY | ||
191 | - */ | ||
192 | -- (void)setCenterOffset:(CGPoint)centerOffset; | ||
193 | - | ||
194 | -/** | ||
195 | - * Modifies the NSLayoutConstraint constant | ||
196 | - */ | ||
197 | -- (void)setOffset:(CGFloat)offset; | ||
198 | - | ||
199 | - | ||
200 | -// NSLayoutConstraint Installation support | ||
201 | - | ||
202 | -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) | ||
203 | -/** | ||
204 | - * Whether or not to go through the animator proxy when modifying the constraint | ||
205 | - */ | ||
206 | -@property (nonatomic, copy, readonly) MASConstraint *animator; | ||
207 | -#endif | ||
208 | - | ||
209 | -/** | ||
210 | - * Activates an NSLayoutConstraint if it's supported by an OS. | ||
211 | - * Invokes install otherwise. | ||
212 | - */ | ||
213 | -- (void)activate; | ||
214 | - | ||
215 | -/** | ||
216 | - * Deactivates previously installed/activated NSLayoutConstraint. | ||
217 | - */ | ||
218 | -- (void)deactivate; | ||
219 | - | ||
220 | -/** | ||
221 | - * Creates a NSLayoutConstraint and adds it to the appropriate view. | ||
222 | - */ | ||
223 | -- (void)install; | ||
224 | - | ||
225 | -/** | ||
226 | - * Removes previously installed NSLayoutConstraint | ||
227 | - */ | ||
228 | -- (void)uninstall; | ||
229 | - | ||
230 | -@end | ||
231 | - | ||
232 | - | ||
233 | -/** | ||
234 | - * Convenience auto-boxing macros for MASConstraint methods. | ||
235 | - * | ||
236 | - * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax. | ||
237 | - * A potential drawback of this is that the unprefixed macros will appear in global scope. | ||
238 | - */ | ||
239 | -#define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__))) | ||
240 | -#define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__))) | ||
241 | -#define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__))) | ||
242 | - | ||
243 | -#define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__))) | ||
244 | - | ||
245 | - | ||
246 | -#ifdef MAS_SHORTHAND_GLOBALS | ||
247 | - | ||
248 | -#define equalTo(...) mas_equalTo(__VA_ARGS__) | ||
249 | -#define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__) | ||
250 | -#define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__) | ||
251 | - | ||
252 | -#define offset(...) mas_offset(__VA_ARGS__) | ||
253 | - | ||
254 | -#endif | ||
255 | - | ||
256 | - | ||
257 | -@interface MASConstraint (AutoboxingSupport) | ||
258 | - | ||
259 | -/** | ||
260 | - * Aliases to corresponding relation methods (for shorthand macros) | ||
261 | - * Also needed to aid autocompletion | ||
262 | - */ | ||
263 | -- (MASConstraint * (^)(id attr))mas_equalTo; | ||
264 | -- (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo; | ||
265 | -- (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo; | ||
266 | - | ||
267 | -/** | ||
268 | - * A dummy method to aid autocompletion | ||
269 | - */ | ||
270 | -- (MASConstraint * (^)(id offset))mas_offset; | ||
271 | - | ||
272 | -@end |
1 | -// | ||
2 | -// MASConstraintMaker.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 20/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASConstraint.h" | ||
10 | -#import "MASUtilities.h" | ||
11 | - | ||
12 | -typedef NS_OPTIONS(NSInteger, MASAttribute) { | ||
13 | - MASAttributeLeft = 1 << NSLayoutAttributeLeft, | ||
14 | - MASAttributeRight = 1 << NSLayoutAttributeRight, | ||
15 | - MASAttributeTop = 1 << NSLayoutAttributeTop, | ||
16 | - MASAttributeBottom = 1 << NSLayoutAttributeBottom, | ||
17 | - MASAttributeLeading = 1 << NSLayoutAttributeLeading, | ||
18 | - MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, | ||
19 | - MASAttributeWidth = 1 << NSLayoutAttributeWidth, | ||
20 | - MASAttributeHeight = 1 << NSLayoutAttributeHeight, | ||
21 | - MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, | ||
22 | - MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, | ||
23 | - MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, | ||
24 | - | ||
25 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
26 | - | ||
27 | - MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, | ||
28 | - MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, | ||
29 | - | ||
30 | -#endif | ||
31 | - | ||
32 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
33 | - | ||
34 | - MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, | ||
35 | - MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, | ||
36 | - MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, | ||
37 | - MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, | ||
38 | - MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, | ||
39 | - MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, | ||
40 | - MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, | ||
41 | - MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, | ||
42 | - | ||
43 | -#endif | ||
44 | - | ||
45 | -}; | ||
46 | - | ||
47 | -/** | ||
48 | - * Provides factory methods for creating MASConstraints. | ||
49 | - * Constraints are collected until they are ready to be installed | ||
50 | - * | ||
51 | - */ | ||
52 | -@interface MASConstraintMaker : NSObject | ||
53 | - | ||
54 | -/** | ||
55 | - * The following properties return a new MASViewConstraint | ||
56 | - * with the first item set to the makers associated view and the appropriate MASViewAttribute | ||
57 | - */ | ||
58 | -@property (nonatomic, strong, readonly) MASConstraint *left; | ||
59 | -@property (nonatomic, strong, readonly) MASConstraint *top; | ||
60 | -@property (nonatomic, strong, readonly) MASConstraint *right; | ||
61 | -@property (nonatomic, strong, readonly) MASConstraint *bottom; | ||
62 | -@property (nonatomic, strong, readonly) MASConstraint *leading; | ||
63 | -@property (nonatomic, strong, readonly) MASConstraint *trailing; | ||
64 | -@property (nonatomic, strong, readonly) MASConstraint *width; | ||
65 | -@property (nonatomic, strong, readonly) MASConstraint *height; | ||
66 | -@property (nonatomic, strong, readonly) MASConstraint *centerX; | ||
67 | -@property (nonatomic, strong, readonly) MASConstraint *centerY; | ||
68 | -@property (nonatomic, strong, readonly) MASConstraint *baseline; | ||
69 | - | ||
70 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
71 | - | ||
72 | -@property (nonatomic, strong, readonly) MASConstraint *firstBaseline; | ||
73 | -@property (nonatomic, strong, readonly) MASConstraint *lastBaseline; | ||
74 | - | ||
75 | -#endif | ||
76 | - | ||
77 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
78 | - | ||
79 | -@property (nonatomic, strong, readonly) MASConstraint *leftMargin; | ||
80 | -@property (nonatomic, strong, readonly) MASConstraint *rightMargin; | ||
81 | -@property (nonatomic, strong, readonly) MASConstraint *topMargin; | ||
82 | -@property (nonatomic, strong, readonly) MASConstraint *bottomMargin; | ||
83 | -@property (nonatomic, strong, readonly) MASConstraint *leadingMargin; | ||
84 | -@property (nonatomic, strong, readonly) MASConstraint *trailingMargin; | ||
85 | -@property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; | ||
86 | -@property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; | ||
87 | - | ||
88 | -#endif | ||
89 | - | ||
90 | -/** | ||
91 | - * Returns a block which creates a new MASCompositeConstraint with the first item set | ||
92 | - * to the makers associated view and children corresponding to the set bits in the | ||
93 | - * MASAttribute parameter. Combine multiple attributes via binary-or. | ||
94 | - */ | ||
95 | -@property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); | ||
96 | - | ||
97 | -/** | ||
98 | - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges | ||
99 | - * which generates the appropriate MASViewConstraint children (top, left, bottom, right) | ||
100 | - * with the first item set to the makers associated view | ||
101 | - */ | ||
102 | -@property (nonatomic, strong, readonly) MASConstraint *edges; | ||
103 | - | ||
104 | -/** | ||
105 | - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize | ||
106 | - * which generates the appropriate MASViewConstraint children (width, height) | ||
107 | - * with the first item set to the makers associated view | ||
108 | - */ | ||
109 | -@property (nonatomic, strong, readonly) MASConstraint *size; | ||
110 | - | ||
111 | -/** | ||
112 | - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter | ||
113 | - * which generates the appropriate MASViewConstraint children (centerX, centerY) | ||
114 | - * with the first item set to the makers associated view | ||
115 | - */ | ||
116 | -@property (nonatomic, strong, readonly) MASConstraint *center; | ||
117 | - | ||
118 | -/** | ||
119 | - * Whether or not to check for an existing constraint instead of adding constraint | ||
120 | - */ | ||
121 | -@property (nonatomic, assign) BOOL updateExisting; | ||
122 | - | ||
123 | -/** | ||
124 | - * Whether or not to remove existing constraints prior to installing | ||
125 | - */ | ||
126 | -@property (nonatomic, assign) BOOL removeExisting; | ||
127 | - | ||
128 | -/** | ||
129 | - * initialises the maker with a default view | ||
130 | - * | ||
131 | - * @param view any MASConstraint are created with this view as the first item | ||
132 | - * | ||
133 | - * @return a new MASConstraintMaker | ||
134 | - */ | ||
135 | -- (id)initWithView:(MAS_VIEW *)view; | ||
136 | - | ||
137 | -/** | ||
138 | - * Calls install method on any MASConstraints which have been created by this maker | ||
139 | - * | ||
140 | - * @return an array of all the installed MASConstraints | ||
141 | - */ | ||
142 | -- (NSArray *)install; | ||
143 | - | ||
144 | -- (MASConstraint * (^)(dispatch_block_t))group; | ||
145 | - | ||
146 | -@end |
1 | -// | ||
2 | -// MASLayoutConstraint.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 3/08/13. | ||
6 | -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | - | ||
11 | -/** | ||
12 | - * When you are debugging or printing the constraints attached to a view this subclass | ||
13 | - * makes it easier to identify which constraints have been created via Masonry | ||
14 | - */ | ||
15 | -@interface MASLayoutConstraint : NSLayoutConstraint | ||
16 | - | ||
17 | -/** | ||
18 | - * a key to associate with this constraint | ||
19 | - */ | ||
20 | -@property (nonatomic, strong) id mas_key; | ||
21 | - | ||
22 | -@end |
1 | -// | ||
2 | -// MASUtilities.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 19/08/13. | ||
6 | -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <Foundation/Foundation.h> | ||
10 | - | ||
11 | - | ||
12 | - | ||
13 | -#if TARGET_OS_IPHONE || TARGET_OS_TV | ||
14 | - | ||
15 | - #import <UIKit/UIKit.h> | ||
16 | - #define MAS_VIEW UIView | ||
17 | - #define MAS_VIEW_CONTROLLER UIViewController | ||
18 | - #define MASEdgeInsets UIEdgeInsets | ||
19 | - | ||
20 | - typedef UILayoutPriority MASLayoutPriority; | ||
21 | - static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; | ||
22 | - static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; | ||
23 | - static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; | ||
24 | - static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; | ||
25 | - static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; | ||
26 | - | ||
27 | -#elif TARGET_OS_MAC | ||
28 | - | ||
29 | - #import <AppKit/AppKit.h> | ||
30 | - #define MAS_VIEW NSView | ||
31 | - #define MASEdgeInsets NSEdgeInsets | ||
32 | - | ||
33 | - typedef NSLayoutPriority MASLayoutPriority; | ||
34 | - static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; | ||
35 | - static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; | ||
36 | - static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; | ||
37 | - static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; | ||
38 | - static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; | ||
39 | - static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; | ||
40 | - static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; | ||
41 | - static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; | ||
42 | - | ||
43 | -#endif | ||
44 | - | ||
45 | -/** | ||
46 | - * Allows you to attach keys to objects matching the variable names passed. | ||
47 | - * | ||
48 | - * view1.mas_key = @"view1", view2.mas_key = @"view2"; | ||
49 | - * | ||
50 | - * is equivalent to: | ||
51 | - * | ||
52 | - * MASAttachKeys(view1, view2); | ||
53 | - */ | ||
54 | -#define MASAttachKeys(...) \ | ||
55 | - { \ | ||
56 | - NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ | ||
57 | - for (id key in keyPairs.allKeys) { \ | ||
58 | - id obj = keyPairs[key]; \ | ||
59 | - NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ | ||
60 | - @"Cannot attach mas_key to %@", obj); \ | ||
61 | - [obj setMas_key:key]; \ | ||
62 | - } \ | ||
63 | - } | ||
64 | - | ||
65 | -/** | ||
66 | - * Used to create object hashes | ||
67 | - * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html | ||
68 | - */ | ||
69 | -#define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) | ||
70 | -#define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) | ||
71 | - | ||
72 | -/** | ||
73 | - * Given a scalar or struct value, wraps it in NSValue | ||
74 | - * Based on EXPObjectify: https://github.com/specta/expecta | ||
75 | - */ | ||
76 | -static inline id _MASBoxValue(const char *type, ...) { | ||
77 | - va_list v; | ||
78 | - va_start(v, type); | ||
79 | - id obj = nil; | ||
80 | - if (strcmp(type, @encode(id)) == 0) { | ||
81 | - id actual = va_arg(v, id); | ||
82 | - obj = actual; | ||
83 | - } else if (strcmp(type, @encode(CGPoint)) == 0) { | ||
84 | - CGPoint actual = (CGPoint)va_arg(v, CGPoint); | ||
85 | - obj = [NSValue value:&actual withObjCType:type]; | ||
86 | - } else if (strcmp(type, @encode(CGSize)) == 0) { | ||
87 | - CGSize actual = (CGSize)va_arg(v, CGSize); | ||
88 | - obj = [NSValue value:&actual withObjCType:type]; | ||
89 | - } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { | ||
90 | - MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); | ||
91 | - obj = [NSValue value:&actual withObjCType:type]; | ||
92 | - } else if (strcmp(type, @encode(double)) == 0) { | ||
93 | - double actual = (double)va_arg(v, double); | ||
94 | - obj = [NSNumber numberWithDouble:actual]; | ||
95 | - } else if (strcmp(type, @encode(float)) == 0) { | ||
96 | - float actual = (float)va_arg(v, double); | ||
97 | - obj = [NSNumber numberWithFloat:actual]; | ||
98 | - } else if (strcmp(type, @encode(int)) == 0) { | ||
99 | - int actual = (int)va_arg(v, int); | ||
100 | - obj = [NSNumber numberWithInt:actual]; | ||
101 | - } else if (strcmp(type, @encode(long)) == 0) { | ||
102 | - long actual = (long)va_arg(v, long); | ||
103 | - obj = [NSNumber numberWithLong:actual]; | ||
104 | - } else if (strcmp(type, @encode(long long)) == 0) { | ||
105 | - long long actual = (long long)va_arg(v, long long); | ||
106 | - obj = [NSNumber numberWithLongLong:actual]; | ||
107 | - } else if (strcmp(type, @encode(short)) == 0) { | ||
108 | - short actual = (short)va_arg(v, int); | ||
109 | - obj = [NSNumber numberWithShort:actual]; | ||
110 | - } else if (strcmp(type, @encode(char)) == 0) { | ||
111 | - char actual = (char)va_arg(v, int); | ||
112 | - obj = [NSNumber numberWithChar:actual]; | ||
113 | - } else if (strcmp(type, @encode(bool)) == 0) { | ||
114 | - bool actual = (bool)va_arg(v, int); | ||
115 | - obj = [NSNumber numberWithBool:actual]; | ||
116 | - } else if (strcmp(type, @encode(unsigned char)) == 0) { | ||
117 | - unsigned char actual = (unsigned char)va_arg(v, unsigned int); | ||
118 | - obj = [NSNumber numberWithUnsignedChar:actual]; | ||
119 | - } else if (strcmp(type, @encode(unsigned int)) == 0) { | ||
120 | - unsigned int actual = (unsigned int)va_arg(v, unsigned int); | ||
121 | - obj = [NSNumber numberWithUnsignedInt:actual]; | ||
122 | - } else if (strcmp(type, @encode(unsigned long)) == 0) { | ||
123 | - unsigned long actual = (unsigned long)va_arg(v, unsigned long); | ||
124 | - obj = [NSNumber numberWithUnsignedLong:actual]; | ||
125 | - } else if (strcmp(type, @encode(unsigned long long)) == 0) { | ||
126 | - unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); | ||
127 | - obj = [NSNumber numberWithUnsignedLongLong:actual]; | ||
128 | - } else if (strcmp(type, @encode(unsigned short)) == 0) { | ||
129 | - unsigned short actual = (unsigned short)va_arg(v, unsigned int); | ||
130 | - obj = [NSNumber numberWithUnsignedShort:actual]; | ||
131 | - } | ||
132 | - va_end(v); | ||
133 | - return obj; | ||
134 | -} | ||
135 | - | ||
136 | -#define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) |
1 | -// | ||
2 | -// MASViewAttribute.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 21/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | - | ||
11 | -/** | ||
12 | - * An immutable tuple which stores the view and the related NSLayoutAttribute. | ||
13 | - * Describes part of either the left or right hand side of a constraint equation | ||
14 | - */ | ||
15 | -@interface MASViewAttribute : NSObject | ||
16 | - | ||
17 | -/** | ||
18 | - * The view which the reciever relates to. Can be nil if item is not a view. | ||
19 | - */ | ||
20 | -@property (nonatomic, weak, readonly) MAS_VIEW *view; | ||
21 | - | ||
22 | -/** | ||
23 | - * The item which the reciever relates to. | ||
24 | - */ | ||
25 | -@property (nonatomic, weak, readonly) id item; | ||
26 | - | ||
27 | -/** | ||
28 | - * The attribute which the reciever relates to | ||
29 | - */ | ||
30 | -@property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; | ||
31 | - | ||
32 | -/** | ||
33 | - * Convenience initializer. | ||
34 | - */ | ||
35 | -- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; | ||
36 | - | ||
37 | -/** | ||
38 | - * The designated initializer. | ||
39 | - */ | ||
40 | -- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; | ||
41 | - | ||
42 | -/** | ||
43 | - * Determine whether the layoutAttribute is a size attribute | ||
44 | - * | ||
45 | - * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight | ||
46 | - */ | ||
47 | -- (BOOL)isSizeAttribute; | ||
48 | - | ||
49 | -@end |
1 | -// | ||
2 | -// MASViewConstraint.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 20/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASViewAttribute.h" | ||
10 | -#import "MASConstraint.h" | ||
11 | -#import "MASLayoutConstraint.h" | ||
12 | -#import "MASUtilities.h" | ||
13 | - | ||
14 | -/** | ||
15 | - * A single constraint. | ||
16 | - * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view | ||
17 | - */ | ||
18 | -@interface MASViewConstraint : MASConstraint <NSCopying> | ||
19 | - | ||
20 | -/** | ||
21 | - * First item/view and first attribute of the NSLayoutConstraint | ||
22 | - */ | ||
23 | -@property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; | ||
24 | - | ||
25 | -/** | ||
26 | - * Second item/view and second attribute of the NSLayoutConstraint | ||
27 | - */ | ||
28 | -@property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; | ||
29 | - | ||
30 | -/** | ||
31 | - * initialises the MASViewConstraint with the first part of the equation | ||
32 | - * | ||
33 | - * @param firstViewAttribute view.mas_left, view.mas_width etc. | ||
34 | - * | ||
35 | - * @return a new view constraint | ||
36 | - */ | ||
37 | -- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; | ||
38 | - | ||
39 | -/** | ||
40 | - * Returns all MASViewConstraints installed with this view as a first item. | ||
41 | - * | ||
42 | - * @param view A view to retrieve constraints for. | ||
43 | - * | ||
44 | - * @return An array of MASViewConstraints. | ||
45 | - */ | ||
46 | -+ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; | ||
47 | - | ||
48 | -@end |
liberate.framework/Headers/Masonry.h
deleted
100644 → 0
1 | -// | ||
2 | -// Masonry.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 20/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <Foundation/Foundation.h> | ||
10 | - | ||
11 | -//! Project version number for Masonry. | ||
12 | -FOUNDATION_EXPORT double MasonryVersionNumber; | ||
13 | - | ||
14 | -//! Project version string for Masonry. | ||
15 | -FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; | ||
16 | - | ||
17 | -#import "MASUtilities.h" | ||
18 | -#import "View+MASAdditions.h" | ||
19 | -#import "View+MASShorthandAdditions.h" | ||
20 | -#import "ViewController+MASAdditions.h" | ||
21 | -#import "NSArray+MASAdditions.h" | ||
22 | -#import "NSArray+MASShorthandAdditions.h" | ||
23 | -#import "MASConstraint.h" | ||
24 | -#import "MASCompositeConstraint.h" | ||
25 | -#import "MASViewAttribute.h" | ||
26 | -#import "MASViewConstraint.h" | ||
27 | -#import "MASConstraintMaker.h" | ||
28 | -#import "MASLayoutConstraint.h" | ||
29 | -#import "NSLayoutConstraint+MASDebugAdditions.h" |
1 | -// | ||
2 | -// NSArray+MASAdditions.h | ||
3 | -// | ||
4 | -// | ||
5 | -// Created by Daniel Hammond on 11/26/13. | ||
6 | -// | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | -#import "MASConstraintMaker.h" | ||
11 | -#import "MASViewAttribute.h" | ||
12 | - | ||
13 | -typedef NS_ENUM(NSUInteger, MASAxisType) { | ||
14 | - MASAxisTypeHorizontal, | ||
15 | - MASAxisTypeVertical | ||
16 | -}; | ||
17 | - | ||
18 | -@interface NSArray (MASAdditions) | ||
19 | - | ||
20 | -/** | ||
21 | - * Creates a MASConstraintMaker with each view in the callee. | ||
22 | - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view | ||
23 | - * | ||
24 | - * @param block scope within which you can build up the constraints which you wish to apply to each view. | ||
25 | - * | ||
26 | - * @return Array of created MASConstraints | ||
27 | - */ | ||
28 | -- (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
29 | - | ||
30 | -/** | ||
31 | - * Creates a MASConstraintMaker with each view in the callee. | ||
32 | - * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. | ||
33 | - * If an existing constraint exists then it will be updated instead. | ||
34 | - * | ||
35 | - * @param block scope within which you can build up the constraints which you wish to apply to each view. | ||
36 | - * | ||
37 | - * @return Array of created/updated MASConstraints | ||
38 | - */ | ||
39 | -- (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
40 | - | ||
41 | -/** | ||
42 | - * Creates a MASConstraintMaker with each view in the callee. | ||
43 | - * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. | ||
44 | - * All constraints previously installed for the views will be removed. | ||
45 | - * | ||
46 | - * @param block scope within which you can build up the constraints which you wish to apply to each view. | ||
47 | - * | ||
48 | - * @return Array of created/updated MASConstraints | ||
49 | - */ | ||
50 | -- (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
51 | - | ||
52 | -/** | ||
53 | - * distribute with fixed spacing | ||
54 | - * | ||
55 | - * @param axisType which axis to distribute items along | ||
56 | - * @param fixedSpacing the spacing between each item | ||
57 | - * @param leadSpacing the spacing before the first item and the container | ||
58 | - * @param tailSpacing the spacing after the last item and the container | ||
59 | - */ | ||
60 | -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; | ||
61 | - | ||
62 | -/** | ||
63 | - * distribute with fixed item size | ||
64 | - * | ||
65 | - * @param axisType which axis to distribute items along | ||
66 | - * @param fixedItemLength the fixed length of each item | ||
67 | - * @param leadSpacing the spacing before the first item and the container | ||
68 | - * @param tailSpacing the spacing after the last item and the container | ||
69 | - */ | ||
70 | -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; | ||
71 | - | ||
72 | -@end |
1 | -// | ||
2 | -// NSArray+MASShorthandAdditions.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 22/07/13. | ||
6 | -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "NSArray+MASAdditions.h" | ||
10 | - | ||
11 | -#ifdef MAS_SHORTHAND | ||
12 | - | ||
13 | -/** | ||
14 | - * Shorthand array additions without the 'mas_' prefixes, | ||
15 | - * only enabled if MAS_SHORTHAND is defined | ||
16 | - */ | ||
17 | -@interface NSArray (MASShorthandAdditions) | ||
18 | - | ||
19 | -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; | ||
20 | -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; | ||
21 | -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; | ||
22 | - | ||
23 | -@end | ||
24 | - | ||
25 | -@implementation NSArray (MASShorthandAdditions) | ||
26 | - | ||
27 | -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { | ||
28 | - return [self mas_makeConstraints:block]; | ||
29 | -} | ||
30 | - | ||
31 | -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { | ||
32 | - return [self mas_updateConstraints:block]; | ||
33 | -} | ||
34 | - | ||
35 | -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { | ||
36 | - return [self mas_remakeConstraints:block]; | ||
37 | -} | ||
38 | - | ||
39 | -@end | ||
40 | - | ||
41 | -#endif |
1 | -// | ||
2 | -// NSBundle+MJRefresh.h | ||
3 | -// MJRefreshExample | ||
4 | -// | ||
5 | -// Created by MJ Lee on 16/6/13. | ||
6 | -// Copyright © 2016年 小码哥. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <UIKit/UIKit.h> | ||
10 | - | ||
11 | -NS_ASSUME_NONNULL_BEGIN | ||
12 | - | ||
13 | -@interface NSBundle (HHMJRefresh) | ||
14 | -+ (instancetype)mj_refreshBundle; | ||
15 | -+ (UIImage *)mj_arrowImage; | ||
16 | -+ (NSString *)mj_localizedStringForKey:(NSString *)key value:(nullable NSString *)value; | ||
17 | -+ (NSString *)mj_localizedStringForKey:(NSString *)key; | ||
18 | -@end | ||
19 | - | ||
20 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// NSLayoutConstraint+MASDebugAdditions.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 3/08/13. | ||
6 | -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | - | ||
11 | -/** | ||
12 | - * makes debug and log output of NSLayoutConstraints more readable | ||
13 | - */ | ||
14 | -@interface NSLayoutConstraint (MASDebugAdditions) | ||
15 | - | ||
16 | -@end |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// UIScrollView+Extension.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 14-5-28. | ||
7 | -// Copyright (c) 2014年 小码哥. All rights reserved. | ||
8 | -// | ||
9 | - | ||
10 | -#import <UIKit/UIKit.h> | ||
11 | - | ||
12 | -NS_ASSUME_NONNULL_BEGIN | ||
13 | - | ||
14 | -@interface UIScrollView (HHMJExtension) | ||
15 | -@property (readonly, nonatomic) UIEdgeInsets mj_inset; | ||
16 | - | ||
17 | -@property (assign, nonatomic) CGFloat mj_insetT; | ||
18 | -@property (assign, nonatomic) CGFloat mj_insetB; | ||
19 | -@property (assign, nonatomic) CGFloat mj_insetL; | ||
20 | -@property (assign, nonatomic) CGFloat mj_insetR; | ||
21 | - | ||
22 | -@property (assign, nonatomic) CGFloat mj_offsetX; | ||
23 | -@property (assign, nonatomic) CGFloat mj_offsetY; | ||
24 | - | ||
25 | -@property (assign, nonatomic) CGFloat mj_contentW; | ||
26 | -@property (assign, nonatomic) CGFloat mj_contentH; | ||
27 | -@end | ||
28 | - | ||
29 | -NS_ASSUME_NONNULL_END |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// UIScrollView+MJRefresh.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 15/3/4. | ||
7 | -// Copyright (c) 2015年 小码哥. All rights reserved. | ||
8 | -// 给ScrollView增加下拉刷新、上拉刷新的功能 | ||
9 | - | ||
10 | -#import <UIKit/UIKit.h> | ||
11 | -#import "HHMJRefreshConst.h" | ||
12 | - | ||
13 | -@class HHMJRefreshHeader, HHMJRefreshFooter; | ||
14 | - | ||
15 | -NS_ASSUME_NONNULL_BEGIN | ||
16 | - | ||
17 | -@interface UIScrollView (HHMJRefresh) | ||
18 | -/** 下拉刷新控件 */ | ||
19 | -@property (strong, nonatomic, nullable) HHMJRefreshHeader *hh_mj_header; | ||
20 | -@property (strong, nonatomic, nullable) HHMJRefreshHeader *hh_header HHMJRefreshDeprecated("使用mj_header"); | ||
21 | -/** 上拉刷新控件 */ | ||
22 | -@property (strong, nonatomic, nullable) HHMJRefreshFooter *hh_mj_footer; | ||
23 | -@property (strong, nonatomic, nullable) HHMJRefreshFooter *hh_footer HHMJRefreshDeprecated("使用mj_footer"); | ||
24 | - | ||
25 | -#pragma mark - other | ||
26 | -- (NSInteger)hh_mj_totalDataCount; | ||
27 | - | ||
28 | -@end | ||
29 | - | ||
30 | -NS_ASSUME_NONNULL_END |
1 | -// 代码地址: https://github.com/CoderMJLee/MJRefresh | ||
2 | -// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 | ||
3 | -// UIView+Extension.h | ||
4 | -// MJRefreshExample | ||
5 | -// | ||
6 | -// Created by MJ Lee on 14-5-28. | ||
7 | -// Copyright (c) 2014年 小码哥. All rights reserved. | ||
8 | -// | ||
9 | - | ||
10 | -#import <UIKit/UIKit.h> | ||
11 | - | ||
12 | -NS_ASSUME_NONNULL_BEGIN | ||
13 | - | ||
14 | -@interface UIView (HHMJExtension) | ||
15 | -@property (assign, nonatomic) CGFloat mj_x; | ||
16 | -@property (assign, nonatomic) CGFloat mj_y; | ||
17 | -@property (assign, nonatomic) CGFloat mj_w; | ||
18 | -@property (assign, nonatomic) CGFloat mj_h; | ||
19 | -@property (assign, nonatomic) CGSize mj_size; | ||
20 | -@property (assign, nonatomic) CGPoint mj_origin; | ||
21 | -@end | ||
22 | - | ||
23 | -NS_ASSUME_NONNULL_END |
1 | -// | ||
2 | -// UIView+MASAdditions.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 20/07/13. | ||
6 | -// Copyright (c) 2013 cloudling. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | -#import "MASConstraintMaker.h" | ||
11 | -#import "MASViewAttribute.h" | ||
12 | - | ||
13 | -/** | ||
14 | - * Provides constraint maker block | ||
15 | - * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs | ||
16 | - */ | ||
17 | -@interface MAS_VIEW (MASAdditions) | ||
18 | - | ||
19 | -/** | ||
20 | - * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute | ||
21 | - */ | ||
22 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_left; | ||
23 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_top; | ||
24 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_right; | ||
25 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; | ||
26 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; | ||
27 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; | ||
28 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_width; | ||
29 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_height; | ||
30 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; | ||
31 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; | ||
32 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; | ||
33 | -@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); | ||
34 | - | ||
35 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
36 | - | ||
37 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; | ||
38 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; | ||
39 | - | ||
40 | -#endif | ||
41 | - | ||
42 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
43 | - | ||
44 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; | ||
45 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; | ||
46 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; | ||
47 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; | ||
48 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; | ||
49 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; | ||
50 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; | ||
51 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; | ||
52 | - | ||
53 | -#endif | ||
54 | - | ||
55 | -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) | ||
56 | - | ||
57 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
58 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
59 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
60 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
61 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
62 | - | ||
63 | -#endif | ||
64 | - | ||
65 | -/** | ||
66 | - * a key to associate with this view | ||
67 | - */ | ||
68 | -@property (nonatomic, strong) id mas_key; | ||
69 | - | ||
70 | -/** | ||
71 | - * Finds the closest common superview between this view and another view | ||
72 | - * | ||
73 | - * @param view other view | ||
74 | - * | ||
75 | - * @return returns nil if common superview could not be found | ||
76 | - */ | ||
77 | -- (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; | ||
78 | - | ||
79 | -/** | ||
80 | - * Creates a MASConstraintMaker with the callee view. | ||
81 | - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing | ||
82 | - * | ||
83 | - * @param block scope within which you can build up the constraints which you wish to apply to the view. | ||
84 | - * | ||
85 | - * @return Array of created MASConstraints | ||
86 | - */ | ||
87 | -- (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
88 | - | ||
89 | -/** | ||
90 | - * Creates a MASConstraintMaker with the callee view. | ||
91 | - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. | ||
92 | - * If an existing constraint exists then it will be updated instead. | ||
93 | - * | ||
94 | - * @param block scope within which you can build up the constraints which you wish to apply to the view. | ||
95 | - * | ||
96 | - * @return Array of created/updated MASConstraints | ||
97 | - */ | ||
98 | -- (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
99 | - | ||
100 | -/** | ||
101 | - * Creates a MASConstraintMaker with the callee view. | ||
102 | - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. | ||
103 | - * All constraints previously installed for the view will be removed. | ||
104 | - * | ||
105 | - * @param block scope within which you can build up the constraints which you wish to apply to the view. | ||
106 | - * | ||
107 | - * @return Array of created/updated MASConstraints | ||
108 | - */ | ||
109 | -- (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; | ||
110 | - | ||
111 | -@end |
1 | -// | ||
2 | -// UIView+MASShorthandAdditions.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Jonas Budelmann on 22/07/13. | ||
6 | -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import "View+MASAdditions.h" | ||
10 | - | ||
11 | -#ifdef MAS_SHORTHAND | ||
12 | - | ||
13 | -/** | ||
14 | - * Shorthand view additions without the 'mas_' prefixes, | ||
15 | - * only enabled if MAS_SHORTHAND is defined | ||
16 | - */ | ||
17 | -@interface MAS_VIEW (MASShorthandAdditions) | ||
18 | - | ||
19 | -@property (nonatomic, strong, readonly) MASViewAttribute *left; | ||
20 | -@property (nonatomic, strong, readonly) MASViewAttribute *top; | ||
21 | -@property (nonatomic, strong, readonly) MASViewAttribute *right; | ||
22 | -@property (nonatomic, strong, readonly) MASViewAttribute *bottom; | ||
23 | -@property (nonatomic, strong, readonly) MASViewAttribute *leading; | ||
24 | -@property (nonatomic, strong, readonly) MASViewAttribute *trailing; | ||
25 | -@property (nonatomic, strong, readonly) MASViewAttribute *width; | ||
26 | -@property (nonatomic, strong, readonly) MASViewAttribute *height; | ||
27 | -@property (nonatomic, strong, readonly) MASViewAttribute *centerX; | ||
28 | -@property (nonatomic, strong, readonly) MASViewAttribute *centerY; | ||
29 | -@property (nonatomic, strong, readonly) MASViewAttribute *baseline; | ||
30 | -@property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); | ||
31 | - | ||
32 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
33 | - | ||
34 | -@property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; | ||
35 | -@property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; | ||
36 | - | ||
37 | -#endif | ||
38 | - | ||
39 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
40 | - | ||
41 | -@property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; | ||
42 | -@property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; | ||
43 | -@property (nonatomic, strong, readonly) MASViewAttribute *topMargin; | ||
44 | -@property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; | ||
45 | -@property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; | ||
46 | -@property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; | ||
47 | -@property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; | ||
48 | -@property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; | ||
49 | - | ||
50 | -#endif | ||
51 | - | ||
52 | -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) | ||
53 | - | ||
54 | -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
55 | -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
56 | -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
57 | -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); | ||
58 | - | ||
59 | -#endif | ||
60 | - | ||
61 | -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; | ||
62 | -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; | ||
63 | -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; | ||
64 | - | ||
65 | -@end | ||
66 | - | ||
67 | -#define MAS_ATTR_FORWARD(attr) \ | ||
68 | -- (MASViewAttribute *)attr { \ | ||
69 | - return [self mas_##attr]; \ | ||
70 | -} | ||
71 | - | ||
72 | -@implementation MAS_VIEW (MASShorthandAdditions) | ||
73 | - | ||
74 | -MAS_ATTR_FORWARD(top); | ||
75 | -MAS_ATTR_FORWARD(left); | ||
76 | -MAS_ATTR_FORWARD(bottom); | ||
77 | -MAS_ATTR_FORWARD(right); | ||
78 | -MAS_ATTR_FORWARD(leading); | ||
79 | -MAS_ATTR_FORWARD(trailing); | ||
80 | -MAS_ATTR_FORWARD(width); | ||
81 | -MAS_ATTR_FORWARD(height); | ||
82 | -MAS_ATTR_FORWARD(centerX); | ||
83 | -MAS_ATTR_FORWARD(centerY); | ||
84 | -MAS_ATTR_FORWARD(baseline); | ||
85 | - | ||
86 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) | ||
87 | - | ||
88 | -MAS_ATTR_FORWARD(firstBaseline); | ||
89 | -MAS_ATTR_FORWARD(lastBaseline); | ||
90 | - | ||
91 | -#endif | ||
92 | - | ||
93 | -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) | ||
94 | - | ||
95 | -MAS_ATTR_FORWARD(leftMargin); | ||
96 | -MAS_ATTR_FORWARD(rightMargin); | ||
97 | -MAS_ATTR_FORWARD(topMargin); | ||
98 | -MAS_ATTR_FORWARD(bottomMargin); | ||
99 | -MAS_ATTR_FORWARD(leadingMargin); | ||
100 | -MAS_ATTR_FORWARD(trailingMargin); | ||
101 | -MAS_ATTR_FORWARD(centerXWithinMargins); | ||
102 | -MAS_ATTR_FORWARD(centerYWithinMargins); | ||
103 | - | ||
104 | -#endif | ||
105 | - | ||
106 | -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) | ||
107 | - | ||
108 | -MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); | ||
109 | -MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); | ||
110 | -MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); | ||
111 | -MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); | ||
112 | - | ||
113 | -#endif | ||
114 | - | ||
115 | -- (MASViewAttribute *(^)(NSLayoutAttribute))attribute { | ||
116 | - return [self mas_attribute]; | ||
117 | -} | ||
118 | - | ||
119 | -- (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { | ||
120 | - return [self mas_makeConstraints:block]; | ||
121 | -} | ||
122 | - | ||
123 | -- (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { | ||
124 | - return [self mas_updateConstraints:block]; | ||
125 | -} | ||
126 | - | ||
127 | -- (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { | ||
128 | - return [self mas_remakeConstraints:block]; | ||
129 | -} | ||
130 | - | ||
131 | -@end | ||
132 | - | ||
133 | -#endif |
1 | -// | ||
2 | -// UIViewController+MASAdditions.h | ||
3 | -// Masonry | ||
4 | -// | ||
5 | -// Created by Craig Siemens on 2015-06-23. | ||
6 | -// | ||
7 | -// | ||
8 | - | ||
9 | -#import "MASUtilities.h" | ||
10 | -#import "MASConstraintMaker.h" | ||
11 | -#import "MASViewAttribute.h" | ||
12 | - | ||
13 | -#ifdef MAS_VIEW_CONTROLLER | ||
14 | - | ||
15 | -@interface MAS_VIEW_CONTROLLER (MASAdditions) | ||
16 | - | ||
17 | -/** | ||
18 | - * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute | ||
19 | - */ | ||
20 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; | ||
21 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; | ||
22 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; | ||
23 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; | ||
24 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; | ||
25 | -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; | ||
26 | - | ||
27 | - | ||
28 | -@end | ||
29 | - | ||
30 | -#endif |
No preview for this file type
No preview for this file type
liberate.framework/Modules/liberate.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
deleted
100644 → 0
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
liberate.framework/Modules/liberate.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
deleted
100644 → 0
No preview for this file type
No preview for this file type
No preview for this file type
liberate.framework/home.storyboardc/UIViewController-zgx-vV-W8G.nib/objects-11.0+.nib
deleted
100644 → 0
No preview for this file type
liberate.framework/home.storyboardc/UIViewController-zgx-vV-W8G.nib/objects-12.3+.nib
deleted
100644 → 0
No preview for this file type
liberate.framework/home.storyboardc/zgx-vV-W8G-view-o7e-RY-Gcw.nib/objects-12.3+.nib
deleted
100644 → 0
No preview for this file type
1 | 1 | ||
2 | Pod::Spec.new do |s| | 2 | Pod::Spec.new do |s| |
3 | s.name = 'liberate' | 3 | s.name = 'liberate' |
4 | - s.version = "3.6.0.03061820" | 4 | + s.version = "3.6.0.03071101" |
5 | s.summary = 'A short description of liberate.' | 5 | s.summary = 'A short description of liberate.' |
6 | 6 | ||
7 | s.ios.deployment_target = '9.0' | 7 | s.ios.deployment_target = '9.0' |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
liberate/CallAlterView.nib/objects-11.0+.nib
0 → 100644
No preview for this file type
No preview for this file type
liberate/HHErrorView.nib/objects-11.0+.nib
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
-
Please register or login to post a comment