I found this answer to generate random bytes in Swift.
Since result
can also have another value than errSecSuccess
I wonder in what instance this function would ever fail.
I am strongly thinking about force-unwrapping the return type there because it would be tedious to check for empty data each time it's used. What prevents me from doing just that is that I run this function on app launch and of course having the app crashed on first launch is not very favorable.
Is it safe to assume that this function never fails (at least it never did for me) or are there one-in-a-million cases where this can actually happen so safeguarding it with a retry button would be strongly advised?