概述 对UIImage的扩展1 extension UIImage{ 2给定指定宽度,返回结果图像 3 func scaleImageToWidth(_ width: CGFloat) -> UIIma