I was looking out for the error handling for rendering the Widgets(like UIButton, UIVIew etc) on the screen in iOS. I am painting the screen programmatically using swift.
Considering a simple Widget(like for say UIButton) when we try to create using its initializer and set some properties like 'setTitle' . These functions neither return any value upon success/failure nor in documentation they have mentioned about any exceptions which would be raised upon failure.
https://developer.apple.com/documentation/uikit/uibutton/settitle(_:for:)
So, how to do error handling here in this scenarios, in case the apis fail to due some reason, like memory issue? There must be some scenarios for these api failure.