This is really strange. I have a scrollview that contains a three images, and the user swipes to see the next image. However, I want the first screen to start at the middle imag
You should not initialise UI geometry-related things in viewDidLoad, because the geometry of your view is not set at this point and the results will be unpredictable.
As you have discovered, viewWillAppear is the correct place to do these things, at this point the geometry is set so getting and setting geometry-related properties makes sense.
viewDidAppear.
update (ios6)
When using autolayout in ios6, frames are not set until subviews have been laid out. The right place to get frame data under these conditions is in the viewController method -viewDidLayoutSubviews.
This is called after -viewWillAppear. But take care - they are not always called together. For example, -viewWDidLayoutSubviews is called after a rotation, -viewWillAppear is not. -viewWillAppear is called every time a view becomes the visible view*, -viewDidLayoutSubviews not necessarily (only if us views needed relaying out).
(* unless the app was backgrounder and is becoming foreground app, then -viewWillAppear is not called)