Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGPathMoveToPoint deprecated in Swift 3 #2

Open
raheelsadiq opened this issue Sep 19, 2016 · 2 comments
Open

CGPathMoveToPoint deprecated in Swift 3 #2

raheelsadiq opened this issue Sep 19, 2016 · 2 comments

Comments

@raheelsadiq
Copy link

CGPathMoveToPoint have been deprecated in Swift 3, how to fix/style these paths

var menuPath : CGPath {
    let path = CGPathCreateMutable()
    CGPathMoveToPoint(path, nil, thickness / 2, thickness / 2)
    CGPathAddLineToPoint(path, nil, lineWidth - thickness / 2, thickness / 2)
    return path
}

var sidePath: CGPath {
    let path = CGPathCreateMutable()
    CGPathMoveToPoint(path, nil, 0, self.bounds.height / 2)
    CGPathAddLineToPoint(path, nil, self.bounds.width, self.bounds.height/2)
    return path
}
@raheelsadiq
Copy link
Author

Sovled it like this

var menuPath : CGPath {
    let path = CGMutablePath()

    path.move(to: CGPoint(x: thickness/2, y: thickness/2))
    path.addLine(to: CGPoint(x: lineWidth - thickness, y: thickness/2))

    return path
}

var sidePath: CGPath {
    let path = CGMutablePath()

    path.move(to: CGPoint(x: 0, y: self.bounds.height / 2))
    path.addLine(to: CGPoint(x: self.bounds.width - thickness, y: self.bounds.height/2))

    return path
}

@xpams
Copy link

xpams commented Sep 19, 2017

look please my fork
https://github.com/xpams/Hamburger-Menu-Button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants