3 ms·
Obviously it depends heavily on what you're doing in your app and where that string is coming from. Is it a hard coded string that will never change? Force unw
by RandallBrown 7y ago
Obviously it depends heavily on what you're doing in your app and where that string is coming from.
Is it a hard coded string that will never change? Force unwrapping is probably appropriate.
Is it based on user input? Then you should probably tell the user the string they entered isn't a URL.
- saagarjha 7y agoRight, and in that case it's pretty clear how errors can occur and what you should do to handle it.