How to simplify a single complex UIBezierPath polygon in iOS

后端 未结 3 1660
心在旅途
心在旅途 2020-12-17 01:40

Problem:

I have a user generated polygon (via registering user\'s touches on screen) which can be simple or complex (complex means having unknown number of intersect

3条回答
  •  时光说笑
    2020-12-17 02:28

    To use the JavaScript code you can check this answer:

    The Objective-C interface in the JavascriptCore framework introduced with iOS 7 permits calling Objective-C methods from Javascript. For a great intro to these features, check out the 2013 WWDC introduction "Integrating JavaScript into Native Apps" session on Apple's developer network: https://developer.apple.com/videos/wwdc/2013/?id=615

    It mentions JS->Objective-C but JSCore also works the other way around.

    Otherwise as someone suggested it should be fairly easy to "translate" the JS code as it would just be mathematical calculations.

提交回复
热议问题