Skip to content

Commit

Permalink
more minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mattneub committed Aug 29, 2016
1 parent 94405e1 commit 23dbdf3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Expand Up @@ -45,11 +45,11 @@ class MyParentViewController : UIViewController {
scvc.view.frame = self.view.bounds
scvc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.view.addSubview(scvc.view)
let sb = searcher.searchBar
sb.translatesAutoresizingMaskIntoConstraints = false
sb.sizeToFit()
sb.autocapitalizationType = .none
scvc.view.addSubview(sb)
let b = searcher.searchBar
b.sizeToFit()
b.autoresizingMask = [.flexibleWidth]
b.autocapitalizationType = .none
scvc.view.addSubview(b)


// hmm, this actually causes presentation and I can't seem to prevent it
Expand Down
Expand Up @@ -127,7 +127,7 @@ class RootViewController : UITableViewController, UITextFieldDelegate {
[IndexPath(row:ct-2, section:1)],
with:.automatic)
tableView.endUpdates()
// crucial that this next bit be *outside* the update block
// crucial that this next bit be *outside* the updates block
let cell = self.tableView.cellForRow(at:
IndexPath(row:ct-1, section:1))
(cell as! MyCell).textField.becomeFirstResponder()
Expand Down
Expand Up @@ -83,8 +83,13 @@ class RootViewController : UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let h = tableView
.dequeueReusableHeaderFooterView(withIdentifier:"Header") as! MyHeaderView
if h.viewWithTag(1) == nil {

if h.gestureRecognizers == nil {
print("nil")
// add tap g.r.
let tap = UITapGestureRecognizer(target: self, action: #selector(tapped)) // *
tap.numberOfTapsRequired = 2 // *
h.addGestureRecognizer(tap) // *

h.backgroundView = UIView()
h.backgroundView?.backgroundColor = .black
let lab = UILabel()
Expand All @@ -111,10 +116,6 @@ class RootViewController : UITableViewController {
"V:|[lab]|",
metrics:nil, views:["lab":lab])
].flatMap{$0})
// add tap g.r.
let tap = UITapGestureRecognizer(target: self, action: #selector(tapped)) // *
tap.numberOfTapsRequired = 2 // *
h.addGestureRecognizer(tap) // *
}
let lab = h.contentView.viewWithTag(1) as! UILabel
lab.text = self.sectionNames[section]
Expand Down

0 comments on commit 23dbdf3

Please sign in to comment.