Git Product home page Git Product logo

blockly-ios's Introduction

The blockly-ios project is no longer actively developed by the Google Blockly team. If you are looking to create a new Blockly-based app, we recommend using the web version in a WebView. We have also create an XCode demonstration project that does exactly this.

Blockly for iOS

Blockly is a library for building drag-and-drop visual editors for JavaScript, Python, Lua, and several other programming languages.

Blockly for iOS is similar to its web counterpart in terms of API, but is:

  • Optimized for native iOS performance and easier integration in iOS apps
  • Written in Swift, with backwards compatibility for Objective-C projects
  • Designed with better touch support, such as custom input controls and multi-touch

Here is a demo of using Blockly for iOS to program a "turtle":

Blockly demo

Features

Blockly for iOS includes:

  • All major features available in Blockly for Web and Android
  • Multi-touch support (currently only on iOS)
  • Block animations (currently only on iOS)

Requirements

Supports devices running iOS 8.0 or above.

Get Started

To get started using Blockly for iOS, follow this guide.

To run through an exercise in creating an iOS app with Blockly, see our codelab.

API Reference

For complete API documentation, visit our API Reference Page.

License

Google is proud to offer Blockly for iOS for free and open source under the Apache License, version 2.0.

Community

Blockly has an active developer forum. Please drop by and say hello. Show us your prototypes early; collectively we have a lot of experience and can offer hints which will save you time.

Registration

Help us focus our development efforts by telling us what you are doing with Blockly. The questionnaire only takes a few minutes and will help us better support the Blockly community.

Contributing

Want to contribute? Great! First, read our guidelines for contributors.

blockly-ios's People

Contributors

anmatanm avatar boozook avatar corydcode avatar jimmycasey avatar midlis avatar mrniket avatar neilfraser avatar rachel-fenichel avatar roboerikg avatar shirletan avatar tsekityam avatar vicng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockly-ios's Issues

Refactor WorkbenchViewController

WorkbenchViewController needs to have its functionality split into smaller pieces. Some areas that could use refactoring are:

  • BlockView gesture recognizers
  • TrashCanViewController and ToolboxCategoryListViewController

Improve block rendering look and feel

BlockLayout:

  1. Make height a property of BlockLayout.Background
  2. Handle stroke widths for the background
  3. Potentially move logic from BlockLayout.performLayout(...) into BlockLayout.Background to make things easier to follow.

InputLayout:

  1. Handle stroke widths for the inline connector cut-out
  2. If more blocks can be added to the last block in the group, add a bit of space to the bottom of the middle part to show this is possible

BlockView:

  1. BlockView's highlight view frame needs to be larger than its parent frame since it highlights outside of the view's bounds

Layout/View Optimizations

Optimizations that should be done for Layout/View rendering:

WorkspaceView:

  1. When block layouts are removed from the workspace, all views in the workspace view are checked to see which layouts were removed.
  2. All block layouts are currently rendered into views regardless if they are visible on-screen.

Layout:

  1. Optimize refreshViewPositionsForTree(...) so it only recalculates view positions for layouts that are "dirty"

BlockLayout/BlockView:

  1. Reduce overdraw by limiting BlockView's frame to the block's background only (not all of its connected input children). However, the frame of the BlockView's tree should be kept as a property for BlockHighlighting purposes.

WorkspaceLayout:

  1. Optimize updateLayoutHierarchyForConnection(...) so it goes through the minimal number of layout passes

InputLayout:

  1. Updating self.absolutePosition eats into execution time. "swift_unknownRetainUnowned", "objc_loadWeakRetained", and "objc_...release" are called often and take about 15% of CPU time.

Add support for animating block transitions

Examples of things that can be animated:

  1. Block's being automatically moved from one position to another (e.g. when it snaps into place or it is bumped away)
  2. Block inline/statement fields growing/shrinking based on new blocks being added to it

Support arbitrarily placed workspaces

Blockly allows blocks to be dragged around on a (practically) infinite plane. This means blocks can be at negative workspace coordinates and the view needs to resize to fit them.

The standard implementation is to provide half a screen width of space between any edge and its nearest block so the user has room to add more content above, left, right, or below their current blocks.

Change FieldDate UI to use a popover

Right now, FieldDate is a text field that is edited with a date picker "keyboard". Instead, it should be a button that opens a date picker within a popover.

Replace UIWebView instances with WKWebView

WKWebView new API for iOS 8+, which offers performance improvements over UIWebView. Currently the code generator and turtle demo app use UIWebView, where they should be able to be replaced with WKWebView.

Turtle demo web code crashing when pressing "Run code" repeatedly

Initial findings indicate the crash code is from the web demo code, but it could also be from the CodeGenerator service.

EXC_BAD_ACCESS is thrown from a WebThread:

