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
+5.3k Unix/Linux/MacOSx : How to remove an environment variable ?
+13.8k Golang : convert(cast) string to float value
+5.1k Golang : Experimental Jawi programming language
+36.3k Golang : Save image to PNG, JPEG or GIF format.
+7.6k Golang : get the current working directory of a running program
+4.6k Adding Skype actions such as call and chat into web page examples
+14.1k Golang : syscall.Socket example
+15.1k Golang : How to check if IP address is in range
+18.3k Golang : How to get hour, minute, second from time?
+6.1k Golang : How to write backslash in string?
+18.5k Golang : Send email with attachment
+19.8k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it