Live data from Hacker News

Surprises When Designing An iPhone App

jackg.org

41–50 of 54 posts

Re: Surprises When Designing An iPhone App

#41
post #15

I'm designing iOS and Android apps full-time for over a year now. A couple of tips from me: - He's very right about previewing on the device. I like xScope better than Silkscreen, because it can stream anything, both file, or screen region, and overall it's a nice designer's utility belt. There's nothing like that for android, at least I haven't found anything that works, and Android needs this even more, because it…

I've found that Skala Preview is also a very solid app for live previewing. Somewhat different to others, it integrates with Photoshop for live retina previews. I've no association, its just a great app.

http://bjango.com/mac/skalapreview/

Re: Surprises When Designing An iPhone App

#43

For bolding text, create an attributed string and draw it with CoreText. http://stackoverflow.com/questions/8322020/display-nsattribu... If you only support iOS 6, you can use a UILabel and set the "attributedText" property. I notice a lot of new iOS developers jump to open source libraries to abstract away important frameworks. It might save an hour, but I think it's counterproductive to not do things by hand the fi…

Adding a little more detail: To stylize your content, you create a 'mask' by specifying the character ranges that you want to change, and then applying attributes to the string

Snippet to take a gray-colored string "Hello World", and then make "World" show as a black color (from memory):

  NSString *theEntireLineOfText = @"Hello World";
  UIColor *boldColor = [UIColor blackColor];
  UIFont *myFont = [UIFont fontWithName:@"Helvetica" size:12.0];
  UIColor *baseColor = [UIColor grayColor];
  NSDictionary *subAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
                              myFont, NSFontAttributeName, boldColor,NSForegroundColorAttributeName, nil];
   NSMutableAttributedString *mainText = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",theEntireLineOfText] attributes:@{NSFontAttributeName:myFont,NSForegroundColorAttributeName:baseColor}];
  // Make the word "World" black"
  NSRange range = NSMakeRange(0,[@"World" length]);
        [mainText setAttributes:subAttrs range:range];

Re: Surprises When Designing An iPhone App

#44

"there must be an iOS equivalent of the tag, right? Apparently not." It's not a silver bullet (it can sometimes give you a bit of a performance hit), but the Nimbus library has a UILabel subclass that makes bolding a substring a lot less painful than manual NSAttributedString munging: http://docs.nimbuskit.info/group___nimbus_attributed_label.h...

I found NIAttributedLabel to work quite nicely for this and it's pretty straightforward.

Re: Surprises When Designing An iPhone App

#45
post #30

Earlier quoted context omitted.

You might be interested in something I plan to open source at some point: a native Markdown lexing / parsing engine meant to be used to stylize markdown for Core Text / NSAttributedString. Here's the meat of it in a gist: https://gist.github.com/29dabe4b6e762ee221df

Thanks a lot for the link, I was going to write Markdown -> NSAttributedString library myself, because I couldn't find one. Right now I'm just using DTCoreText and convert Markdown to HTML on the server.

You might also want to look into GitHub's Sundown library. It's an awesome library and being written in pure C, you can use it natively.

The reason I wrote myself is that my use case was more markdown highlighting than markdown parsing. I needed to preserve the markdown source untouched, which Sundown doesn't support.

https://github.com/vmg/sundown

Re: Surprises When Designing An iPhone App

#46
post #15

I'm designing iOS and Android apps full-time for over a year now. A couple of tips from me: - He's very right about previewing on the device. I like xScope better than Silkscreen, because it can stream anything, both file, or screen region, and overall it's a nice designer's utility belt. There's nothing like that for android, at least I haven't found anything that works, and Android needs this even more, because it…

Slicy is a gift from god. Not only does it save time but it makes it easy to do a full batch export of all assets, at 1x and 2x resolutions.

Re: Surprises When Designing An iPhone App

#47
I designed at 2x (even pixel sizes) for a long time. Now I design at 1x using vector shapes. With vectors you can double the size and remain perfectly crisp. My workflow is now MUCH faster.

Bonus: 1x comps are better sized for clients to view on non-retina screens anyway. I always got complaints showing giant 640px wide mockups…

Re: Surprises When Designing An iPhone App

#48

"there must be an iOS equivalent of the tag, right? Apparently not." It's not a silver bullet (it can sometimes give you a bit of a performance hit), but the Nimbus library has a UILabel subclass that makes bolding a substring a lot less painful than manual NSAttributedString munging: http://docs.nimbuskit.info/group___nimbus_attributed_label.h...

The typical solution where I work is, if I recall correctly, a TTTAttributedLabel: https://github.com/mattt/TTTAttributedLabel

Re: Surprises When Designing An iPhone App

#49
post #15

I'm designing iOS and Android apps full-time for over a year now. A couple of tips from me: - He's very right about previewing on the device. I like xScope better than Silkscreen, because it can stream anything, both file, or screen region, and overall it's a nice designer's utility belt. There's nothing like that for android, at least I haven't found anything that works, and Android needs this even more, because it…

My designer works in indesign, designs for 1x and scales up. As long as you know that images are 50%, it's much faster then doing everything in even pixels.

Re: Surprises When Designing An iPhone App

#50
post #40

Earlier quoted context omitted.

And since it's a closed ecosystem, there's no way for a startup to come along and make the process easier. It all lies on Apple.

Testflight has made it a LOT easier, granted Apple could change things entirely one day and leave them dead in the water. XCode has significantly improved in auto provisioning too, still painful when something breaks, but not as bad as it was.

+1 on Testflight. May that day never comes.
Post reply on HN