CopyPastor

Detecting plagiarism made easy.

Score: 0.8021096587181091; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2022-09-02
by Yodagama

Original Post

Original - Posted on 2019-06-13
by caleb81389



            
Present in both answers; Present only in the new answer; Present only in the old answer;


```swift List { ForEach(cards) { section in let header: String = nameForSectionHeader(sectionID: section.id) Section(header: Text(header)) { ForEach(section) { card in NavigationLink(destination: CardView(card: card)) { VStack(alignment: .leading) { if let name = card.name, let id = card.cardID { Text("\(id) - \(name)") } if let set = card.set, let setName = set.name { Text("Set: \(setName)") } if card.owned > 0 { Text("Owned: \(card.owned)") } } } .listRowBackground(card.owned > 0 ? Color.red : Color.blue) // <= here } } } .listRowBackground(lightGreen) ```
Someone may find this useful if attempting to create a floating type cell with SwiftUI using `.listRowBackground` and applying `.padding`
var body: some View { NavigationView { List { ForEach (site) { item in HStack { Text(String(item.id)) VStack(alignment: .leading) { Text(item.name) Text(item.crop[0]) }
}.listRowBackground(Color.yellow) .padding(.trailing, 5) .padding(.leading, 5) .padding(.top, 2) .padding(.bottom, 2)) } } .navigationBarTitle(Text("Locations")) } }

        
Present in both answers; Present only in the new answer; Present only in the old answer;