All Projects → DholStudio → Dsgradientprogressview

DholStudio / Dsgradientprogressview

Licence: apache-2.0
A simple animated progress bar in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Dsgradientprogressview

Swiftcocoadsl
An easy way to write iOS UI
Stars: ✭ 103 (-76.43%)
Mutual labels:  ios-lib, ios-ui
Lmmediaplayer
A video and audio player with replaceable UI component.
Stars: ✭ 183 (-58.12%)
Mutual labels:  ios-lib, ios-ui
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+2195.42%)
Mutual labels:  ios-lib, ios-ui
Cocoaasyncsocket demo
基于AsyncSocket搭建即时通讯体系 . 包含TCP连接 , 消息发送 , 消息接收 , 心跳处理 ,断网重连 , 消息超时 , 消息分发 , 数据库结构设计 , 消息丢失等 . 以及UI设计, 文本表情消息/语音消息/图片消息/视频消息/文件消息/撤回消息/提示语消息的实现思路讲解
Stars: ✭ 981 (+124.49%)
Mutual labels:  ios-lib, ios-ui
Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-45.54%)
Mutual labels:  ios-lib, ios-ui
Flexlayout
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.
Stars: ✭ 1,342 (+207.09%)
Mutual labels:  ios-lib, ios-ui
Calendarkit
📅 Calendar for Apple platforms in Swift
Stars: ✭ 2,049 (+368.88%)
Mutual labels:  ios-lib, ios-ui
Pinlayout
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]
Stars: ✭ 1,870 (+327.92%)
Mutual labels:  ios-lib, ios-ui
Kdintroview
Stars: ✭ 300 (-31.35%)
Mutual labels:  ios-lib, ios-ui
Pvview
A small library that helps you to make an amazing parallax view
Stars: ✭ 227 (-48.05%)
Mutual labels:  ios-lib, ios-ui
Avatarimageview
DEPRECATED!!! --- Use https://github.com/neone/NDAvatarApp
Stars: ✭ 257 (-41.19%)
Mutual labels:  ios-lib, ios-ui
Iosproject
IOS综合项目,完善的框架,路由模块化设计,集成科大讯飞SDK方便iOS基本输入控件实现语音辅助输入,UI效果参照京东APP,JS与OC交互,ionic跨平台开发,MQTT 协议,即时通讯协议,视屏播放,跑马灯效果 仿美团地图定位,城市收索, 友盟分享,基础动画 增加FCUIID帮助类,引导页功能模块,照片上传 ,UIView自定义导航栏,文件下载,Masonry 案例,fmdb,数据库,sqlite,百度地图,二维码,照片上传,照片上传有进度,列表倒计时,H5和原生交互,自定义各种弹框,常见表单类型,人脸识别,列表加载图片,列表拖拽,日历操作,导航条渐变,核心动画,动画特效等等
Stars: ✭ 291 (-33.41%)
Mutual labels:  ios-lib, ios-ui
Cardviewlist
An elegant and responsive CardView like Android on iOS with Swift. Available horizontal and vertical scrolling with full animations and customizable.
Stars: ✭ 30 (-93.14%)
Mutual labels:  ios-lib, ios-ui
RDPopup
A simple way to add custom Popup. Design on Nib and use as you want. Written in Objective-C.
Stars: ✭ 19 (-95.65%)
Mutual labels:  ios-ui, ios-lib
Mycoretextlabel
图文混排 , 实现图片文字混排 , 可显示常规链接比如网址,@,#话题#,手机号 , 邮箱号等 , 可以自定义链接字,设置关键字高亮等功能 . 适用于微博,微信,IM聊天对话等场景 . 实现这些功能仅用了几百行代码,耦合性也较低
Stars: ✭ 192 (-56.06%)
Mutual labels:  ios-lib, ios-ui
FacebookMessengerActivity
Share with Facebook Messenger App.
Stars: ✭ 16 (-96.34%)
Mutual labels:  ios-ui, ios-lib
StackViewLayout
Coming soon!
Stars: ✭ 26 (-94.05%)
Mutual labels:  ios-ui, ios-lib
React Native Network Info
React Native library for getting information about the devices network
Stars: ✭ 313 (-28.38%)
Mutual labels:  ios-lib
geopackage-ios
GeoPackage iOS Library
Stars: ✭ 45 (-89.7%)
Mutual labels:  ios-lib
React Native Ios Kit
The missing React Native UI Kit for iOS
Stars: ✭ 368 (-15.79%)
Mutual labels:  ios-ui

DSGradientProgressView

Swift Version License CocoaPods Compatible Platform

Introduction

DSGradientProgressView is a simple and customizable animated progress bar written in Swift.

Inspired by GradientProgressView.

Demo

Demo gif

The gif looks flickery, but the actual animation on device will not be.

Usage

Simply drop a UIView into your View Controller in the Storyboard. Select your view and, in the Identity Inspector, change the class to DSGradientProgressView.

Don't forget to change the module to DSGradientProgressView too.

Demo set class

Size the view according to your needs. (A 3px height looks great in most cases).

Import DSGradientProgressView in your view controller source file.

import DSGradientProgressView

Create an IBOutlet of the view in your view controller source file.

@IBOutlet weak var progressView: DSGradientProgressView!

Customize

You can change the base color of the progress bar. There are two ways to do this:

  • By setting the barColor property of the view object in your source file.
progressView.barColor = UIColor.green
  • Changing the Bar Color property in Storyboard itself.

Demo color picker

Animate

DSGradientProgressView is designed to keep track of the number of requests waiting for completion. Hence the api's are named after semaphore method names. You call the wait() method of the DSGradientProgressView to start animating and signal() method to stop. It hides and un-hides itself accordingly.

progressView.wait()
  // waiting for some resource
progressView.signal()

So, if your View Controller is waiting for more than one network request (or any other resource) and you want the Progress Bar to animate until all the requests are over, you can do that by simply calling wait() that number of times. Later, call signal() the same number of times.

progressView.wait()
  // waiting for some resource asynchronously
ResourceOne.sharedInstance.fetchData { (data, error) in
         self.progressView.signal()
}

progressView.wait()
  // waiting for another resource asynchronously
ResourceTwo.sharedInstance.fetchData { (data, error) in
         self.progressView.signal()
}

Installation

CocoaPods (Recommended)

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build DSGradientProgressView 1.0.0+.

To integrate DSGradientProgressView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'DSGradientProgressView'
end

Then, run the following command:

$ pod install

Manually

Copy the DSGradientProgressView.swift to your Xcode project. That should do it.

Requirements

  • iOS 8.0+
  • Xcode 10.0+
  • Swift 4.2+

Contacts

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].