In iOS 12, when does the UICollectionView layout cells, use autolayout in nib

For all solutions, note that there is no need to explicitly call reloadData in viewDidLoad: it will happen automatically. Solution 1 Inspired by Samantha idea: invalidateLayout asynchronously in viewDidLoad. override func viewDidLoad() { super.viewDidLoad() //[…] for _ in 0 ..< 1000 { array.append(randomKeyByBitLength(Int(arc4random_uniform(8)))!) } DispatchQueue.main.async { self.collectionView.collectionViewLayout.invalidateLayout() } } Solution 2 (imperfect, see DHennessy13 improvement … Read more

How to remove constraints programmatically that is added from storyboard?

As @Henit mentioned, you can set IBOutlet for constraints as well. For example, @property(weak, nonatomic) IBOutlet NSLayoutConstraint *viewHeight; so now, you can remove this constraint like this: [myView removeConstraint: viewHeight]; Or else if you want to remove all / multiple constraints related to your view then, [myView removeConstraints: constraintsArrayHere]; // custom array of constraints references … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)