Skip to content

Commit

Permalink
changes made
Browse files Browse the repository at this point in the history
  • Loading branch information
Averylamp committed Apr 30, 2016
1 parent b581261 commit efdc54c
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions Avery Lamp/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,27 +192,36 @@ class HomeViewController: UIViewController {
let storyPath = UIBezierPath()

storyPath.moveToPoint(CGPointMake(20,64.9))
let storyPathPoints = [CGPointMake(20,64.9), CGPointMake(47.36, 80.12), CGPointMake(82.3, 39.9), CGPointMake(102.2, 51.02)]
let storyPathPoints = [CGPointMake(20,64.9), CGPointMake(43.36, 80.12), CGPointMake(64.83, 50.01), CGPointMake(82.3, 65.9), CGPointMake(102.2, 51.02)]

let p2 = storyPathPoints[0]
storyPath.moveToPoint(CGPointMake(p2.x, p2.y - 3))
storyPath.addArcWithCenter(p2, radius: 3, startAngle: CGFloat(M_PI * 3 / 2), endAngle: CGFloat(M_PI * 3 / 2 + 2 * M_PI), clockwise: true)
let pointArr = [CGPointMake(p2.x, p2.y - 5), CGPointMake(p2.x - 4, p2.y - 15), CGPointMake(p2.x, p2.y - 23), CGPointMake(p2.x + 4, p2.y - 15), CGPointMake(p2.x, p2.y - 5)]
storyPath.moveToPoint(pointArr[0])
for index in 1..<pointArr.count{
let p1 = pointArr[index]
storyPath.addLineToPoint(p1)
}
storyPath.moveToPoint(p2)

for index in 1..<storyPathPoints.count{
let p2 = storyPathPoints[index]
let p1 = storyPathPoints[index - 1]
let midpoint = midpointOfPoints(p1, secondPoint: p2)
storyPath.addQuadCurveToPoint(midpoint, controlPoint: controlPointForPoints(midpoint, p2: p1))
storyPath.addQuadCurveToPoint(p2, controlPoint: controlPointForPoints(midpoint, p2: p2))
}
for index in 0..<storyPathPoints.count {
let currentLoc = storyPathPoints[index]
storyPath.moveToPoint(CGPointMake(currentLoc.x, currentLoc.y - 3))
storyPath.addArcWithCenter(currentLoc, radius: 3, startAngle: CGFloat(M_PI * 3 / 2), endAngle: CGFloat(M_PI * 3 / 2 + 2 * M_PI), clockwise: true)
let pointArr = [CGPointMake(currentLoc.x, currentLoc.y - 5), CGPointMake(currentLoc.x - 4, currentLoc.y - 15), CGPointMake(currentLoc.x, currentLoc.y - 23), CGPointMake(currentLoc.x + 4, currentLoc.y - 15), CGPointMake(currentLoc.x, currentLoc.y - 5)]
storyPath.moveToPoint(CGPointMake(p2.x, p2.y - 3))
storyPath.addArcWithCenter(p2, radius: 3, startAngle: CGFloat(M_PI * 3 / 2), endAngle: CGFloat(M_PI * 3 / 2 + 2 * M_PI), clockwise: true)
let pointArr = [CGPointMake(p2.x, p2.y - 5), CGPointMake(p2.x - 4, p2.y - 15), CGPointMake(p2.x, p2.y - 23), CGPointMake(p2.x + 4, p2.y - 15), CGPointMake(p2.x, p2.y - 5)]
storyPath.moveToPoint(pointArr[0])
for index in 1..<pointArr.count{
let p1 = pointArr[index]
storyPath.addLineToPoint(p1)
}
storyPath.moveToPoint(p2)
}

let storyShape = CAShapeLayer()
storyShape.path = storyPath.CGPath
storyShape.strokeColor = UIColor.blackColor().CGColor
Expand All @@ -229,7 +238,7 @@ class HomeViewController: UIViewController {
let strokeAnimation = CABasicAnimation(keyPath: "strokeEnd")
strokeAnimation.fromValue = NSNumber(float: 0.0)
strokeAnimation.toValue = NSNumber(float: 1.0)
strokeAnimation.duration = 3.0
strokeAnimation.duration = 46.0
delay(1.5) {
infoShape.lineWidth = 1.0
appsShape.lineWidth = 1.0
Expand Down

0 comments on commit efdc54c

Please sign in to comment.