123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // UIView+ViewController.h
- // Created by MacKun on 15/4/25.
- // Copyright (c) 2015年 MacKun All rights reserved.
- //
- #import <UIKit/UIKit.h>
- @interface UIView (ViewController)
- /**
- * @brief 找到当前view所在的viewcontroler
- */
- @property (readonly) UIViewController *viewController;
- /**
- Remove all subviews.
-
- @warning Never call this method inside your view's drawRect: method.
- */
- - (void)removeAllSubviews;
- /**
- Converts a point from the receiver's coordinate system to that of the specified view or window.
-
- @param point A point specified in the local coordinate system (bounds) of the receiver.
- @param view The view or window into whose coordinate system point is to be converted.
- If view is nil, this method instead converts to window base coordinates.
- @return The point converted to the coordinate system of view.
- */
- - (CGPoint)convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view;
- /**
- Converts a point from the coordinate system of a given view or window to that of the receiver.
-
- @param point A point specified in the local coordinate system (bounds) of view.
- @param view The view or window with point in its coordinate system.
- If view is nil, this method instead converts from window base coordinates.
- @return The point converted to the local coordinate system (bounds) of the receiver.
- */
- - (CGPoint)convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view;
- /**
- Converts a rectangle from the receiver's coordinate system to that of another view or window.
-
- @param rect A rectangle specified in the local coordinate system (bounds) of the receiver.
- @param view The view or window that is the target of the conversion operation. If view is nil, this method instead converts to window base coordinates.
- @return The converted rectangle.
- */
- - (CGRect)convertRect:(CGRect)rect toViewOrWindow:(UIView *)view;
- /**
- Converts a rectangle from the coordinate system of another view or window to that of the receiver.
-
- @param rect A rectangle specified in the local coordinate system (bounds) of view.
- @param view The view or window with rect in its coordinate system.
- If view is nil, this method instead converts from window base coordinates.
- @return The converted rectangle.
- */
- - (CGRect)convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view;
- /// 移除所有子视图中 tableview、scrollview 的 delegate、datasource
- - (void)clearScrollViewDelegate;
- - (void)removeAllGestures;
- - (void)removeAllGesturesWithSubViews;
- /// 在 block 内禁用动画
- + (void)disableAnimationWithBlock:(void (^)(void))block;
- @end
|