Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions WYPopoverController/WYPopoverController.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@

Copyright © 2013 Nicolas CHENG

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
*/

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
Expand All @@ -31,11 +31,11 @@
@class WYPopoverTheme;

#ifndef WY_POPOVER_DEFAULT_ANIMATION_DURATION
#define WY_POPOVER_DEFAULT_ANIMATION_DURATION .25f
#define WY_POPOVER_DEFAULT_ANIMATION_DURATION .25f
#endif

#ifndef WY_POPOVER_MIN_SIZE
#define WY_POPOVER_MIN_SIZE CGSizeMake(240, 160)
#define WY_POPOVER_MIN_SIZE CGSizeMake(20, 20)
#endif

typedef NS_OPTIONS(NSUInteger, WYPopoverArrowDirection) {
Expand Down Expand Up @@ -64,24 +64,24 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {

@property (nonatomic, strong) UIColor *glossShadowColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGSize glossShadowOffset UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger glossShadowBlurRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat glossShadowBlurRadius UI_APPEARANCE_SELECTOR;

@property (nonatomic, assign) NSUInteger borderWidth UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger arrowBase UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger arrowHeight UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat borderWidth UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat arrowBase UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat arrowHeight UI_APPEARANCE_SELECTOR;

@property (nonatomic, strong) UIColor *outerShadowColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *outerStrokeColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger outerShadowBlurRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat outerShadowBlurRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGSize outerShadowOffset UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger outerCornerRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger minOuterCornerRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat outerCornerRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat minOuterCornerRadius UI_APPEARANCE_SELECTOR;

@property (nonatomic, strong) UIColor *innerShadowColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *innerStrokeColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger innerShadowBlurRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat innerShadowBlurRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGSize innerShadowOffset UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) NSUInteger innerCornerRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat innerCornerRadius UI_APPEARANCE_SELECTOR;

@property (nonatomic, assign) UIEdgeInsets viewContentInsets UI_APPEARANCE_SELECTOR;

Expand All @@ -100,8 +100,9 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {
@property (nonatomic, assign) UIEdgeInsets popoverLayoutMargins;
@property (nonatomic, readonly, getter=isPopoverVisible) BOOL popoverVisible;
@property (nonatomic, strong, readonly) UIViewController *contentViewController;
@property (nonatomic, strong, readonly) UIView *popoverContentView;
@property (nonatomic, assign) CGSize popoverContentSize;
@property (nonatomic, assign) float animationDuration;
@property (nonatomic, assign) CGFloat animationDuration;

@property (nonatomic, strong) WYPopoverTheme *theme;

Expand All @@ -112,6 +113,9 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {

- (id)initWithContentViewController:(UIViewController *)viewController;

// custom
- (id)initWithContentView:(UIView *)contentView;

// theme

- (void)beginThemeUpdates;
Expand Down Expand Up @@ -210,7 +214,7 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {

- (BOOL)popoverControllerShouldIgnoreKeyboardBounds:(WYPopoverController *)popoverController;

- (void)popoverController:(WYPopoverController *)popoverController willTranslatePopoverWithYOffset:(float *)value;
- (void)popoverController:(WYPopoverController *)popoverController willTranslatePopoverWithYOffset:(CGFloat *)value;

@end

Expand All @@ -224,24 +228,24 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {

@property (nonatomic, strong) UIColor *glossShadowColor;
@property (nonatomic, assign) CGSize glossShadowOffset;
@property (nonatomic, assign) NSUInteger glossShadowBlurRadius;
@property (nonatomic, assign) CGFloat glossShadowBlurRadius;

@property (nonatomic, assign) NSUInteger borderWidth;
@property (nonatomic, assign) NSUInteger arrowBase;
@property (nonatomic, assign) NSUInteger arrowHeight;
@property (nonatomic, assign) CGFloat borderWidth;
@property (nonatomic, assign) CGFloat arrowBase;
@property (nonatomic, assign) CGFloat arrowHeight;

@property (nonatomic, strong) UIColor *outerShadowColor;
@property (nonatomic, strong) UIColor *outerStrokeColor;
@property (nonatomic, assign) NSUInteger outerShadowBlurRadius;
@property (nonatomic, assign) CGFloat outerShadowBlurRadius;
@property (nonatomic, assign) CGSize outerShadowOffset;
@property (nonatomic, assign) NSUInteger outerCornerRadius;
@property (nonatomic, assign) NSUInteger minOuterCornerRadius;
@property (nonatomic, assign) CGFloat outerCornerRadius;
@property (nonatomic, assign) CGFloat minOuterCornerRadius;

@property (nonatomic, strong) UIColor *innerShadowColor;
@property (nonatomic, strong) UIColor *innerStrokeColor;
@property (nonatomic, assign) NSUInteger innerShadowBlurRadius;
@property (nonatomic, assign) CGFloat innerShadowBlurRadius;
@property (nonatomic, assign) CGSize innerShadowOffset;
@property (nonatomic, assign) NSUInteger innerCornerRadius;
@property (nonatomic, assign) CGFloat innerCornerRadius;

@property (nonatomic, assign) UIEdgeInsets viewContentInsets;

Expand Down
Loading