{"id":22881054,"url":"https://github.com/swiftcrew/mtletterimage","last_synced_at":"2025-05-07T02:43:20.766Z","repository":{"id":143697516,"uuid":"177203373","full_name":"SwiftCrew/MTLetterImage","owner":"SwiftCrew","description":"This is code if you want to create a UIImage of letters, This code takes the first letter of first and last word, if you want only first latter from string then change the DataProvider setting. This will reduce your project size.","archived":false,"fork":false,"pushed_at":"2019-09-17T12:56:00.000Z","size":17,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T05:32:45.648Z","etag":null,"topics":["latterimage","profile","profileicon","swift5"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftCrew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-22T20:13:00.000Z","updated_at":"2021-04-03T20:18:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe2226a7-21d8-4dba-b619-27b1c3358182","html_url":"https://github.com/SwiftCrew/MTLetterImage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftCrew%2FMTLetterImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftCrew%2FMTLetterImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftCrew%2FMTLetterImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftCrew%2FMTLetterImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftCrew","download_url":"https://codeload.github.com/SwiftCrew/MTLetterImage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252802607,"owners_count":21806537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latterimage","profile","profileicon","swift5"],"created_at":"2024-12-13T17:29:33.917Z","updated_at":"2025-05-07T02:43:20.759Z","avatar_url":"https://github.com/SwiftCrew.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTLetterImage\nThis code will generate image from letters(words). Ex. Mohd Tahir image will be generate MT, Choose your `wordsType` First, Last and Both.\n\n## Requirements\n- iOS 8.0+\n- Xcode 10+\n- Swift 4.2\n\n### Code\n\nGet Image from a string. \n``` swift\n    \n   let size = imageViewBothWords.frame.size // current imageViewSize.\n    // for Both First \u0026 Last\n    let dataProviderBoth = DataProvider(\n      name: \"Mohammad Tahir\",\n      imageSize: size\n    ) // Create DataProvider.\n    \n    self.imageViewBothWords.image = MTLetterImage.imageWith(dataProvider: dataProviderBoth) // image.\n    \n    // First Word\n    \n    let dataProviderFirst = DataProvider(\n      name: \"Mohammad Tahir\",\n      backgroundColor: .red,\n      imageSize: size,\n      wordsType: .first\n    ) // Create DataProvider.\n    \n    self.imageViewFirstWord.image = MTLetterImage.imageWith(dataProvider: dataProviderFirst) // image.\n    \n    // Last word\n    let dataProviderLast = DataProvider(\n      name: \"Mohammad Tahir\",\n      backgroundColor: .orange,\n      textColor: .white,\n      imageSize: size,\n      font: UIFont.systemFont(ofSize: 22, weight: .bold),\n      wordsType: .last\n    ) // Create DataProvider.\n    \n    self.imageViewLastWord.image = MTLetterImage.imageWith(dataProvider: dataProviderLast) // image.\n\n```\n\n``` swift\n\n   /// String text for image\n  public var name: String\n  \n  /// Image Background Color\n  public var backgroundColor: UIColor\n  \n  /// Image Text Color\n  public var textColor: UIColor\n  \n  /// Image Size\n  public var imageSize: CGSize\n  \n  /// Text Font\n  public var font: UIFont\n  \n  /// String Separater\n  public var componentSeparatedBy: String\n  \n```\n\n\n## Result \n\u003ca href=\"https://ibb.co/JqZRHHy\"\u003e\u003cimg src=\"https://i.ibb.co/nBpsjjn/Simulator-Screen-Shot-i-Phone-XS-Max-2019-03-23-at-02-13-58.png\" alt=\"Latter Image\" border=\"0\"\u003e\u003c/a\u003e\n\n## Communication\n\n- If you found a bug, please open an issue. :bow:\n- Also, if you have a feature request, please open an issue. :thumbsup:\n- If you want to contribute, submit a pull request.:muscle:\n\n\n## Created by\nMohd Tahir, [@Mohd_Tahir99](https://twitter.com/Mohd_Tahir99)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftcrew%2Fmtletterimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftcrew%2Fmtletterimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftcrew%2Fmtletterimage/lists"}