How can I declare a variable to change the font?
The compiler indicates that it must be type CGFont.
so:
var typeFont: CGFont //but I don't know how to initialize
How is the correct way to give an initial value?
Thanks
You can do this:
var myFont = CGFont(UIFont(name: "Helvetica", size: 22.0)!.fontName as CFString)
See more details here: https://stackoverflow.com/questions/26035041/converting-uifont-to-cgfont-in-swift