WebCore`void std::__1::__sift_up<WebCore::TimerHeapLessThanFunction&, WebCore::TimerHeapIterator>:
    0x11470d430 <+0>:   pushq  %rbp
    0x11470d431 <+1>:   movq   %rsp, %rbp
    0x11470d434 <+4>:   pushq  %rbx
    0x11470d435 <+5>:   cmpq   $0x2, %rcx
    0x11470d439 <+9>:   jl     0x11470d538               ; <+264>
    0x11470d43f <+15>:  leaq   -0x2(%rcx), %rax
    0x11470d443 <+19>:  shrq   $0x3f, %rax
    0x11470d447 <+23>:  leaq   -0x2(%rcx,%rax), %rcx
    0x11470d44c <+28>:  sarq   %rcx
->  0x11470d44f <+31>:  movq   (%rdi,%rcx,8), %r11
    0x11470d453 <+35>:  movq   -0x8(%rsi), %r8
    0x11470d457 <+39>:  movsd  0x8(%r11), %xmm1
    0x11470d45d <+45>:  movsd  0x8(%r8), %xmm0
    0x11470d463 <+51>:  ucomisd %xmm1, %xmm0
    0x11470d467 <+55>:  jne    0x11470d46b               ; <+59>
    0x11470d469 <+57>:  jnp    0x11470d476               ; <+70>
    0x11470d46b <+59>:  ucomisd %xmm0, %xmm1
    0x11470d46f <+63>:  ja     0x11470d489               ; <+89>
    0x11470d471 <+65>:  jmp    0x11470d538               ; <+264>
    0x11470d476 <+70>:  movl   0x24(%r11), %eax
    0x11470d47a <+74>:  subl   0x24(%r8), %eax
    0x11470d47e <+78>:  cmpl   $0x7ffffffe, %eax
    0x11470d483 <+83>:  ja     0x11470d538               ; <+264>
    0x11470d489 <+89>:  leaq   0x24(%r8), %r9
    0x11470d48d <+93>:  leaq   (%rdi,%rcx,8), %rax
    0x11470d491 <+97>:  addq   $-0x8, %rsi
    0x11470d495 <+101>: nopw   %cs:(%rax,%rax)
    0x11470d4a0 <+112>: movq   %rax, %r10
    0x11470d4a3 <+115>: movq   %r11, (%rsi)
    0x11470d4a6 <+118>: movq   0x28(%r11), %rbx
    0x11470d4aa <+122>: movq   (%rbx), %rdx
    0x11470d4ad <+125>: movq   %rsi, %rax
    0x11470d4b0 <+128>: subq   %rdx, %rax
    0x11470d4b3 <+131>: jb     0x11470d4c9               ; <+153>
    0x11470d4b5 <+133>: movl   0xc(%rbx), %ebx
    0x11470d4b8 <+136>: leaq   (%rdx,%rbx,8), %rdx
    0x11470d4bc <+140>: cmpq   %rdx, %rsi
    0x11470d4bf <+143>: jae    0x11470d4c9               ; <+153>
    0x11470d4c1 <+145>: shrq   $0x3, %rax
    0x11470d4c5 <+149>: movl   %eax, 0x20(%r11)
    0x11470d4c9 <+153>: testq  %rcx, %rcx
    0x11470d4cc <+156>: je     0x11470d512               ; <+226>
    0x11470d4ce <+158>: leaq   -0x1(%rcx), %rax
    0x11470d4d2 <+162>: shrq   $0x3f, %rax
    0x11470d4d6 <+166>: leaq   -0x1(%rcx,%rax), %rcx
    0x11470d4db <+171>: sarq   %rcx
    0x11470d4de <+174>: leaq   (%rdi,%rcx,8), %rax
    0x11470d4e2 <+178>: movq   (%rdi,%rcx,8), %r11
    0x11470d4e6 <+182>: movsd  0x8(%r11), %xmm1
    0x11470d4ec <+188>: ucomisd %xmm1, %xmm0
    0x11470d4f0 <+192>: jne    0x11470d4f4               ; <+196>
    0x11470d4f2 <+194>: jnp    0x11470d500               ; <+208>
    0x11470d4f4 <+196>: ucomisd %xmm0, %xmm1
    0x11470d4f8 <+200>: movq   %r10, %rsi
    0x11470d4fb <+203>: ja     0x11470d4a0               ; <+112>
    0x11470d4fd <+205>: jmp    0x11470d512               ; <+226>
    0x11470d4ff <+207>: nop    
    0x11470d500 <+208>: movl   0x24(%r11), %edx
    0x11470d504 <+212>: subl   (%r9), %edx
    0x11470d507 <+215>: cmpl   $0x7fffffff, %edx
    0x11470d50d <+221>: movq   %r10, %rsi
    0x11470d510 <+224>: jb     0x11470d4a0               ; <+112>
    0x11470d512 <+226>: movq   %r8, (%r10)
    0x11470d515 <+229>: movq   0x28(%r8), %rcx
    0x11470d519 <+233>: movq   (%rcx), %rax
    0x11470d51c <+236>: cmpq   %rax, %r10
    0x11470d51f <+239>: jb     0x11470d538               ; <+264>
    0x11470d521 <+241>: movl   0xc(%rcx), %ecx
    0x11470d524 <+244>: leaq   (%rax,%rcx,8), %rcx
    0x11470d528 <+248>: cmpq   %rcx, %r10
    0x11470d52b <+251>: jae    0x11470d538               ; <+264>
    0x11470d52d <+253>: subq   %rax, %r10
    0x11470d530 <+256>: shrq   $0x3, %r10
    0x11470d534 <+260>: movl   %r10d, 0x20(%r8)
    0x11470d538 <+264>: popq   %rbx
    0x11470d539 <+265>: popq   %rbp
    0x11470d53a <+266>: retq   
    0x11470d53b <+267>: nopl   (%rax,%rax)

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.