如何从Swift中的两个struct数组中删除常用项

The*_*ook 1 ios swift

在我的应用程序中,我有两个struct数组,我想从其中一个中删除常用项.我的结构:

struct PeopleSelectItem {
    var name = ""
    var id = ""
    var added = false
}
Run Code Online (Sandbox Code Playgroud)

我的阵列:

var people : [PeopleSelectItem] = []
var selectedPeople : [PeopleSelectItem] = []
Run Code Online (Sandbox Code Playgroud)

我想从people数组中删除项目(如果它们存在(通过id比较)在selectedPeople数组上).

我尝试了几个数组过滤和转换设置,但没有一个工作.我能在这做什么?

谢谢!

vad*_*ian 7