let headerView = UIView.instantiate(CityChooseSection.self)
headerView.foldButton.tag = section
headerView.configure(with: twoDimensionalArray[section].country)
headerView.delegate = self
return headerView
let headerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: 50))
headerView.backgroundColor = .lightGray
let country = UILabel(frame: CGRect(x: 0, y: 0, width: 100, height: 50))
country.text = twoDimensionalArray[section].country
country.textAlignment = .center
country.backgroundColor = .cyan
country.width(100)
let button = UIButton(type: .system)
button.frame = CGRect(x: 0, y: 0, width: 100, height: 50)
button.setImage(UIImage(named: "naviBtnBackB"), for: .normal)
button.setImage(UIImage(named: "cursor"), for: .selected)
button.backgroundColor = .clear
button.tintColor = .black
button.width(50)
button.height(50)
button.addTarget(self, action: #selector(handleExpandClose), for: .touchUpInside)
button.tag = section
headerView.addSubview(country)
headerView.addSubview(button)
let underline = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: 1))
headerView.addSubview(underline)
underline.backgroundColor = .black
country.leadingToSuperview()
country.centerYToSuperview()
button.trailingToSuperview()
button.centerYToSuperview()
underline.height(1)
underline.trailingToSuperview()
underline.leadingToSuperview()
underline.bottomToSuperview()
return headerView