popover size based on content iOS swift

 Problem:

I want to show my popover with it's size based on the content of the popover with it's tableview.How can i achieve that?


Solution:

In viewdidload of the popover call the code as like below and achieve that.

        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {

            self.preferredContentSize = self.mytbl.contentSize

        }

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift