How to create a UIView without blocking the user interface


How can I create lots of UIView & setting text on the UITextView which is the subview of UIView in Background thread.

Currently I am using a for loop to create the UIView but it is blocking the user to do anything.

Please help me to get this done. Thanks In Advance :)

UIKit is not intended to be used in background. You do not need to have lots and lots of instantiated UIViews, as they would consume a lot of resources, but as many as you can show on the screen, then just reuse them for showing the others, eg. when the users scrolls. That's the idea of the collection views and table views - use them instead or implement your own reusable mechanism.