Swift : Convert (cast) Int to int32 or Uint32
Problem :
How to convert (cast) Int to Int32 in Swift programming language ?
Solution :
Use the Int32() function to convert or cast the Int variable. For example :
let x : Int = 100
var x32 = Int32(x)
and
var xu32 = UInt32(x)
See also : Swift : Convert (cast) Int to String ?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7.4k Android Studio : Import third-party library or package into Gradle Scripts
+20.9k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."
+17.1k Golang : Find IP address from string
+7.1k Golang : Add build version and other information in executables
+20k Golang : Encrypt and decrypt data with TripleDES
+11.8k Python : Convert IPv6 address to decimal and back to IPv6
+41.1k Golang : Get hardware information such as disk, memory and CPU usage
+24.3k Golang : How to read integer value from standard input ?
+5.1k Golang : How to write backslash in string?
+3.2k Detect if Google Analytics and Developer Media are loaded properly or not
+9.8k Golang : Simple image viewer with Go-GTK
+16.2k Golang : How to make a file read only and set it to writable again?