on 29/9/23.
//
import UIKit
import SnapKit
class FollowersViewController: UIViewController {
private let contentView = FollowersView()
override func viewDidLoad() {
super.viewDidLoad()
setupView()
addTargets()
}
func setupView() {
view.addSubview(contentView)
navigationController?.navigationBar.isUserInteractionEnabled = false
contentView.snp.makeConstraints{ make in
make.edges.equalToSuperview()
}
}
func addTargets() {
contentView.followersButton.addTarget(self, action: #selector(followersPressed), for: .touchUpInside)
contentView.followingButton.addTarget(self, action: #selector(followingPressed), for: .touchUpInside)
contentView.pendingButton.addTarget(self, action: #selector(pendingPressed), for: .touchUpInside)
}
@objc func followersPressed() {
contentView.underlineOne.isHidden = false
contentView.underlineTwo.isHidden = true
contentView.underlineThree.isHidden = true
print("1")
}
@objc func followingPressed() {
contentView.underlineOne.isHidden = true
contentView.underlineTwo.isHidden = false
contentView.underlineThree.isHidden = true
print("2")
}
@objc func pendingPressed() {
contentView.underlineOne.isHidden = true
contentView.underlineTwo.isHidden = true
contentView.underlineThree.isHidden = false
print("3")
}
}
Скрином кидайте
Обсуждают сегодня