无故事王国
2023-06-28 a56ff03fc62bb894160f9b71fc54f66e77e48712
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
//  CourseExerciseSubListVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/27.
//
 
import UIKit
import QMUIKit
 
class CourseExerciseSubListVC: BaseVC {
 
    @IBOutlet weak var view_topView: UIView!
    @IBOutlet weak var btn_assign: QMUIButton!
    @IBOutlet weak var tableView: UITableView!
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "课后练习"
    }
 
    override func setUI() {
        btn_assign.imagePosition = .right
        btn_assign.spacingBetweenImageAndTitle = 5
 
        tableView.register(UINib(nibName: "CourseExerciseTCell", bundle: nil), forCellReuseIdentifier: "_CourseExerciseTCell")
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
    }
 
 
    @IBAction func assignAction(_ sender: QMUIButton) {
        guard !sender.isSelected else {return}
        sender.isSelected = true
        CourseSubTypeView.show(inView: self.view, afterView: view_topView, items: ["足球课程","篮球课程","羽毛球课程","网球课程"]) { str in
            sender.isSelected = false
 
        } closeClouse: {
            sender.isSelected = false
        }
    }
}
 
extension CourseExerciseSubListVC:UITableViewDelegate{
 
}
 
extension CourseExerciseSubListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_CourseExerciseTCell") as! CourseExerciseTCell
        return cell
    }
 
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 5
    }
}