Error while using property 'CGRectGetWidth', it says it was replaced with 'CGRect.width'

后端 未结 2 1702
孤城傲影
孤城傲影 2021-01-22 14:35

When I\'m using this code, I get an error:

let d = translation.x / CGRectGetWidth(pan.view!.bounds) * 0.5

\'CGRectGetWidth\' has

2条回答
  •  一生所求
    2021-01-22 14:57

    CGRectGetWidth has been removed in swift 3 and now you can get width directly

    let d = translation.x / (pan.view!.bounds.width) * 0.5
    

    hope its works..

提交回复
热议问题