1

i am very confused with the storyboard and custom codes working together, sometimes it works and a lot of times i am trying to figure out why isn't it working

eg i set up a custom view in storyboard and hook up with outlets. when app starts i try to move the custom view around in awakFromNib, but it just won't move... :(

does anyone have solution to this? or can anyone please kindly explain the basics when it comes to layout in the storyboard and dynamically change attributes in code?

thanks in advance!!

Chris Lin
  • 709
  • 2
  • 10
  • 20

2 Answers2

0

Try to do your animations after viewDidLoad. You can also check this answer, to better understand awakeFromNib.

Community
  • 1
  • 1
Rui Peres
  • 25,741
  • 9
  • 87
  • 137
0

The modifications on your (Nib-generated) view should be done in

  • viewDidLoad()
  • viewWillAppear()
  • viewDidAppear()

If you need animated changes, you should move your code to the viewDidAppear()-Method, which is called after the view becomes visible to the user.

Ben-G
  • 4,996
  • 27
  • 33