ios - How to Declare Global Variable in Swift? -
this question has answer here:
- declaring global variables in swift 4 answers
i creating app in have declare constant global. in obj c use pch file don't know how define in swift? example
in obj c .pch file if declare
define red [uicolor redcolor]
then works through out application.
all need create constants.swift (or ever want name it) file , add ever constants need it.
let myvariable = "some value" let myothervariable = "something else" they available throughout application.
Comments
Post a Comment