• Stars
    star
    314
  • Rank 133,353 (Top 3 %)
  • Language
    Objective-C
  • Created over 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PPDragDropBadgeView is a badge view which able to drag and drop. Just like QQ 5.0 badge view.

PPDragDropBadgeView

PPDragDropBadgeView is a badge view which able to drag and drop. Just like QQ 5.0 badge view. image

  • Support iOS 5.0+ ARC

Configure

  • Checkout PPDragDropBadgeView from github.
  • Copy PPDragDropBadgeView folder to your project.
  • Go to 'TARGET' -> 'Build Phases' -> 'Complile Sources', add compliler flags '-fno-objc-arc' for 'PRTween.m' and 'PRTweenTimingFunctions.m'
  • Done.

You can also refer to the example project provided by me.

Usage

  • Q: How to use PPDragDropBadgeView?

  • A: Very simple, you only follow the down code.

PPDragDropBadgeView* badgeView
= [[PPDragDropBadgeView alloc] initWithFrame:CGRectMake(0, 0, 20, 20) dragdropCompletion:^{ NSLog(@"Drag drop done."); }]; badgeView.text = @"6";

  • Q: Does it can be customized?
  • A: Of course, You can see the propertys provided by me.
      /** The completion block when drag drop done. */
      @property (nonatomic, copy) void(^dragdropCompletion)();
      
      /** The tint color of badge view. Default is red */
      @property (nonatomic, strong) UIColor* tintColor;
      
      /** The text of badge view. */
      @property (nonatomic, strong) NSString* text;
    

Note

you must use addSubview instead of directly use it. like

PPDragDropBadgeView* badge = [[PPDragDropBadgeView alloc] initWithFrame:CGRectMake(10, 10, 25, 25)];
badge.text = @"8";

//you must add to container first instead of [[UIBarButtonItem alloc] initWithCustomView:badge]
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
container.backgroundColor = [UIColor clearColor];
[container addSubview:badge];

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:container];

History

  • v2.1 (October 29, 2015)
    • Fix bug, it can on the top view some case.
    • Fix bug, it will crash when drag sometimes.
  • v2.0 (July 2, 2015)
    • Fix bug, it can scroll tableview when badage in cell.
  • v1.2 (June 18, 2015)
    • Fix bug, it does't drag when in innner viewcontroller.
  • v1.1 (May 8, 2015)
    • Fix Bug, it will crash when drag sometimes.
  • v1.0 (March 30, 2015)
    • First release.

License

The code follows MIT Lisence.

Contact

If you have any questions with use it or found some bugs, you can mail to me. I will get back to you in time. The follow is my email address: [email protected]

More Repositories

1

ios-icon-generator

This script is use to generate iOS/macOS/watchOS app icons more easier.
Shell
959
star
2

xmlyfetcher

喜马拉雅音频下载工具
Shell
402
star
3

PPHTMLImagePreviewDemo

该Repo用于演示APP中点击HTML的图片来预览图片的功能
Objective-C
89
star
4

Jekyll-Pithy

Pithy Jekyll Theme
CSS
69
star
5

wavutils

wavutils is a tool set that process wav file
Shell
46
star
6

PPSqliteORM

Sqlite数据库的ORM操作,基于FMDB,封装成framework,操作简单
Objective-C
34
star
7

xcode-configure

This command can generate makefile to build xcode project in command line just like <configure & make & make install> in C/C++ language world.
Shell
34
star
8

ios-resource-3x2x1x

该脚本实现批量将3x图片资源转化成2x与1x
Shell
16
star
9

lightssdpd

ssdp server and client
C
15
star
10

baiduyun-accelerator

百度云加速器
Shell
13
star
11

PPTranslator

汉字转换成拼音首字母
Objective-C
7
star
12

YDSlider

为Slider添加middleTrack,用于实现音乐或视频播放的buffered进度
Objective-C
7
star
13

map2cloud

Map local port to cloud - 映射本地端口至云端
Shell
5
star
14

SandboxAccessor

SandboxAccessor is a lib based on mongoose to access sandbox more easier
C
5
star
15

apns-tester

APNS测试,包含服务端、客户端
Objective-C
5
star
16

travis-ci-tutorial

从零开始,travis-ci入门教程
C
4
star
17

tcp_server_client_demo

TCP Server & Client Demo
C
4
star
18

app-publisher

APP内测发布系统
Shell
3
star
19

tinyhtml

Expand tinyxml,support html
C++
3
star
20

Blogs

Store my blogs
Python
3
star
21

dictionary

dictionary for c
C
2
star
22

yuedu

client for yuedu.fm
Objective-C
2
star
23

yeelink-python-sdk

Yeelink sdk for python
Python
2
star
24

RefreshView

RefreshView for uiscrollview(support pull down/up/left/right)
Objective-C
2
star
25

RTSPPlayer

RTSPPlayer write by objc
C
2
star
26

VolumeBar

VolumeBar write by objc
Objective-C
1
star
27

PPPopoverSlideViewController

从侧边弹出菜单,并具备毛玻璃效果
Objective-C
1
star
28

jssh

Run javascript in shell
Shell
1
star
29

myplayer

myplayer is my family customized music player. with raspberrypi + dac + volumio + motion + myplayer + cron, i build a self-play music player
Shell
1
star
30

hello-grunt

为了方便grunt初学者能够快速地入门,本Repo为大家展现一个简单而有趣的示例,在本示例中,为大家展现『如何实现js文件自动化压缩』
JavaScript
1
star
31

CocoaPodsSpecs

This repo use to story my favorate thirdpart libraray.
Ruby
1
star
32

UIOverlapedViewController

UIOverlapedViewController write by objc
Objective-C
1
star
33

qn-ctl

qiniu commands just like ls/rm/mkdir/put/get in linux file operation.
Shell
1
star
34

Dimmer

Dimmer write by objc
Objective-C
1
star
35

PPAdvertisingView

Advertising view for app.
Objective-C
1
star
36

XCodeCodeSnippets

Auto sync my xcode code snippets to github
Shell
1
star
37

rtprewrite

rewrite rtp package, like tcprewrite
Shell
1
star