Skip to content

Instantly share code, notes, and snippets.

@ConorBrady
Last active April 26, 2017 10:41
Show Gist options
  • Save ConorBrady/6f947aef78891c233bfb73e9454dc75c to your computer and use it in GitHub Desktop.
Save ConorBrady/6f947aef78891c233bfb73e9454dc75c to your computer and use it in GitHub Desktop.
class MyView: UIView {
let tableView = UITableView(frame: .zero, style: .plain) <== {
$0.backgroundColor = .clear
$0.separatorStyle = .none
$0.contentInset = UIEdgeInsets(top: 15, left: 0, bottom: 15, right: 0)
$0.register(TableCell.self, forCellReuseIdentifier: "TableCell")
}
let textField = UITextField() <== {
$0.placeholder = "Placeholder"
$0.borderStyle = .none
$0.backgroundColor = .white
$0.returnKeyType = .send
$0.rightViewMode = .always
$0.leftViewMode = .always
}
let button = UIButton() <== {
$0.setImage(UIImage(named: "Button"), for: .normal)
$0.contentMode = .center
$0.frame = CGRect(x: 0.0, y: 0.0, width: 35, height: 25)
$0.layer <== {
$0.shadowOpacity = 0.2
$0.shadowOffset = CGSize(width: 0, height: 2)
$0.shadowRadius = 2
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment