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
+12.4k Python : Convert IPv6 address to decimal and back to IPv6
+9k Golang : Extract or copy items from map based on value
+15.8k Golang : Get IP addresses of a domain name
+9.5k Golang : Setting variable value with ldflags
+4.2k MariaDB/MySQL : How to get version information
+4.5k HTTP common errors and their meaning explained
+40.9k Golang : Convert string to array/slice
+8.3k Golang : Gorilla web tool kit schema example
+11.2k Get form post value in Go
+8.3k Golang : Random integer with rand.Seed() within a given range
+36.6k Upload multiple files with Go