private let sections: [(title: String, description: String)] = [(title: "title1", description: "description1"), (title: "title2", description: "description2")]
cell.titleLabel?.text = self.sections[(indexPath as NSIndexPath).row].title
cell.descriptionLabel?.text = self.sections[(indexPath as NSIndexPath).row].description
public class Section {
private String title;
private String description;
public Section(String title, String description) {
setTitle(title);
setDescription(description);
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
List<Section> sections = new ArrayList<>();
sections.add(new Section("title1", "description1"));
sections.add(new Section("title2", "description2"));
@Getter
@Setter
@AllArgsConstructor
public class Data {
private String title;
private String description;
}
private List<Data> sections = new ArrayList<>();
sections.add(new Data("title1", "description1"));
sections.add(new Data("title2", "description2"));