i have constant string defined
#define knotificationmessage @"it's time take %@" in objective c use
[nsstring stringwithformat:knotificationmessage, medicinestring] as message uialertview . how achieve in swift
first create struct
struct astructconstants { static let samplestring : nsstring = nsstring(string: "check out learned %@ stackoverflow.") } var astring : nsstring = nsstring(format: astructconstants.samplestring, "some custom text") println(astring) your output be:
check out learned custom text stackoverflow.