Create a view that will be below 30% of the screen in y axis iOS swift

 Solution:

I want to create a view that will be below 30% from the top of the screen.Then i will set the view constraints with center from y axis then add the below code.

Code:

        view.centerYAnchor.constraint(equalToself.view.topAnchorconstantUIScreen.main.bounds.height * 0.3).isActive = true


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift