Note that there are some explanatory texts on larger screens.

plurals
  1. POSlide-able UIView menu that responds to UIGestureRecognizer
    primarykey
    data
    text
    <p>So what I am trying to do with this view is make it so that i can slide the UIView (menuView) up and down in and out of the screen. So in storyboard/IB i placed a UIView and connected it to files owner and all that jazz. then i entered the program the below code. The problem is that when the nib loads it doesnt put the UIView where it should be in the first place and then the swipe doesn't work on it. I tried this method of programming with a button and it worked fine. Thanks in advance for any help you may have on the subject.</p> <p>.h file</p> <pre><code>UIView *menuView; } @property (strong, nonatomic) IBOutlet UIView *menuView; </code></pre> <p>.m file</p> <pre><code>@synthesize menuView; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipe:)]; [swipeGesture setDirection:UISwipeGestureRecognizerDirectionDown]; [self.view addGestureRecognizer:swipeGesture]; menuView = [[UIView alloc] initWithFrame:CGRectMake(0, -80, 320, 80)]; [menuView setFrame:CGRectMake(0, -80, 320, 80)]; [self.view addSubview:menuView]; } -(void)swipe:(UISwipeGestureRecognizer*)sender { [UIView animateWithDuration:0.5 animations:^{ [menuView setFrame:CGRectMake(0, 0, 320, 80)]; }]; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload