0

Is there a way to subclass or customize UIActivityViewController to create a sort of custom view? For example, see the image below from the app Overcast. I want to create a view similar to that, where if you tap a button, the view pops up and when you tap outside of the view, it slides back down.

enter image description here

tentmaking
  • 2,076
  • 4
  • 30
  • 53

1 Answers1

0

Why not use an UIView ? Set it's initial frame's y value to -self.customView.frame.size.height and animate it's frame to the normal position using [UIView animateWithDuration]

-(void)showCustomView{
    [self.customview setFrame:CGRectMake(0, -self.customView.frame.size.height, self.view.bounds.size.height+self.customView.frame.size.width, self.customView.frame.size.height)];
    [UIView animateWithDuration:0.25 animations:^{
        [self.customView setFrame:CGRectMake(0, -self.view.frame.size.height,  self.view.bounds.size.height-self.customView.frame.size.width, self.customView.frame.size.height)];

    }];
}

-(void)hideCustomView{
    [UIView animateWithDuration:0.25 animations:^{
        [self.customView setFrame:CGRectMake(0, -self.customView.frame.size.height,  self.customView.bounds.size.height+self.customView.frame.size.width, self.customView.frame.size.height)];

    }];
}

Add an UITapGestureRecognizer and call hideCustomView when tapped outside the customView

Sebyddd
  • 4,305
  • 2
  • 39
  • 43