如何创建看起来像 Swift 中铅笔素描的视图边框?

How can I create a view border that looks pencil sketched in Swift?

例如,像这样:

你可以用这种方式 UIColor.init(patternImage:UIImage)

self.imageView.layer.cornerRadius = 30
self.imageView.layer.borderWidth = 20
self.imageView.layer.borderColor = UIColor.init(patternImage: UIImage(named: "images.jpeg")!).cgColor
self.imageView.clipsToBounds = true

这是图案图片Pattern