You can use the code below to add a UIScrollView to your view: -
[self.ScrollView setContentSize:(CGSizeMake(self.view.frame.size.width, self.view.frame.size.height))];
Step: 1 Create a UiScrollView,
@interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet UIScrollView *MyScrollView; @end
Step 2: In your ViewController.m,
[self.MyScrollView setContentSize:(CGSizeMake(self.view.frame.size.width, self.view.frame.size.height))];
source share