EurekaCommunity / SplitRow

A row for Eureka to put two rows side by side into the same UITableViewCell
MIT License
56 stars 27 forks source link

Solving the warning #15

Open 368433 opened 6 years ago

368433 commented 6 years ago

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

mats-claassen commented 6 years ago

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.

pilloom commented 5 years ago

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

marbetschar commented 5 years ago

@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!

Coners commented 5 years ago

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
}       
`