0

Why wouldn't a UIButton move when I call:

myButton.frame.origin.x = 100

I am calling it from within the viewDidLayoutSubviews() function, the function is called because an annotation is created on a map, though the button is in a view which isn't really related to the map.

elitey33t
  • 1
  • 2

1 Answers1

0

viewDidLayoutSubviews() Called to notify the view controller that its view has just laid out its subviews.

So this is our chance to make changes to view after it has laid out it's subviews, but before it is visible on screen.

Any changes that depending on bounds has to be done, we can do here and not in ViewDidLoad or ViewWillAppear.

What's exactly viewDidLayoutSubviews?

Samvel
  • 21
  • 3