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
+13.9k Javascript : Prompt confirmation before exit
+5.2k Golang : Reclaim memory occupied by make() example
+40.1k Golang : Convert to io.ReadSeeker type
+14.2k Golang : Recombine chunked files example
+7.5k Golang : Error reading timestamp with GORM or SQL driver
+5k Golang : Issue HTTP commands to server and port example
+7.2k Golang : Accessing dataframe-go element by row, column and name example
+14.3k Golang : On enumeration
+8.6k Golang : How to join strings?
+28.3k Golang : Change a file last modified date and time
+29.2k Golang : Saving(serializing) and reading file with GOB
+32.1k Golang : Math pow(the power of x^y) example