Add one ZStack . Since we’ll become looping and creating all of our notes, we desire these to end up being one in addition various other. The way that it works, but is the fact that last card inside the selection is on best with id: 9 .
Per to iterate more than our users, each developed view in ForEach demands an ID . We can inherit the Hashable protocol for our user, and this allows us to use the \.self right here (that will be merely each consumer within array). The Hashable makes certain each object is unique. Alternatively, you could potentially not carry out the Hashable protocol and simply create \.self.id , which may match each user’s ID that’s special for each and every case for the consumer object. Lees verder