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
+9.7k Golang : How to generate Code 39 barcode?
+7.1k Golang : Validate credit card example
+10.1k Golang : Test a slice of integers for odd and even numbers
+6.6k Golang : Warp text string by number of characters or runes example
+4.6k JavaScript : Rounding number to decimal formats to display currency
+10.9k Golang : Get UDP client IP address and differentiate clients by port number
+10.7k Golang : Get local time and equivalent time in different time zone
+24.5k Golang : Change file read or write permission example
+7.8k Golang : Scan files for certain pattern and rename part of the files
+19.6k Golang : Close channel after ticker stopped example
+22.7k Generate checksum for a file in Go
+30.9k error: trying to remove "yum", which is protected