I've been careful to declare variables with "Int64 for integers whose values can be big, Int for integers that don't", but depending on the execution environment, such consideration is unnecessary. , Is the story.
Prerequisite environment for this article: ・ IOS 11 or later ・ Swift 5
As a background to the consideration at the beginning, This is because the maximum and minimum values of Int have the characteristic that ** "the execution environment differs depending on whether it is 32bit or 64bit", and the range is narrow if it is 32bit **.
|Type||Maximum value||minimum value|
(Execution environment depends on 32bit or 64bit)
So, in the 32-bit environment Int, for example, if the value to be handled is the amount (yen), the maximum value is 2,147 million yen, so in the case of a celebrity, the application may crash.
However, if you think about it, the app I'm currently working on can only be used on iPhones with iOS 11 or later.
After checking, it seems that ** iOS 11 or later does not have a 32-bit execution environment **.
That means that if the app supports only iOS 11 or later, there is no point in using Int and Int64 properly **, so the consideration at the beginning was unnecessary.