Giter Club home page Giter Club logo

tnsexyimageuploadprogress's Introduction

TNSexyImageUploadProgress

An image upload progress component for Objective-C

TNSexyImageUploadProgress

Installation

Manual

  • Just drag the files in the src folder to your project.
  • Import the class

CocoaPods

  • Add pod 'TNSexyImageUploadProgress' to your Podfile
  • Done

How to use?

  • Import the TNSexyImageUploadProgress.h file.
  • Create an instance of the class
  • Call the show method
  • Update the progress by setting the progress property (when you are working with different threads, you should do this on the main thread!)

For example:

dispatch_async(dispatch_get_main_queue(), ^{
    self.imageUploadProgress.progress = progress.fractionCompleted;
});
  • Done!

For example

self.imageUploadProgress = [[TNSexyImageUploadProgress alloc] init];
[self.imageUploadProgress show];

Customise the component

If you want you can customise how the component looks. You can set the following properties:

Property What does it do
progress Set how far the circle has to be drawn (value between 0.0 and 1.0)
radius Set the radius for the circular image mask
progressBorderThickness Set the thickness of the border
trackColor Set the color for the track
progressColor Set the color for the progress
showOverlay Set if you want the component to show an overlay

For example

self.imageUploadProgress = [[TNSexyImageUploadProgress alloc] init];
self.imageUploadProgress.radius = 100;
self.imageUploadProgress.progressBorderThickness = -10;
self.imageUploadProgress.trackColor = [UIColor blackColor];
self.imageUploadProgress.progressColor = [UIColor whiteColor];
self.imageUploadProgress.imageToUpload = selectedImage;
[self.imageUploadProgress show];

Video

You can check out a video of the component at http://cl.ly/VE1F/TNSexyImageUpload.mov

Demo

There is a demo project added to this repository, so you can see how it works. In the folder 'webservice', you can find a PHP script to upload pictures. Just put it in your document directory and set the correct path in MainViewController.

License

TNSexyImageUploadProgress published under the MIT license:

Copyright (C) 2014, Frederik Jacques

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tnsexyimageuploadprogress's People

Contributors

frederik-jacques avatar

Watchers

KelvinLaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.