Skip to content

Commit

Permalink
Refactor function slotViewsAtRect(_:) to slotViews(atRect:)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Szklarek committed Jul 21, 2017
1 parent 8433df0 commit 4796bfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension GameBoardView {
return slotViews.filter { $0.circleView == circleView }.first
}

func slotViewsAtRect(_ rect: CGRect) -> [GameBoardSlotView] {
func slotViews(inRect rect: CGRect) -> [GameBoardSlotView] {
var array = [GameBoardSlotView]()
for slotView in slotViews {
let frame = slotView.convert(slotView.bounds, to: self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension GameBoardView {
let slotLocationFrom = SlotLocation(column: slotView.column, row: slotView.row)

guard let delegate = delegate else { return }
let targetSlotViews = slotViewsAtRect(dragger.view.frame)
let targetSlotViews = slotViews(inRect: dragger.view.frame)
for targetSlotView in targetSlotViews {
let slotLocationTo = SlotLocation(column: targetSlotView.column, row: targetSlotView.row)
if delegate.gameBoardViewCanMoveCircle(fromLocation: slotLocationFrom, toLocation: slotLocationTo) {
Expand Down

0 comments on commit 4796bfc

Please sign in to comment.