Skip to content

Commit

Permalink
Merge pull request #2 from dimohamdy/master
Browse files Browse the repository at this point in the history
support swift3
  • Loading branch information
Tinghui committed May 27, 2016
2 parents 4b8d993 + f6cd6ee commit 26f3cc1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Source/HUIPatternLockView.swift
Expand Up @@ -63,7 +63,7 @@ import Foundation
setLockViewNeedUpdate(needRecalculateDotsFrame: false)
}
}

//MARK: Callback Properties
public var drawLinePathWithContext: ((path: Array<CGPoint>, context: CGContextRef?) -> Void)? = nil {
didSet {
Expand Down Expand Up @@ -131,13 +131,14 @@ extension HUIPatternLockView {
let heightPerDots = dotsAreaHeight / CGFloat(numberOfRows)

var dotTag = 0
for (var row = 0; row < numberOfRows; row++) {
for (var column = 0; column < numberOfColumns; column++) {
for row in 0 ..< numberOfRows{
for column in 0 ..< numberOfColumns {
let dotCenter = CGPointMake(contentInset.left + (CGFloat(column) + 0.5) * widthPerDots ,
contentInset.top + (CGFloat(row) + 0.5) * heightPerDots)
contentInset.top + (CGFloat(row) + 0.5) * heightPerDots)
let dotFrame = CGRect(x: dotCenter.x - dotWidth * 0.5, y: dotCenter.y - dotWidth * 0.5,
width: dotWidth, height: dotWidth)
let dot = Dot(tag: dotTag++, frame: dotFrame, highlighted: false)
width: dotWidth, height: dotWidth)
let dot = Dot(tag: dotTag, frame: dotFrame, highlighted: false)
dotTag += 1
normalDots.append(dot)
}
}
Expand Down Expand Up @@ -191,7 +192,7 @@ extension HUIPatternLockView {
}
}

//draw highlighted dots
//draw highlighted dots
if let drawDotClosure = drawDotWithContext {
for dot in highlightedDots {
CGContextSaveGState(context)
Expand Down

0 comments on commit 26f3cc1

Please sign in to comment.