Skip to content

Instantly share code, notes, and snippets.

@mazharulbelal
Last active June 23, 2022 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazharulbelal/2f8b29865e77a2095ffadc256c2cab0e to your computer and use it in GitHub Desktop.
Save mazharulbelal/2f8b29865e77a2095ffadc256c2cab0e to your computer and use it in GitHub Desktop.
extension Array {
func transtionDoctorTitle() -> String {
let titles = self.map {changeLanguage.key(key: doctorData[$0 as! String] ?? changeLanguage.key(key: notGivenKey))}
return titles.joined(separator: ", ")
}
}
// DOWNLOAD IMAGE FROM URL
extension UIImageView {
func downloadImg(_ url: String) {
let afterRemovedSpaceImgPath = url.replacingOccurrences(of: " ", with: "%20", options: .literal, range: nil)
self.sd_imageIndicator = SDWebImageActivityIndicator.gray
self.sd_setImage(with: URL(string: afterRemovedSpaceImgPath), placeholderImage: UIImage(named: "PlaceHolder"))
}
}
// IMAGE VIEW MAKE CIRCLE
extension UIImageView {
public func makeCircle() {
self.contentMode = UIView.ContentMode.scaleAspectFill
self.layer.cornerRadius = self.frame.height / 2
self.layer.masksToBounds = false
self.clipsToBounds = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment