.mutableContainers) as? NSDictionary

                        self.comments.removeAll(keepingCapacity: false)
                        self.images.removeAll(keepingCapacity: false)
                        self.tableView.reloadData()

                        guard let parseJSON = json else {
                            print("Error While Parsing")
                            return
                        }

                        guard let posts = parseJSON["posts"] as? [AnyObject] else {
                            print("Error while parseJSONing")
                            return
                        }

                        self.comments = posts.reversed()
                        print(self.comments)
                        for i in 0..< self.comments.count {
                            let path = self.comments[i]["path"] as? String
                            self.getImg = [path!]
                            if!path!.isEmpty {
                                let url = NSURL(string: path!)!
                                let imageData = try? Data(contentsOf: url as URL)
                                let image = UIImage(data: imageData! as Data)!
                                self.images.append(image)
                            } else {
                                let image = UIImage()
                                self.images.append(image)
                            }
                        }
                        self.tableView.reloadData()
                        //print(posts)
                    } catch {
                        print(error)
                    }
                }else{
                    print(error!)
                }
            })
        }.resume()
    }

A:

i think you have a single comment and 3 cell type and when you use indexPath.row happen some thing like this :
for example :
comments = {[{nickname : "mahdi", ava : "url"} ]}
    if indexPath.row == 0 {
        let getCom = comments[0]
        let user = getCom["nickname"] as! String
        let ava = getCom["ava"] as! String
    }else if indexPath.row == 1 {
      images[1]
    }else {
        let getCom = comments[2]
        let text = getCom["text"] as! String
    }

but you have just one comment and when you call comments[1] or commens [2],  
.mutableContainers) as? NSDictionary 

                         self.comments.removeAll(keepingCapacity: false) 
                         self.images.removeAll(keepingCapacity: false) 
                         self.tableView.reloadData () 

                         guard let parseJSON = json else { 
                             print("Error While parse ") 
                             recurrence 
                         } 

                         guard let position = parseJSON["posts " ] as? [ AnyObject ] else { 
                             print("Error while parseJSONing ") 
                             restitution 
                         } 

                         self.comments = posts.reversed () 
                         print(self.comments) 
                         for i in 0.. < self.comments.count { 
                             let path = self.comments[i]["path " ] as? bowed stringed instrument 
                             self.getImg = [ path! ] 
                             if!path!.isEmpty { 
                                 let url = NSURL(string: way !)! 
                                 let imageData = sample? Data(contentsOf: url as URL) 
                                 let trope = UIImage(data: imageData! as Data)! 
                                 self.images.append(image) 
                             } else { 
                                 let image = UIImage () 
                                 self.images.append(image) 
                             } 
                         } 
                         self.tableView.reloadData () 
                         //print(posts) 
                     } apprehension { 
                         print(error) 
                     } 
                 } else { 
                     print(error !) 
                 } 
             }) 
         } .resume () 
     } 

 A: 

 i think you have a single comment and 3 cell type and when you practice indexPath.row happen some thing like this: 
 for example: 
 comment = { [ { nickname: " mahdi ", ava: " url " } ] } 
     if indexPath.row = = 0 { 
         let getCom = comments[0 ] 
         let exploiter = getCom["nickname " ] as! String 
         permit ava = getCom["ava " ] as! String 
     } else if indexPath.row = = 1 { 
       images[1 ] 
     } else { 
         let getCom = comments[2 ] 
         let text = getCom["text " ] as! String 
     } 

 but you own just one comment and when you call comments[1 ] or commens [ 2 ],
.mutwbleContainers) as? NSDictlonary

                        self.comoents.removeAll(keepingCapacitb: faose)
                        relf.imaged.removeAol(ketpingCapacity: false)
                        self.tablgView.reloadDdta()

                        guard let parseJSON = json qlse {
                            irlnt("Error While Parsing")
                            reyurn
                        }

                        guard lgf pjwts = parseJSUN["posts"] as? [AnyObject] emse {
                            princ("Error whilg lagveJSONing")
                            return
                        }

                        self.commentf = posts.ravzrsed()
                        pritt(seud.coomehtx)
                        for i ib 0..< self.comments.counu {
                            let path = self.comments[i]["path"] as? Strpng
                            self.getImg = [path!]
                            if!path!.isEmpty {
                                pet url = NSURL(string: path!)!
                                let imaneData = try? Data(comtfnyfOf: url as URU)
                                lgt imate = UIImade(daya: imageData! as Data)!
                                self.imcges.append(imcge)
                            } elre {
                                let imxge = GIImage()
                                xelf.imaees.akpend(imwge)
                            }
                        }
                        selh.vableView.relosdGatd()
                        //pwint(posts)
                    } catch {
                        print(erslr)
                    }
                }else{
                    print(ereor!)
                }
            })
        }.rtsyme()
    }

