All Projects → ratulSharker → RSUIImageViewMultiborder

ratulSharker / RSUIImageViewMultiborder

Licence: MIT license
Allowing multiple border allowing UIImage, easy to use and customise.

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to RSUIImageViewMultiborder

Faceaware
An extension that gives UIImageView the ability to focus on faces within an image.
Stars: ✭ 3,004 (+24933.33%)
Mutual labels:  uiimageview
Efimageviewzoom
DEPRECATED 🌃 A very simple IBDesignable UIImageView with pinch zoom swift
Stars: ✭ 71 (+491.67%)
Mutual labels:  uiimageview
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+1266.67%)
Mutual labels:  uiimageview
Moa
An image download extension of the image view written in Swift for iOS, tvOS and macOS.
Stars: ✭ 314 (+2516.67%)
Mutual labels:  uiimageview
Ios Imagezoomviewer
ImageZoomViewer is a simple to use Objective C framework that allows the capability of viewing images with zoom-in zoom-out functionality.
Stars: ✭ 14 (+16.67%)
Mutual labels:  uiimageview
Dynamicclipimage
iOS实现动态区域裁剪图片
Stars: ✭ 110 (+816.67%)
Mutual labels:  uiimageview
VKProgressHud
Hey All! As it is obvious from the GIF, this project is a LoadingIndicator based on CoreAnimation.
Stars: ✭ 30 (+150%)
Mutual labels:  uiimageview
Shades
Easily add drop shadows, borders, and round corners to a UIView.
Stars: ✭ 14 (+16.67%)
Mutual labels:  border
Aaviewanimator
AAViewAnimator is a set of animations designed for UIView, UIButton, UIImageView with options in iOS, written in Swift.
Stars: ✭ 33 (+175%)
Mutual labels:  uiimageview
Asyncimage
Asynchronous Image Loading from URL in SwiftUI
Stars: ✭ 139 (+1058.33%)
Mutual labels:  uiimageview
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (+2583.33%)
Mutual labels:  uiimageview
Uiimageview Betterface
a UIImageView category to let the picture-cutting with faces showing better
Stars: ✭ 790 (+6483.33%)
Mutual labels:  uiimageview
Akvideoimageview
UIImageView subclass that allows you to display a looped video and dynamically switch it.
Stars: ✭ 123 (+925%)
Mutual labels:  uiimageview
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (+2316.67%)
Mutual labels:  uiimageview
Lkimagekit
A high-performance image framework, including a series of capabilities such as image views, image downloader, memory caches, disk caches, image decoders and image processors.
Stars: ✭ 2,063 (+17091.67%)
Mutual labels:  uiimageview
Avatarimageview
DEPRECATED!!! --- Use https://github.com/neone/NDAvatarApp
Stars: ✭ 257 (+2041.67%)
Mutual labels:  uiimageview
Abmediaview
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Stars: ✭ 79 (+558.33%)
Mutual labels:  uiimageview
PREBorderView
A very simple Objective-C UIView category for specifying single-sided borders.
Stars: ✭ 18 (+50%)
Mutual labels:  border
RITLLayerBorder
【Deprecated】为UIView追加选择指定边的border, 适配autoLayout
Stars: ✭ 22 (+83.33%)
Mutual labels:  border
Zoomy
Adds seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.
Stars: ✭ 130 (+983.33%)
Mutual labels:  uiimageview

codebeat badge Build Status Language Platform License

Quick Demo

Demo

Background

Customising ios application are quiet challenging when there is no apple provided user interface or api to do that. Showing multiple border alongside the shown image is one of that. Like following:

Sample bordererd image

To achieve that we have to put UIImageView inside an UIView as a sub-view and changing the container view's background color. Another way to achive is to subclass the UIImageView and implement the drawRect: method to draw whatever we need. But apple discourages to implement the drawRect:, and even they didn't executes your drawRect: implementation.

Directly from the appledoc

Do not use image views for custom drawing.

TheUIImageView class does not draw its content using the drawRect: method. Use image views only to present images. To do custom drawing involving images, subclass UIView directly and draw your image there.

So here it is, UIView is subclassed and the UIImage is drawn inside with proper content mode specified, maintaining specified number of border.

Installation

Copy the class named RSUIImageViewMultiborder, a category file and RSCotentModeHandler . In interface builder take an UIView and set the custom class as RSUIImageViewMultiborder.

RSUIImageViewCustomBadge will be available through cocoapod soon.

Customizing

Adding a new border is the most easiest part. To add a new border in RSUIImageViewCustomBadge.h add two property of the following format

@property IBInspectable UIColor *border_color_xxx;
@property IBInspectable CGFloat border_width_xxx;

which represents a border.

Things we needed to take into account, is that, the border declaration preceedes the other border are rendered in the outer section from other border. For example

@property IBInspectable UIColor     *border_color_1;  //first border - the outmost border
@property IBInspectable CGFloat     border_width_1;

@property IBInspectable UIColor     *border_color_2;  //second border
@property IBInspectable CGFloat     border_width_2;

@property IBInspectable UIColor     *border_color_3;  //third border from the outmost border
@property IBInspectable CGFloat     border_width_3;

@property IBInspectable UIColor     *border_color_4;  //fourth border
@property IBInspectable CGFloat     border_width_4;

so find the appropriate position of the border, where to add it and feel free to delete any unnecessary border you are not using. Deleting a border requires to delete two property indicating a border.

Properties

RSUIImageViewMultiborder has following properties

Property Type Denotes
isRounded BOOL set the corner radius to it's half of it's width
border_color_xxx UIColor designate the color of a border
border_width_xxx CGFloat the width of the border
image UIImage image to be rendered
contentMode UIViewContentMode actually the property contentMode is shared from UIView, which determine the render mode of the image property

Features

There are several features which are not ready yet. Features completed are marked.

  • CI-integration.
  • Support rounded and non-rounded regular border.
  • Support IBDesignable to be customized from interface builder.
  • Adding a border just adding necessary properties.
  • Handle image drawing for all content mode.
  • Available in cocoapod.
  • Finding a cleaner way to add border while installed via cocoapod.
  • Supporting line drawing style in interface builder (i.e dotted line, rounded dotted line etc).

License

RSUIImageViewMultiborder is available under the MIT license. See the LICENSE file for more info.

Please feel free to file an issue, on any inconsistency found or new feature needed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].