123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // UIView+YYAdd.h
- // YYCategories <https://github.com/ibireme/YYCategories>
- //
- // Created by ibireme on 13/4/3.
- // Copyright (c) 2015 ibireme.
- //
- // This source code is licensed under the MIT-style license found in the
- // LICENSE file in the root directory of this source tree.
- //
- #import <UIKit/UIKit.h>
- /**
- Provides extensions for `UIView`.
- */
- @interface UIView (YYAdd)
- /**
- Shortcut to set the view.layer's shadow
-
- @param color Shadow Color
- @param offset Shadow offset
- @param radius Shadow radius
- */
- - (void)setLayerShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;
- /**
- Remove all subviews.
-
- @warning Never call this method inside your view's drawRect: method.
- */
- - (void)removeAllSubviews;
- /**
- Returns the view's view controller (may be nil).
- */
- @property (nonatomic, readonly) UIViewController *viewController;
- @property (nonatomic) CGFloat left; ///< Shortcut for frame.origin.x.
- @property (nonatomic) CGFloat top; ///< Shortcut for frame.origin.y
- @property (nonatomic) CGFloat right; ///< Shortcut for frame.origin.x + frame.size.width
- @property (nonatomic) CGFloat bottom; ///< Shortcut for frame.origin.y + frame.size.height
- @property (nonatomic) CGFloat width; ///< Shortcut for frame.size.width.
- @property (nonatomic) CGFloat height; ///< Shortcut for frame.size.height.
- @property (nonatomic) CGFloat centerX; ///< Shortcut for center.x
- @property (nonatomic) CGFloat centerY; ///< Shortcut for center.y
- @property (nonatomic) CGPoint origin; ///< Shortcut for frame.origin.
- @property (nonatomic) CGSize size; ///< Shortcut for frame.size.
- @end
|