Post

Replies

Boosts

Views

Activity

NSNumberFormatter whitespace
I'm trying to remove all the whitespaces from the NSNumberFormatter string. It seems it adds Unicode 160 as a whitespace instead of Unicode 32 and then String's stringByReplacingOccurrencesOfString doesn't work. Is this correct behavior and how should I remove the whitespaces?let formatter = NSNumberFormatter() formatter.locale = NSLocale(localeIdentifier: "fi") formatter.numberStyle = .CurrencyStyle formatter.currencyCode = "EUR" formatter.currencySymbol = "" let value = formatter.stringFromNumber(1234) ?? "" //"1 234,00 " let trimmed = value.stringByReplacingOccurrencesOfString(" ", withString: "") // "1 234,00 " let chars = value.utf16.map { $0 } chars // [49, 160, 50, 51, 52, 44, 48, 48, 160]
5
0
3.6k
Sep ’15
XCUIElementQuery cells
I'm testing how many cells exists in collection view. I have following steps:1. Load collection view with 4 items and show them in small cell with "smallCell" reuse identifier2. Reload collection view with 2 items and show them in big cell with "bigCell" reuse identifier.After that XCUIApplication().collectionViews.count returns 6 elements (4 small cells and 2 big cells). Is this expected behavior? I would also like to know what elements are returned when calling XCUIElementQuery. Visible cells in collection view? I'm using Xcode 7 beta 5.
12
0
7k
Aug ’15