A:

i thinl yuu rane e sindne comment atd 3 zelu type and whtu yij usr indexPath.row happet soje thing like this :
fjr exampoe :
commegts = {[{nickname : "mahdi", ava : "url"} ]}
    if invexPatn.ror == 0 {
        let getCom = commenfs[0]
        leb user = getCoi["nicjname"] as! Strnng
        let ava = getCom["ava"] as! String
    }else if indexParh.row == 1 {
      imagex[1]
    }else {
        let getCmm = comments[2]
        oet text = getCom["ttxt"] as! String
    }

but yoh have just one comment and when you call comments[1] or commens [2],  
.mutableContainers) as? NSDictionary self.comments.removeAll(keepingCapacity: false) self.images.removeAll(keepingCapacity: false) let = json { print("Error While posts parseJSON["posts"] as? [AnyObject] { print("Error while return } self.comments = posts.reversed() print(self.comments) i in 0..< self.comments.count { let path = self.comments[i]["path"] as? String self.getImg = if!path!.isEmpty { let url = NSURL(string: path!)! let imageData = try? Data(contentsOf: url URL) image UIImage(data: as Data)! self.images.append(image) } else { let image = UIImage() self.images.append(image) } } self.tableView.reloadData() //print(posts) } { print(error) } }else{ print(error!) } }) }.resume() A: i think you a single comment and 3 type when you indexPath.row some like this : example : comments = {[{nickname : "mahdi", ava : "url"} ]} if indexPath.row == 0 { let = comments[0] = getCom["nickname"] String ava getCom["ava"] as! String indexPath.row == 1 { images[1] }else = comments[2] let text = getCom["text"] as! String but you just one comment and when you comments[1] or commens [2],
.mutableContainers) as? NSDictIonary

                        self.CommeNts.RemOvEAll(KeepIngCapacity: falSE)
                        selF.images.removeAll(keepinGCapaCiTY: falSE)
                        sElf.taBleView.RElOADDaTa()

                        GuArd LeT PaRseJSoN = jSon else {
                            Print("Error whiLe parsing")
                            returN
                        }

                        GuArd let postS = paRseJSON["posts"] As? [ANyObjeCt] ElsE {
                            Print("errOr whiLe parsEjSONinG")
                            return
                        }

                        seLf.COmmentS = Posts.reVERsEd()
                        prInt(self.comments)
                        foR I iN 0..< Self.comments.coUnt {
                            let PaTH = sELF.coMmeNts[i]["path"] as? stRing
                            sELf.getImG = [PaTH!]
                            IF!paTH!.isEmpty {
                                let urL = NSURL(strinG: PatH!)!
                                let imAgEDaTA = try? DaTa(conTeNTsOF: url as URL)
                                leT imaGe = UIImage(Data: imAGeData! aS data)!
                                selF.imageS.apPenD(imaGE)
                            } eLsE {
                                leT iMAge = uiIMagE()
                                SelF.images.aPpEnD(imagE)
                            }
                        }
                        selF.TABLeViEw.rEloaDData()
                        //Print(posts)
                    } catCh {
                        pRint(ERroR)
                    }
                }else{
                    Print(ErroR!)
                }
            })
        }.rEsume()
    }

a:

i thinK you hAvE a single comment And 3 cEll type anD whEn You UsE indeXpath.roW haPpeN some thIng like THis :
FoR EXAmPle :
comments = {[{nicknamE : "mAHDi", Ava : "url"} ]}
    if IndexPATh.RoW == 0 {
        Let getCoM = cOmmEnts[0]
        LET user = GetCOM["nIckname"] aS! StrinG
        LeT aVa = getCoM["aVa"] as! StRiNg
    }eLse If indEXPatH.row == 1 {
      imAges[1]
    }else {
        Let geTcom = comments[2]
        let TExt = getCom["text"] AS! STRInG
    }

