类似斗鱼,花椒,Periscope-like的库,支持心形,圆形,自定义图片
Objective-C Shell Ruby
Switch branches/tags
Nothing to show
Latest commit 7ab1548 Apr 19, 2017 @Insofan [mod](readme)
Permalink
Failed to load latest commit information.
Example
HXFloatingHearts
ScreenShot
.gitignore
.swift-version
HXFloatingHearts.podspec
LICENSE
README.md
_Pods.xcodeproj

README.md

HXFloatingHearts

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 6.0

ScreenShot

i1XRI.gif

Installation

HXFloatingHearts is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "HXFloatingHearts"

Usage

1.Set view.userInteractionEnabled

self.view.userInteractionEnabled = YES;

2.Add tap gesture.

//添加轻触
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(floatingHeart)];
[self.view addGestureRecognizer:tapGesture];

3.Animate heart

//启动动画
- (void)floatingHeart {
    HXFloatingHearts *heart = [[HXFloatingHearts alloc] initWithWidth:36 center:CGPointMake(138, self.view.bounds.size.height - 28)];
    heart.totalAnimationDuration = 8;
    [self.view addSubview:heart];
    CGPointMake(38, self.view.bounds.size.height - 36/2.0 - 10);
    [heart floatingHeartsWithView:self.view];
}

4.More

It support circle shape.Also support random circle or heart shape. Just add one line.

//Circle
heart.isCircle = true;

or random shape

//Random shape
heart.isRandomShape = true;

Author

Insofan, insofan3156@gmail.com

It inspired by saidmarouf/FloatingHearts,thanks for it.

License

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