{"id":18333479,"url":"https://github.com/sochalewski/uiimageviewalignedswift","last_synced_at":"2025-04-06T09:09:09.366Z","repository":{"id":3908718,"uuid":"51286832","full_name":"sochalewski/UIImageViewAlignedSwift","owner":"sochalewski","description":"A UIImageView subclass which allows you to align the image left/right/top/bottom, even when contentMode is AspectFit. Swift now.","archived":false,"fork":false,"pushed_at":"2022-04-10T21:08:39.000Z","size":76,"stargazers_count":236,"open_issues_count":7,"forks_count":67,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T08:08:25.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/sochalewski.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":"2016-02-08T08:42:08.000Z","updated_at":"2024-02-24T15:25:26.000Z","dependencies_parsed_at":"2022-11-28T10:33:57.040Z","dependency_job_id":null,"html_url":"https://github.com/sochalewski/UIImageViewAlignedSwift","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sochalewski%2FUIImageViewAlignedSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sochalewski%2FUIImageViewAlignedSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sochalewski%2FUIImageViewAlignedSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sochalewski%2FUIImageViewAlignedSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sochalewski","download_url":"https://codeload.github.com/sochalewski/UIImageViewAlignedSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457803,"owners_count":20941906,"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-11-05T19:42:31.584Z","updated_at":"2025-04-06T09:09:09.346Z","avatar_url":"https://github.com/sochalewski.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIImageViewAlignedSwift\n\n[![Version](https://img.shields.io/cocoapods/v/UIImageViewAlignedSwift.svg?style=flat)](http://cocoapods.org/pods/UIImageViewAlignedSwift)\n[![License](https://img.shields.io/cocoapods/l/UIImageViewAlignedSwift.svg?style=flat)](http://cocoapods.org/pods/UIImageViewAlignedSwift)\n[![Platform](https://img.shields.io/cocoapods/p/UIImageViewAlignedSwift.svg?style=flat)](http://cocoapods.org/pods/UIImageViewAlignedSwift)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift_Package_Manager-compatible-4BC51D.svg)](https://www.swift.org/package-manager/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n* iOS 8.0+, tvOS 9.0+\n* Swift 5.x\n\n## Installation\n\n### Package Manager\n\nYou can add UIImageViewAlignedSwift to an Xcode project by adding it as a package dependency.\n\n  1. From the **File** menu, select **Add Packages…**\n  2. Enter `https://github.com/sochalewski/UIImageViewAlignedSwift` into the package repository URL text field.\n  3. Add the package to your app target.\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate UIImageViewAlignedSwift into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'UIImageViewAlignedSwift'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate UIImageViewAlignedSwift into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"sochalewski/UIImageViewAlignedSwift\"\n```\n\nRun `carthage update` to build the framework and drag the built `UIImageViewAlignedSwift.framework` into your Xcode project.\n\n## What is it?\n\nIt is a subclass of `UIImageView` that allows you to customize the alignment of the displayed image inside the view's frame.\nThis works even if the `contentMode` is set to `.scaleAspectFit`, `.scaleAspectFill` or `.scaleToFill`.\n\nIt is rewritten to Swift based on original [UIImageViewAligned by reydanro](https://github.com/reydanro/UIImageViewAligned).\n\n## Why a subclass of UIImageView, and not a standard UIView?\n\nBecause there are many cool categories built on top of `UIImageView`. Subclassing a standard `UIView` would mean losing them.\n\nFor example, `AFNetworking`'s async `UIImageView` category works perfectly using this container class, and you don't have to worry about a thing.\n\n## How does it work?\n\nWhen initialized, `UIImageViewAligned` will create a inner `UIImageView` which will actually hold the image displayed.\nThe main class then just repositions this inner `UIImageView` to achieve your desired alignment.\n\nAt runtime, you can change the `image`, `contentMode` or `alignment` and the image will reposition itself correctly.\n\nThe `image` property of `UIImageViewAligned` is overwritten to forward the calls to the inner `UIImageView`, so you can just drag and drop into your app.\n\n## Author\n\nPiotr Sochalewski, \u003ca href=\"http://sochalewski.github.io\"\u003esochalewski.github.io\u003c/a\u003e\n\n## License\n\nUIImageViewAlignedSwift is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsochalewski%2Fuiimageviewalignedswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsochalewski%2Fuiimageviewalignedswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsochalewski%2Fuiimageviewalignedswift/lists"}