Latest 2.0.1
Homepage https://github.com/panghaijiao/HJDanmaku-Swift
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

GitHub

HJDanmaku-Swift
HJDanmaku-Swift
HJDanmaku-Swift
HJDanmaku-Swift

HJDanmaku-Swift is a high performance danmaku engine for iOS. For more details please click here

Overview

Compared to the version 1.0, HJDanmaku 2.0 has better performance, Such as high performance, large concurrent and better fluency. surely, you can customize the cell style according to product requirements. In version 2.0´╝îit provides a new live mode to meet the live scene.

Get the version of objc at here

Fearture

  • [Performance] The average CPU usage for total is less than 5% .
  • [Fluency] The rendering frame rate (FPS) is stable at 60 frames.
  • [Concurrency] Off screen rendering ensures the stability of large concurrent data.

Reference

Dimension 1.0 2.0
Performance ⭐️⭐️⭐️ ⭐️⭐️⭐️⭐️
Fluency ⭐️⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️
Accuracy ⭐️⭐️⭐️⭐️ ⭐️⭐️⭐️
Concurrency ⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️

Installation with CocoaPods

CocoaPods is a dependency manager for swift, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.

Podfile

pod 'HJDanmaku-Swift', '~> 2.0.0'

Usage

Live Mode

// init config with mode HJDanmakuModeLive
let config = HJDanmakuConfiguration.init(danmakuMode: .HJDanmakuModeLive)
self.danmakuView = HJDanmakuView.init(frame: self.view.bounds, configuration: config)

Video Mode

// init config with mode HJDanmakuModeVideo
let config = HJDanmakuConfiguration.init(danmakuMode: .HJDanmakuModeVideo)
self.danmakuView = HJDanmakuView.init(frame: self.view.bounds, configuration: config)

Send Danmaku

let danmakuModel = DemoDanmakuModel.init(danmakuType: .HJDanmakuTypeLR)
danmakuModel.text = "😊😊olinone.com😊😊"
self.danmakuView.sendDanmaku(danmakuModel, forceRender: true)

Custom style

// register cell class before dequeue
self.danmakuView.register(DemoDanmakuCell.self, forCellReuseIdentifier: "cell")

// configure cell with custom style
let cell = (danmakuView.dequeueReusableCell(withIdentifier: "cell"))!
let model: DemoDanmakuModel = danmaku as! DemoDanmakuModel
cell.textLabel.font = model.textFont
cell.textLabel.textColor = model.textColor
cell.textLabel.text = model.text

History Release

HJDanmaku 1.0 was first released in 2015, You can get it in the folder HJDanmaku1. Surely, for better performance, we recommend the latest version 2.0.

License

HJDanmakuDemo is released under the MIT license. See LICENSE for details.
Copyright (c) 2015 olinone.

Sponsor

GitHub

Latest podspec

{
    "name": "HJDanmaku-Swift",
    "version": "2.0.1",
    "summary": "A high performance danmaku engine for iOS",
    "description": "A high performance danmaku engine for iOS, http://www.olinone.com/?p=186",
    "homepage": "https://github.com/panghaijiao/HJDanmaku-Swift",
    "license": "MIT",
    "authors": {
        "panghaijiao": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/panghaijiao/HJDanmaku-Swift.git",
        "tag": "2.0.1"
    },
    "source_files": "HJDanmaku",
    "frameworks": "UIKit",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This