Latest 0.0.1
Homepage https://github.com/CheaterHu/ViewShapable
License MIT
Platforms ios 8.0
Authors

ViewShapable

An easy way to change a view to a shape using bezierPath.
Something different is once a view change to a shape, you can dicide whether the view responds envent out of view’s bounds. Expect more fantastic effect.

Use

cocoapods: add pod ‘ViewShapable’ in your Podfile

If you layout view using frame, it would like this:

  let aView = UIView()
  aView.frame = CGRect(x: 20, y: 100, width: 200, height: 100);
  aView.backgroundColor = .cyan
  self.view.addSubview(aView)
  aView.circle(radius: aView.bounds.width * 0.5, atRectCorner: [.topLeft, .bottomLeft]())
  aView.respondsEventByOriginShape = false 

If you use AutoLayout, then you must call view.layoutIfNeeded() before calling shape function.

ViewShapable

利用贝塞尔曲线实现将view转化成想要的形状,只要想象力够丰富,view就能呈现各种优美的形状,特别的是,在view被转化成其他形状的时候,你可以选择是否响应超出frame的事件。

希望有更多的形状呈现.

Latest podspec

{
    "name": "ViewShapable",
    "version": "0.0.1",
    "license": "MIT",
    "summary": "An easy way to change view to some shape, and responds envets by shape frame",
    "homepage": "https://github.com/CheaterHu/ViewShapable",
    "authors": {
        "hcd": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CheaterHu/ViewShapable.git",
        "tag": "0.0.1"
    },
    "source_files": "ViewShapable/*.swift",
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This