SplitRow icon indicating copy to clipboard operation
SplitRow copied to clipboard

Solving the warning

Open 368433 opened this issue 7 years ago • 4 comments

Hello, Thank you for the SplitRow code. I get an xcode warning (acknowledged in the code): Cast from 'RowOf<SplitRowValue<L.Cell.Value, R.Cell.Value>>!' to unrelated type '_SplitRow<L, R>' always fails

Is there a way to solve this warning as it is distracting and it is harder to tell if there are other warnings that deserve our attention. Thanks

368433 avatar Apr 19 '18 22:04 368433

This warning is a compiler issue as the casting obviously works. I am not sure if a radar has been filed with Apple.

I don't think we can work around casting the row.

mats-claassen avatar Jun 05 '18 12:06 mats-claassen

Hi, how it's posible the same SplitRow but with three elements? maybe like left, center and right. I need some like this: Quantity | Description | Type in same row

Thanks

pilloom avatar Feb 18 '19 06:02 pilloom

@pilloom using three rows is not supported by SplitRow. I suggest to build your own custom row specific to your use case. For this, please have a look at the Eureka custom row documentation.

In addition, having a look at the already existing custom rows with multiple input fields serving a specific purpose may jump start your development (e.g.: CreditCardRow or PostalAddressRow).

Good luck!

marbetschar avatar Feb 18 '19 08:02 marbetschar

the warning is correct, surely you just need to rewrite the line to say something like

`
let row = cast_nice(row: self.row) 
func cast_nice(row: RowOf<SplitRowValue<L.Cell.Value, R.Cell.Value>>) -> _SplitRow<L, R>{
      //Cast from 'RowOf<SplitRowValue<L.Cell.Value, R.Cell.Value>>?' to unrelated type '_SplitRow<L, R>' always fails
    // then something like (from here on in I am making this up)
    let rtn : _SplitRow<L, R> = _SplitRow<L, R>()
    rtn.setL = row.L
    rtn.setR = row.R
    return rtn
}		
`

Coners avatar Jun 25 '19 12:06 Coners