Tag: uiview

HOW TO CONVERT UIVIEW TO UISCROLLVIEW

Converting a UIView to UIScrollView is now going to be like a child’s play. In this post, we will share with you the easiest way to make it happen.

STEP 1:

Drag & drop a UIViewController to your storyboard and add a UIView to it.

STEP 2:

Make an outlet of the view.

STEP 3:

Go to view controller’s Identity Inspector and change class to UIScrollView

STEP 4:

Resize your view to get scrolling effect

(self.urview as! UIScrollView).contentSize = CGSizeMake(self.view.frame.width, self.view.frame.height)

Compile and Run to see it working.

Isn’t it simple?

Advertisements