Andrew C

Andrew C

Joined almost 7 years ago

  • 1 story
  • Posted to PaintCode & Sketch: Convert your Sketch drawings into Swift or Objective-C, in reply to Maciej Jurczak , Apr 01, 2016

    If you want to generate cgpaths in Swift, some time I go I've made this: (hopefully it still works, I haven't had to do ios in a few months and haven't checked up on this plugin to see if sketch updates broke it)

    0 points
  • Posted to Split screen map-view and list-view mobile apps, Aug 04, 2015

    Do you want something like urbanspoon where there is a small map and a scrollable list below and both are fixed. Or more like google maps where as you scroll the list it starts covering up the map?

    0 points
  • Posted to Squish for Mac, Jun 07, 2015

    The real question is... what's the Weissman score for Squish?

    2 points
  • Posted to Bohemian Coding playing around with an online Sketch viewer?, Jun 07, 2015

    Seems that they have some a server that either on the fly converts a sketch file based on id into a list of png's or they do it in the background and reference it. Here's where all those images on the page are coming from:

    1 point
  • Posted to The hardest parts of computer science - Developer Tea Ep. 8, Jan 20, 2015

    Entirely agree with naming things being the hardest thing in programming. Yeah documentation is ideal, but most of the time your variable names become your documentation, whether that be because you're running out of time on a project, or the piece of code has been rewritten without updating the documentation. Actually, having stale documentation is worse than having no documentation. But that's a separate topic.

    Let's exclude the majority of PhD students that program with variable names strictly being single english letters or greek letters (alpha, beta, etc), since that code becomes impossible to read and debug after about a month. Maybe it's just my Stanford friend and his phD department that does that... but I'm assuming that's common practice. So yeah, let's exclude that section of programmers, because naming things as single letters (unless it's i,j,k) is insane.

    Now, let's imagine you're working in a company with hundreds or thousands of developers who aren't clones of each other, so the codebase has conflicting conventions which cause a lot of confusion. Should you name a "person model" file PersonModel or just Person? Should you make all your ios View files have the word View in them? Do you call your initializer function "init", "setup", "configure", something else? Do you call things that touch the database fetchX, fetchY, as oppose to getX, getY? Do people know that fetch is an expensive db call and get isn't? And that one time someone called the function "getItem", did they mean to call it fetch? Or should it actually not touch the database, or is it backed by a cache, and is only slow the first time. So most of the time it's actually a get, so don't worry about it? So should you spend the rest of the day investigating this potential issue, or is the weird database call coming from somewhere else and the guy that wrote that call knew what he was doing? How far does this naming rabbit hole go?

    In my experience, hard mathematical questions are rare in industry level programming. You have your search, sort functions as libraries. You have your lists and dictionaries. And anything weird you hope you can find as a library and fuse it into your code somehow, because if it's anything that complex it's probably not worth spending the engineering effort (we've got other lower lever fruit to implement first, and hopefully by that time, someone will have written a library for that complex math thing). Good luck reading the library and trying to understand it though. Unless it's written by some big company, the api calls probably make no sense, and you have no idea if it will have any adverse side effects.

    And now you have to figure out how to name your things, such that the next guy (or you in a few months) will know what you were thinking. Also, since 6 months ago when you named the function getAllFiles, the product has changed, where getAllFiles actually means get all pdf files. Because at the time you though "all" meant all the files the database has. And the only files at the time were pdf's. But now there are pdf's, png's, jpg's, etc and there is "getAllFiles" and "getAllFiles2". Whoever wrote getAllFiles2 was probably afraid that if he were to change the original function, it would break everything else in the code. So adding another function seemed fine at the time, after all it does actually get all the files, so what else would it be called?

    Hopefully you get the idea by now.

    2 points
  • Posted to Convert Sketch shapes to ios cgContext swift code, Dec 02, 2014

    Hey guys, I created a sketch plugin to export sketch artboards to ios swift code to put into your drawRect method. This way you can draw a shape in sketch, export it, and paste it into your swift file. Of course there are a number of limitations like shapes have to be flattened and boolean operations won't work. And depending on how complex your shape is, pasting might show a spinning beach ball (unless it crashes it will eventually succeed, could run for a minute). If someone could tell me how to make sketchplugin save to a file without crashing that would be great :) .

    So, it's still a work in progress, but it has been helpful for me so far, so maybe some of you will find it useful too.

    0 points
  • Posted to Sketch - What is the best way to get started?, Nov 14, 2014

    Up until 1-2 years ago I've done all my development (I wouldn't have called myself a designer back then, still not sure if I can call myself that now) with html and css like you. Illustrator confused me mostly because none of the design terminology made any any sense. Sketch somehow clicked though.

    Somewhere early on I watched a bunch of videos about the features of sketch, just to see what's possible. Also just watching people use sketch on youtube helped me figure out how people do things. Even if you can't replicate it, the first step is to raise your standards. Of course, the second step is trying to meet those standards yourself.

    To start on web development with sketch, I'd advise you to try to copy a website (your own, or some you like). Start with just the header or just the footer. Screenshot that part and paste it into sketch and lock the picture (cmd+shift+l). Then try to draw rectangles and text on top of it. It will probably look like shit at first, mine certainly did. Don't spend too much time if the colors, alignment, spacing don't match up too exactly, etc. You can always add your own guides (ctrl+r, then click on the ruler for the red thing to appear) or add rectangles as guides. Then you can align things to the guides or other objects (have something selected, hold alt and move your mouse around). Just get it as close as possible without spending too much time on it. You will get better over time and trying to make things exact at first will just frustrate you more than you will learn by doing the same sketch over and over again. Try copying a different designs, you'll attain perfection over time.

    Logos and Icons I find to be more complicated because it's a different mindset. Here, boolean operations (union, subtract, intersect, difference) are the magic sauce. For instance, to create a plus, you can take a rectangle, duplicate it, rotate the duplicate 90 degrees and then union the two. Or you could have always tried drawing out the shape with a path. Also, note how if you grouped the 2 shapes instead of union them they will look differently (if they have a border). You can always flatten a shape that had a boolean operation done on it.

    Download the android icon set and see how they are done, especially the path, and bezier control points (click enter on a shape to go into that mode). Also look at apple design template (file > new from template > ios UI Design, then go to the Symbols page). Specifically look at the back chevron "<". All it is, is 2 rectangles unioned together, then rotated 45 degrees. Also, the standard cloud icon is pretty much a bunch of circles and rectangles of different sized that have been unioned together. You need to get into this way of thinking, that making an icon isn't just drawing out the shape by hand. And looking at these simple icons will help you figure that out.

    0 points
Load more comments