{"id":2191,"url":"https://github.com/lucamozza/LMArticleViewController","last_synced_at":"2025-08-02T23:32:10.992Z","repository":{"id":56918805,"uuid":"80339131","full_name":"lucamozza/LMArticleViewController","owner":"lucamozza","description":"UIViewController subclass to beautifully present news articles and blog posts.","archived":true,"fork":false,"pushed_at":"2017-04-12T17:56:25.000Z","size":4531,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-18T04:27:05.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucamozza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-29T10:00:35.000Z","updated_at":"2023-01-28T03:25:50.000Z","dependencies_parsed_at":"2022-08-21T04:20:12.622Z","dependency_job_id":null,"html_url":"https://github.com/lucamozza/LMArticleViewController","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamozza%2FLMArticleViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamozza%2FLMArticleViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamozza%2FLMArticleViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamozza%2FLMArticleViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucamozza","download_url":"https://codeload.github.com/lucamozza/LMArticleViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503140,"owners_count":17930519,"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":[],"created_at":"2024-01-05T20:16:07.147Z","updated_at":"2024-12-06T17:30:48.981Z","avatar_url":"https://github.com/lucamozza.png","language":"Objective-C","funding_links":[],"categories":["UI"],"sub_categories":["Other free courses","Font","Other Testing"],"readme":"# LMArticleViewController\n![License](https://img.shields.io/cocoapods/l/LMArticleViewController.svg?style=flat)\n![Platform](https://img.shields.io/cocoapods/p/LMArticleViewController.svg?style=flat)\n![Version](https://img.shields.io/cocoapods/v/LMArticleViewController.svg?style=flat)\n\nThis framework allows you to create Apple News-inspired UIViewControllers with ease.\n\nIt is heavily inspired by [MRArticleViewController], in fact the core is a simple translation of it. However I added some features I thought could be useful.  \n![Preview 1](/img-1.png)\n![Preview 2](/img-2.png)\n## Features\nThe layout is shown in the images above, here's some extra features.\n#### Animations\n- [x] The navigation bar shrinks when you scroll down.\n- [x] The image view stretches when the scrollview bounces ( just like Facebook's Instant Articles).\n\n#### Appereance\n- [x] You can set custom fonts for all the text.\n- [x] Supports `NSAttributedString` in the body.\n- [x] Supports automatic background color and automatic light/dark text color.\n\n\n## Installation\nLMArticleViewController is available through CocoaPods. Simply add the following line to your Podfile.\n\n```ruby\npod 'LMArticleViewController'\n```\n\n## Usage\nYou can either subclass `LMArticleViewController` and set the contents in the `viewDidLoad:` method or instantiate an LMArticleViewController object, set its properties and present it.\n\n#### Case A: Subclass\n```Objective-C\n- (void)viewDidLoad {\n\n    // Set custom fonts\n    // Size doesn't matter here, the super class overrides with default values\n    [self setHeadlineFont:[UIFont fontWithName:@\"Nexa Bold\" size:1]];\n    [self setAuthorFont:[UIFont fontWithName:@\"Roboto-Regular\" size:1]];\n    [self setDateFont:[UIFont fontWithName:@\"Roboto-Regular\" size:1]];\n\n    // Set contents\n    self.headline       = self.dataDictionary[k_TITLE];\n    self.image          = self.dataDictionary[k_IMAGE];\n    self.author         = self.dataDictionary[k_AUTHOR];\n    self.attributedBody = self.dataDictionary[k_BODY];\n    self.date           = self.dataDictionary[k_DATE];\n\n    // IMPORTANT! Setup must happen before [super viewDidLoad]!!\n    [super viewDidLoad];\n\n}\n```\n#### Case B: Init and push\n```Objective-C\n- (void)openArticleWithContents:(NSDictionary *)dataDictionary {\n\n    LMArticleViewController* articleViewController = [[LMArticleViewController alloc]init];\n\n    [articleViewController setBodyFont:[UIFont fontWithName:@\"Roboto-Medium\" size:1]];\n\n    articleViewController.headline       = dataDictionary[k_TITLE];\n    articleViewController.image          = dataDictionary[k_IMAGE];\n    articleViewController.author         = dataDictionary[k_AUTHOR];\n    articleViewController.attributedBody = dataDictionary[k_BODY];\n    articleViewController.date           = dataDictionary[k_DATE];\n\n    [self.navigationController pushViewController:articleViewController animated:YES];\n}\n```\n\n\n## To-Do List\n- [ ] Adjust image view size and proportions.\n\n\n[MRArticleViewController]: https://github.com/mrigdon/MRArticleViewController\n[ColorArt]: https://github.com/vinhnx/ColorArt\n[Chamaleon]: https://github.com/ViccAlexander/Chameleon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucamozza%2FLMArticleViewController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucamozza%2FLMArticleViewController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucamozza%2FLMArticleViewController/lists"}