Skip to content

Instantly share code, notes, and snippets.

@Sunnyztj
Created February 20, 2014 01:59
Show Gist options
  • Save Sunnyztj/9105614 to your computer and use it in GitHub Desktop.
Save Sunnyztj/9105614 to your computer and use it in GitHub Desktop.
how to get application frame
- (IBAction)loadDataButtonClicked:(id)sender {
if (_scaledDown) {
[self _beginReleaseAnimation];
}
[_delegate draggableViewTouched:self];
self.hideBtn.hidden = YES;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if (_scaledDown) {
[self _beginReleaseAnimation];
}
if (!_moved) {
[_delegate draggableViewTouched:self];
UIButton *hideBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//there is destination code
hideBtn.frame = [self.window.screen applicationFrame];
hideBtn.titleLabel.textColor = [UIColor clearColor];
self.hideBtn = hideBtn;
self.hideBtn.hidden = NO;
[self.hideBtn addTarget:self action:@selector(loadDataButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.window insertSubview:self.hideBtn aboveSubview:self];
// [hideBtn release];
} else {
[_delegate draggableViewReleased:self];
}
_moved = NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment