Your Great Journey Starts here.

How to present fixed size popover properly in iOS 8

Popover will do a great job when presenting useful information on the context of vriewcontroller. However we often have to display the popover in fixed size to make it look better and convinent and userfriendly. Adding contentSizeForViewInPopover could have done the job before iOS 7. but there is a new method introduced in ios 7 to the same job to be supported in all the feature versions. Add the code below to check if the code running in iOS 7 and later it will use the latest method otherwise it will use the old method to adjust the popover to a fixed size.