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
+11.7k Golang : Convert(cast) float to int
+6.6k Golang : Spell checking with ispell example
+18k Golang : How to make a file read only and set it to writable again?
+20.3k Golang : Compare floating-point numbers
+26.4k Golang : Calculate future date with time.Add() function
+36.7k Golang : Save image to PNG, JPEG or GIF format.
+17.7k Golang : Upload/Receive file progress indicator
+18k Golang : Defer function inside init()
+16.1k Golang : How to reverse elements order in map ?
+13.6k Golang : Strings comparison
+10.4k Golang : Convert file content to Hex
+34.2k Golang : Create x509 certificate, private and public keys