Could you show the complete code so that we can better understand what happens (it would even be better to have a reproductible example) ?
Maybe self in self.view.frame.size.width is just referring to the parent view and not settingsView.
You could also try
const int viewWidth = settingsView.view.frame.size.width;
or get the width in the completion handler, to be sure you refer to the correct object.
Topic:
UI Frameworks
SubTopic:
UIKit