2017-12-14 3 views

答えて

1

私は細胞のあなたのXの数は、この場合のセクションの数になり、セルのN数は、そのセクション内の行数となりますので、あなたは、セクションとテーブルビューを使うべきだと思います。

//MARK: TableView Delegate 
    func numberOfSections(in tableView: UITableView) -> Int { 
     return X 
    } 
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 
     let cell = tableView.dequeueReusableCell(withIdentifier: "YourIdentifier") as? YourTableViewCell 
     return cell 

    } 

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 
     return numberOfRows 
    } 

希望が必要です。

+0

問題は、私は、Xセルに関連するサブテーブルビュー内の異なるセクションに関連する異なるセルを表示する必要があります。 これは私が作りたいデザインです。 https://i.stack.imgur.com/quy1H.png –