Code:

    func removeSkill(skill:DiSkillV2) {
        for i in 0...dClasses.count - 1{
            if dClasses[i] === skill{
                dClasses.remove(at: i)
                break
            }
        }
    }

=== checks if it's the same actual object.
this is a work around because swift list only has a remove(at index) method.

!== checks is it's not the same object.

in this code snippet dClasses is an arraylist of objects

FRspeaker40x40