xcode - "Right way" to add attributes to all numbers in NSMutableAttributedString -



xcode - "Right way" to add attributes to all numbers in NSMutableAttributedString -

is way add together attributes numbers in nsmutableattributedstring?

let reg: nsregularexpression = nsregularexpression(pattern: "\\d+", options: nil, error: nil)! reg.enumeratematchesinstring(str, options: nil, range: nsmakerange(0, str.length)) { (result, _, _) -> void in paragraph.addattribute(attributename, value: attributevalue, range: result.range) }

or maybe should done in other way? i'm totaly new xcode (comming "php world") want create sure i'm doing things in swift should.

xcode cocoa swift

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -