ios - StringWithFormat "%.2ld" objc to swift -
I have a pickerView object in a fast project. I understand the code in Objective-C but I'm not sure How to implement it in swift
Objc method I'm not sure how to implement the Switch Statement for the Title ForRow function. Then the Can anyone help me out? Greetings, Dex You can continue using string with format , But the initiator names do little mating: Basically any Name as class
- (NSInteger) pickerView: (UIPickerView *) pickerView numberoffs ows Ingestion: (NSInteger) component {switch (component) {case 0: // week return 7; Case 1: // hour return 24; Default: // min 60; // or 7; (10 10) or / or 13; (5 5)}}
stringWithFormat: @ "% .2ld", (long) line is the problem. (NSString *) pickerView: (UIPickerView *) pickerView titleForRow: Earning for NSInteger: (NSInteger) Component {Switch (Component) {Case 0: // Week Return _DayFewike [ Line]; Case 1: // hour return [NSString stringWithFormat: @ "% .2ld", (long) line]; Default: // minutes back [NSString stringWithFormat: @ "% .2ld", (long) line]; // or, line * 10] // or, line * 5]}}
return NSString (format: "% .2ld", line)
{{class}} (XXXX: ...) is
[{{class}} {{class}} withXXXX: ...] / Code>
Comments
Post a Comment