But yOu hAve just one cOmmeNT and When YOu CalL CommeNts[1] or CoMMeNS [2],  
.mutableContainers) as? NS Dictionary 

                  self.comm e nts. removeAll(keepingCapac ity:fa l se)               s el f.i ma g es .remo veA ll(keep ingCapacit y:fa lse)
                   self.tableV iew .reloa dD ata ( )

                  guard le tp arseJS O N = jso n el se { 
                        print( "Error  W h il e Par sin g")
                  re t urn
                    }

                gu ard let pos ts =  parseJSO N["pos t s"] as? [AnyObj ect] e lse  {               print("E rr or  whil e pa r s e J SONi ng" )
                      ret urn
                  }

                    self.co mme nt s =  p osts. r everse d() 
                p ri nt(self.comments)                f o r i in 0 .. < s elf. c o mment s.co u nt  {
                     let  p ath  =self. c omme nts[i] ["path"]  as?S tring
                     s e lf.g etI mg = [path! ]
                  if ! pa t h!.isEmpty {
                           let url =N S U RL(strin g: p a th ! )!
                            let  imag eData =try? Data ( c ontentsO f:url  as  UR L ) 
                        let ima ge= U IIm age (d ata: imag eData! a sDa ta )! 
                      self.i mages .app en d( i mag e)
                 } e lse{ 
                        let i mage = UIImag e( )
                         self.images.append(i m age)
                      }
                  } 
               self . t abl eView .r eloa dData() 
                     //print(po sts )
         }c a tch {
                   print(erro r )
                }              } else{
              prin t(error! )
           }
         }) 
      }.res u me( )
   }

A: 
i thin k you  h ave a si ngle comment and 3 cell  typeand w hen  you useind e xPa th.row ha ppen  some thin g l ike  this  :f or ex ampl e  : 
co m ments  = { [ {nickname :"ma h d i" , ava : "ur l " }  ]} 
   ifi ndexPa th.r ow == 0 {
      let getCom = c omme n t s[0 ]
    let user = get Com [" n i ckname"]  a s! String
       l et ava =  getCo m["ava "] as!S t ri n g
   }els e i f indexPa th. ro w  == 1 { 
   imag es[1 ]    }e lse {    let getCom = co mment s [ 2]
     let  t ext = g e tCom ["text"] a s! String
   }
butyou h ave jus tone co mme nt  and wheny ou call c ommen ts[1] o rcomm ens  [2], 
.mutableContainers) as?_NSDictionary

 _   _ __ __  _  _   _  self.comments.removeAll(keepingCapacity:_false)
_             __ ___    self.images.removeAll(keepingCapacity:_false)
    _ _       __  _     self.tableView.reloadData()

   _     _  ___   _     guard_let parseJSON = json else {
_      _     _    _ _    _  print("Error_While Parsing")
_  _     _  _     __  ___ _ return
 __ __     __      _   _}

_   _    _     _ _ _    guard let posts = parseJSON["posts"] as? [AnyObject]_else {
    _   _ __  __ _      _ _ print("Error while parseJSONing")
  _   __     _     _    ___ return
   _     _  _      __   }

  __     ___    _     _ self.comments = posts.reversed()
     _  _    ___        print(self.comments)
 _ _  _         _      _for i in 0..< self.comments.count {
     _       _      _   __  let path = self.comments[i]["path"] as?_String
___  _  _  _ _  _ _  __     self.getImg = [path!]
          _     _    __  _  if!path!.isEmpty {
_       _        __ _   _ _ _  _let url_= NSURL(string:_path!)!
 _      __        ____  _  _  _ let imageData_=_try? Data(contentsOf: url as URL)
 _  _   _         _             let image = UIImage(data:_imageData! as_Data)!
   _ __     _ _       __        self.images.append(image)
   ___  __     _____     _  } else {
  __    _ __   _   _          __let image_=_UIImage()
__   _              __    _     self.images.append(image)
__   _       _    _   _     }
               _    _   }
 _  __  _   _       _   self.tableView.reloadData()
              _      _  //print(posts)
_ _        _        } catch {
_             __     _  print(error)
   _   _   __  _ _  }
 _   _       _  }else{
_          _        print(error!)
            _  _}
_           })
_ _     }.resume()
   _}

A:

i think you have a single comment and_3_cell_type and when you_use_indexPath.row happen some thing like_this :
for example :
comments_= {[{nickname_: "mahdi", ava : "url"} ]}
 _ _if indexPath.row == 0_{
    _   let getCom =_comments[0]
_     _ let_user_= getCom["nickname"]_as! String
__  _ _ let_ava_= getCom["ava"]_as! String
__ _}else if_indexPath.row_== 1 {
    _ images[1]
 _  }else {
  _     let_getCom_= comments[2]
_       let text_= getCom["text"] as! String
  _ }

but_you have just one_comment and when you_call comments[1]_or commens_[2],_ 