Post

Replies

Boosts

Views

Activity

Comment on Multilevel Array Appending
I got two errors. Both on the guard let line. First error was "Cannot convert value of type 'String' to expected argument type 'Plan'". I fixed this by changing the type of plan name from String to Plan. The second error was "Referencing instance method 'firstIndex(of:)' on 'Collection' requires that 'Plan' conform to 'Equatable'". I added Equatable to the Plan Model but wasn't sure what protocol stubs should be.
Jun ’23
Comment on Multilevel Array Appending
The function looks good but since I'm using a UUID for the plan id instead of an Int, I am unable to give it a value when I call it in my view. Is it possible to have planIndex take a UUID instead of an Int? I tried switching the plan id to and Int but would just cause different errors.
Jun ’23