Posts

Post marked as solved
5 Replies
3.3k Views
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]
Posted
by jsslai.
Last updated
.
Post not yet marked as solved
12 Replies
6.6k Views
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.
Posted
by jsslai.
Last updated
.
Post not yet marked as solved
2 Replies
1k Views
Is it possible to show text with custom font in previews? Custom font works fine when I run the app but preview doesn't show it but instead it shows text with system font.
Posted
by jsslai.
Last updated
.