Привет, у меня следующий ответ
json: {
"status" : "success",
"data" : {
"classes" : {
"SUNDAY" : [
{
"latitude" : 32.3844785674545,
"uploads" : "https:\/\/xxxxx\/Uploads\/Class\/swimming.png",
"location" : "dubai",
"id" : 3,
"startDate" : "04-08-2018",
"endDate" : "05-08-2018",
"description" : "Basic Swimming Tactics for women trained by women.",
"title" : "Swimming Class",
"endTime" : "05:20",
"longitude" : 23.465767967087778,
"startTime" : "03:10",
"subTitle" : "Basic Swimming Tactics"
}
],
"WEDNESDAY" : [
],
"THURSDAY" : [
],
Я уже получил данные в виде таблицы, вручную вызвав определенный день.
, как показано ниже.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return tableViewImageArray.count
return classes.count
}
// Table View Delegates
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let tCell = tableView.dequeueReusableCell(withIdentifier: "schedulesCell", for: indexPath) as! schedulesTVCell
// tCell.classThumb.image = tableViewImageArray[indexPath.row]
// tCell.classTitle.text = classNameArray[indexPath.row]
let allClasses = classes[indexPath.row]
tCell.classTitle.text = allClasses.title
tCell.classDesc.text = allClasses.description
tCell.classLocation.text = allClasses.location
let cImgUrl = allClasses.uploadURL
//make the thumb image round
tCell.classThumb.layer.borderWidth = 1
tCell.classThumb.layer.masksToBounds = false
tCell.classThumb.layer.borderColor = UIColor.lightGray.cgColor
tCell.classThumb.layer.cornerRadius = tCell.classThumb.frame.height/2
tCell.classThumb.clipsToBounds = true
Alamofire.request(cImgUrl).responseData(completionHandler: { response in
if let image1 = response.result.value {
self.thumbImage = UIImage(data: image1)!
tCell.classThumb.image = self.thumbImage
print("IMG", self.thumbImage! )
}
})
return tCell;
}
Я просто хочу загрузить просмотр таблицы в соответствии с днями, которые я щелкнул между определенным диапазоном дат (startDate и EndDate).в следующем представлении таблицы ниже.
Пожалуйста, помогите мне, предоставив ясный пример (полный код создан) в соответствии с моим ответом, поскольку я никогда не реализовывал FSCalander.
Заранее спасибо.