iOS開源 - YJFavorEmitter:好用的點贊粒子發射器

jeri777 8年前發布 | 7K 次閱讀 iOS開發 移動開發

YJFavorEmitter

 

English

YJFavorEmitter is a favor cells emitter which is very nice and easy to use.

Installation

  1. Add pod 'YJFavorEmitter' to your Podfile.
  2. Run pod install or pod update.
  3. import .

Usage

init emitter
/**
 _emitter = [YJFavorEmitter emitterWithFrame:CGRectMake(0, 0, 44, 44)
                               favorDisplayView:self.view
                                          image:[UIImage imageNamed:@"heart.png"]
                                 highlightImage:nil];

generate cells

/**
 generate a number of cells

@param count cell's count */

  • (void)generateEmitterCellsForCellsCount:(int)count;</code></pre>

    set appearances of cells

    //
    _emitter.cellImages = @[[UIImage imageNamed:@"heart"], [UIImage imageNamed:@"face"]];

    See demo for details.

    Requirements

    • ARC.
    • Requires iOS 6.0+.
    • Adapt to both iPhone & iPad.

    License

    YJFavorEmitter is provided under the MIT license.See LICENSE file for details.

    Chiness

    YJFavorEmitter 是一個非常好用的點贊粒子發射器。

    安裝

    1. 在 Podfile 中添加 pod 'YJFavorEmitter' 。
    2. 執行 pod install 或 pod update 。
    3. 導入 。

    使用

    初始化發射器

    _emitter = [YJFavorEmitter emitterWithFrame:CGRectMake(0, 0, 44, 44)

                             favorDisplayView:self.view
                                        image:[UIImage imageNamed:@"heart.png"]
                               highlightImage:nil];</code></pre> 
    

    產生元素

    /**
    釋放元素

    @param count 元素數量 */

  • (void)generateEmitterCellsForCellsCount:(int)count;</code></pre>

    設置元素外觀

    _emitter.cellImages = @[[UIImage imageNamed:@"heart"], [UIImage imageNamed:@"face"]];

    更多精彩請看 demo

    配置

    • ARC
    • 該項目最低支持 iOS 6.0 。
    • 同時支持 iPhone 和 iPad

    許可證

    YJFavorEmitter 使用 MIT 許可證,詳情見 LICENSE 文件。

     

 本文由用戶 jeri777 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!