Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.
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
4 changes: 2 additions & 2 deletions Demo/TSPopoverDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "TSPopoverDemo/TSPopoverDemo-Prefix.pch";
INFOPLIST_FILE = "TSPopoverDemo/TSPopoverDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
Expand All @@ -282,7 +282,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "TSPopoverDemo/TSPopoverDemo-Prefix.pch";
INFOPLIST_FILE = "TSPopoverDemo/TSPopoverDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
Expand Down
6 changes: 6 additions & 0 deletions TSPopover/TSActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#define TITLE_SHADOW_OFFSET CGSizeMake(0, -1)
#define BUTTON_HEIGHT 35

@interface TSActionSheet()

- (void)buildButtons;
- (UIImage*)buttonImage:(UIColor*)color borderWidth:(NSUInteger)borderWidth borderColor:(UIColor*)borderColor;
@end

@implementation TSActionSheet

@synthesize cornerRadius = _cornerRadius;
Expand Down
10 changes: 7 additions & 3 deletions TSPopover/TSPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
#define ARROW_MARGIN 2

@interface TSPopoverController ()

- (void) checkArrowPosition:(CGRect)senderRect;
- (CGPoint)senderPointFromSenderRect:(CGRect)senderRect;
- (void) showPopoverWithPoint:(CGPoint)senderPoint;
- (CGRect) contentFrameRect:(CGRect)contentFrame senderPoint:(CGPoint)senderPoint;
- (CGRect)popoverFrameRect:(CGRect)contentFrame senderPoint:(CGPoint)senderPoint;
@end

@implementation TSPopoverController
Expand Down Expand Up @@ -188,7 +192,7 @@ - (void) showPopoverWithPoint:(CGPoint)senderPoint
UIWindow *appWindow = [[UIApplication sharedApplication] keyWindow];
//[appWindow addSubview:self.view];

[appWindow.rootViewController.view addSubview:self.view];
[appWindow addSubview:self.view];


[UIView animateWithDuration:0.0
Expand Down Expand Up @@ -331,7 +335,7 @@ - (CGRect)popoverFrameRect:(CGRect)contentFrame senderPoint:(CGPoint)senderPoint

popoverRect = CGRectMake(popoverX, popoverY, popoverWidth, popoverHeight);

}else if(self.arrowPosition = TSPopoverArrowPositionHorizontal){
}else if(self.arrowPosition == TSPopoverArrowPositionHorizontal){

popoverWidth = contentFrame.size.width+ARROW_SIZE+MARGIN*2;
popoverHeight = contentFrame.size.height+titleLabelheight+MARGIN*2;
Expand Down
6 changes: 5 additions & 1 deletion TSPopover/TSPopoverPopoverView.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#define MARGIN 5
#define ARROW_SIZE 20

@interface TSPopoverPopoverView()
-(UIImage*)backgroundImage;
@end

@implementation TSPopoverPopoverView

@synthesize cornerRadius = _cornerRadius;
Expand All @@ -34,7 +38,7 @@ - (id)init

- (void)drawRect:(CGRect)rect
{
UIImage *backgroundImage = self.backgroundImage;
UIImage *backgroundImage = [self backgroundImage];
[backgroundImage drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height) blendMode:kCGBlendModeNormal alpha:1];

}
Expand Down