Skip to content

Commit

Permalink
Merge pull request #5 from thinkrad/master
Browse files Browse the repository at this point in the history
Implement initWithCoder so record button can be used from a storyboard
  • Loading branch information
samuelbeek authored Feb 22, 2017
2 parents a713603 + 3f2d17d commit 25d052b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Pod/Classes/RecordButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@
}

required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: aDecoder)

self.addTarget(self, action: #selector(RecordButton.didTouchDown), for: .touchDown)
self.addTarget(self, action: #selector(RecordButton.didTouchUp), for: .touchUpInside)
self.addTarget(self, action: #selector(RecordButton.didTouchUp), for: .touchUpOutside)

self.drawButton()
}


Expand Down
8 changes: 7 additions & 1 deletion RecordButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: aDecoder)

self.addTarget(self, action: #selector(RecordButton.didTouchDown), for: .touchDown)
self.addTarget(self, action: #selector(RecordButton.didTouchUp), for: .touchUpInside)
self.addTarget(self, action: #selector(RecordButton.didTouchUp), for: .touchUpOutside)

self.drawButton()
}


Expand Down

0 comments on commit 25d052b

Please sign in to comment.