iOS – Collin Brewer https://collinbrewer.com Coder / Marketer / Consultant Mon, 04 Jul 2022 13:09:26 +0000 en hourly 1 https://wordpress.org/?v=4.7.4 117647076 Vault https://collinbrewer.com/work/vault/ Mon, 12 Sep 2016 18:30:33 +0000 https://collinbrewer.com/?post_type=x-portfolio&p=60 I designed and developed Vault to offer a classier alternative to the plethora of “hidden calculator” apps.

The post Vault appeared first on Collin Brewer.

]]>
I designed and developed Vault to offer a classier alternative to the plethora of “hidden calculator” apps.

The post Vault appeared first on Collin Brewer.

]]>
60
Gusto for iPad https://collinbrewer.com/work/gusto-for-pad/ Sun, 21 Sep 2014 16:38:49 +0000 https://collinbrewer.com/?post_type=x-portfolio&p=96 Armed with nothing but AA Trees and Objective-C, I set out to build the world’s first, fully editable, syntax-colored, code editor for the iPad. Regarded by PC World as one of the “Top $10 iPad Apps Worth Paying For” Read the review by PC World

The post Gusto for iPad appeared first on Collin Brewer.

]]>
Armed with nothing but AA Trees and Objective-C, I set out to build the world’s first, fully editable, syntax-colored, code editor for the iPad.

Regarded by PC World as one of the “Top $10 iPad Apps Worth Paying For”
Read the review by PC World

The post Gusto for iPad appeared first on Collin Brewer.

]]>
96
Gusto Syntax Editor https://collinbrewer.com/work/gusto-syntax-editor/ Mon, 01 Sep 2014 15:11:18 +0000 https://collinbrewer.com/?post_type=x-portfolio&p=85 Armed with nothing but AA Trees and Objective-C, I set out to build the world’s first, fully editable, syntax-colored, code editor for the iPad.

The post Gusto Syntax Editor appeared first on Collin Brewer.

]]>
Armed with nothing but AA Trees and Objective-C, I set out to build the world’s first, fully editable, syntax-colored, code editor for the iPad.

The post Gusto Syntax Editor appeared first on Collin Brewer.

]]>
85
Gusto Syntax Highlighting https://collinbrewer.com/work/gusto-syntax-highlighting/ Fri, 12 Oct 2012 11:59:39 +0000 https://collinbrewer.com/?post_type=x-portfolio&p=108 After building Gusto’s text editor from scratch, I had a good idea of the memory and performance limitations of the iPad, so I knew I’d be in for a challenge to provide really good quality code coloring for Gusto. Criteria 1: Flexible Interpolation I noticed that many syntax highlighting engines seem to struggle with interpolation, both basic things like single quotes interpolated with ...

The post Gusto Syntax Highlighting appeared first on Collin Brewer.

]]>
After building Gusto’s text editor from scratch, I had a good idea of the memory and performance limitations of the iPad, so I knew I’d be in for a challenge to provide really good quality code coloring for Gusto.

Criteria 1: Flexible Interpolation

I noticed that many syntax highlighting engines seem to struggle with interpolation, both basic things like single quotes interpolated with double quotes, but also with more complex situations, like Javascript being nested within HTML, that may be in a file that has an ‘.asp’ file extension, or CSS definitions inside of HTML that is being echo’d by PHP.

It was for this reason that I decided I would need to make sure the syntax engine was able to switch gears, without caring about file type, current scope, etc.

I decided the best approach for solving the interpolation issue was to make sure languages weren’t identified by file type alone, but also by the syntax itself.  This allowed me to write syntax definitions based on specific scopes, and not necessarily be limited to language.  This solved many issues:

  • Files with mixed languages could be parsed dynamically
  • Common language constructs like double quoted strings could be referenced from multiple syntax language definitions without being redundant
  • Fast! Because of the tree-like structure, hundreds of possible syntaxes were quickly reduced to a few after looking at the file type and first line of the code, resulting in huge performance increases

Criteria 2: Priority or Exclusion

Another concern was priority of coloring, for example: Should quoted strings be a different color if they are within a comment block?

I concluded that syntax was not linear, but instead a tree of nested ‘modes’ .  This was an important distinction in choosing the correct data structure for storing the syntaxes and the parsed results.

Criteria 3: Expandable

I couldn’t very well sit and write hundreds of syntax parsers so I wanted to make sure I chose a method that was serializable, could be easily coded up by end users and plugged in to the eco-system without any fuss.

I constructed a very simple XML convention that allowed for syntax scopes to be mapped to about ten possible scopes like ‘boolean’ or ‘string’.  These would be mapped to the colors within each theme.

 

Criteria 4: Performance

After dealing with performance issues building the text engine I immediately jumped in with binary trees for storage, however, after everything was wired up, I was still struggling with performance.  I rethought my strategy.

Consider that every time a character changes in code, a ‘re-parse’ is needed.  A single ‘*’ could complete a block comment ‘/*’ making the rest of the document part of a comment, requiring a tear-down of the entire tree we’d built, a potential time cost of O(log(n)) for lookup, O(log(n)) for deleting the rest of the tree, and another O(log(n)) for rebuilding the tree.

This being said, I determined that it was equally as important to focus on deletion performance as it was insertion performance.  I moved away from my binary tree and onto a doubly linked list.  Immediately, this allowed me to benefit from O(1) insertions and deletions, a considerable improvement over the binary tree.  Now if you’re keen on time complexity of data structures, you may be asking, but aren’t linked list lookups O(n)?!?

Good eye!  The answer is yes, but, all of this isn’t happening in a vacuum, it’s happening in a text editor.  Because of this, the majority of lookups stem from changes to text that happen sequentially.  Because of this I was able to majorly increase lookup performance by maintaining a reference to the last accessed item in the list, instead of starting over from the first item in the list.  This still means worst case scenario O(n), however best case can be O(1)! Which like I said, is very common, because it’s part of a text editor.

All in all, building the syntax engine for code coloring Gusto was a great exercise in architecting a ecosystem through and through and was a very validating project to see it all come together.

The post Gusto Syntax Highlighting appeared first on Collin Brewer.

]]>
108
Gusto App Design https://collinbrewer.com/work/gusto-app-design/ Wed, 10 Oct 2012 17:46:07 +0000 https://collinbrewer.com/?post_type=x-portfolio&p=49 When the Apple App Store was running rampant with skeuomorphism, I designed the user interface for the Gusto IDE for the iPad. From linen-fabric backgrounds and fibrous textured paper, to drop shadows and inset text, Gusto was a wondrous skeuomorphic landscape of real-life elements glued to bajillions of iPad pixels. Heralded by SuberApps to be one of forty useful iPad apps with ...

The post Gusto App Design appeared first on Collin Brewer.

]]>
When the Apple App Store was running rampant with skeuomorphism, I designed the user interface for the Gusto IDE for the iPad.

From linen-fabric backgrounds and fibrous textured paper, to drop shadows and inset text, Gusto was a wondrous skeuomorphic landscape of real-life elements glued to bajillions of iPad pixels.

Heralded by SuberApps to be one of forty useful iPad apps with “Beautiful Interfaces”
See SuberApps Review

 

The post Gusto App Design appeared first on Collin Brewer.

]]>
49