how to center a view uikit code example
Example 1: how to set the center in view in swift
childView.center = parentView.center
Example 2: how to set the center in view in swift
childView.centerXAnchor.constraint(equalTo: parentView.centerXAnchor).isActive = true
childView.centerYAnchor.constraint(equalTo: parentView.centerYAnchor).isActive = true