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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s