Giter Club home page Giter Club logo

blackhawk's Introduction

BlackHawk

BlackHawk is a Cordova compatible javascript-native reflection bridge based on fast and sexy WKWebView written in pure Swift, with incredible high performance.

Notice: NOT ready for production

##Incredible High Performance

###Let's test a shooting game called "萌战姬"

####Cordova:

pic

####BlackHawk:

pic

###That's tons of progress.

###Let's test "萌战姬" on iPhone 4S

  • Device: iPhone 4S

####Cordova:

####BlackHawk:

####BlackHawk makes "萌战姬" can be played on iPhone 4S now.

##Features

####Basic Features

BlackHawk is a Cordova like software that provides a javascript to native reflection bridge, written in pure Swift, aimed to provide a modern, hight-performance replacement of Cordova on iOS platform. BlackHawk uses WKWebView in Apple's new WebKit Framework with pure Swift Language.

####High Performance BlackHawk can reduce the cost of RAM and CPU significantly, especially for complicated HTML5 pages.

##Cordova Compatible

The ultimate goal of BlackHawk is being a complete replacement of Cordova on iOS platform, so that BlackHawk is fully compatible with Cordova's javascript API.

####Check-list of BlackHawk plugins:

##Requirements

  • iOS 8+
  • Xcode 7+ (Swift 2+)

##Architecture

Documentation of Architecture

##How to Use

###include as sub project

Drag BlackHawk/BlackHawk.xcodeproj into your project as a sub project.

###copy files

Copy www directory to your project, and add it to Build Phases > Copy Bundle Resources.

pic

###write some code

In anywhere you want to show a BlackHawk View Controller:

import UIKit
import BlackHawk

class ViewController: BlackHawkViewController {

... ...

###run on devices

If you want to run your project on a device, just do one thing:

pic

###That's it!

##What can BlackHawk be?

BlackHawk is cordova compatible, actually it's a javascript-native reflection bridge, cordova compatible layer is just one of many layers on it.

Obviously you can build your own layer based on your own protocol. Maybe next killer Hybrid Development Framework will be made by you!

##Make a plugin for BlackHawk

If you want to build a plugin named Nothing, you need to do 3 steps to make your plugin run:

  1. new a javascript file named Nothing.js in www/plugins directory

  2. add Nothing to the params of self.runPluginJS(["Base"]) in BlackHawkViewController class.

  3. do everything you want in Nothing.js, new a Swift file or not depends on you. If you want, just see:

    // js code
    Queue.push(Task.init(Queue.length, onSuccess, onError));
    window.webkit.messageHandlers.BlackHawk.postMessage({
        className: 'NothingClassName',
        functionName: 'functionName',
        taskId: Queue.length - 1,
        data: 'nothing'
    });

##Contribution

If you have any suggestions please open an issue, and you are very welcome to fork and submit pull requests.

####Plugins for BlackHawk will be best news!

##LICENSE BlackHawk is open-sourced software licensed under the MIT license.

Copyright (c) 2015 Leqicheng Inc. 乐其橙科技(北京)有限公司

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.