Posts Tagged 'Programming'

UACellBackgroundView

So it’s pretty easy to customize the look of regular table views, pretty much set background to [UIColor clearColor] and you’re done, but no doubt you’ve noticed it’s quite considerably trickier to customize the look and background of grouped tables, specifically getting those @(#&Y$!! corners right. Well, here is UACellBackgroundView to sort that out for you:

How to Make Custom Drawn Gradient Backgrounds in a Grouped UITableView with Core Graphics

that lets you produce pretty gradient cells like this with just a couple lines of code in your regular table handling:

mac_screenshot.png

Very nice, very nice. Based on this Stack Overflow question, which you can find more exposition on here; but hey, it only took us a few minutes to toss UACellBackgroundView into our current panic for a nice shininess upgrade — and it’s all about the shiny! — so no need to look further, really.

Continue Reading →
0

cocos2d + Particle Designer

So that awesome toy^H^H^H development assistant Particle Designer that we mentioned a while back is now officially released and you can download it from its new website — for only $7.99 USD, what a deal we’ve got ours! — and there is a completely unexpected (by us, anyways) feature; it integrates directly with cocos2d.

Yep, cocos2d 0.99.3-rc released today has support for Particle Designer:

In order to use the particles created with it you should:

1. Download & Register Particle Designer (you need to register it in order to save the particles)

2. Use the “cocos2d (plist)” format when saving the texture (you can embed the texture or not. cocos2d supports both format)

To load a particle created with Particle Designer you should do:

// Either you can create a Quad particle system

id particleSystem = [CCQuadParticleSystem particleWithFile:@"MyParticle.plist"];

// …or a Point particle system.

id particleSystem = [CCPointParticleSystem particleWithFile:@"MyParticle.plist"];

cocos2d supports all the Particle Designer features…

It’s just like getting a heaping helping of awesome sauce on your awesome sundae, isn’t it now?

[UPDATE: And now with tutorial video!]

Continue Reading →
4

CoverFlow Tutorial

Here’s an excellent tutorial on how to, well,

… help you add a cool effect called the “cover flow/open flow” effect to any of your iphone apps. This is cool in two ways actually. One it adds animation kind of effect to your app and the other, its very easy to build too…

It’s based on the OpenFlow project that we actually mentioned in passing before, but if you haven’t checked that out yet this is a great place to start!

Continue Reading →
1

Tip: TCP and SSL

You may have noted in QA1652 that is now possible to use NSStreams for your TCP communication needs even though the iPhone has no NSHost class, by leveraging the NSStream <-> CFStream toll-free bridge; but we’ll bet you didn’t know that you can encrypt them with SSL easily:

… The way that we enable SSL encryption is to simply use setProperty:forKey: on both streams, setting the key NSStreamSocketSecurityLevelKey to a value that specifies the version of SSL to use. If you want to tell NSStream to use the highest version supported in common with the remote connection, specify NSStreamSocketSecurityLevelKey. That’s what you’ll usually want…

However, that’s for a somewhat optimistic value of “easily”:

… This code will work if everything is perfect. However, by default, SSL support in NSStream is a little paranoid. It won’t, for example, use a self-signed certificate or an expired certificate to establish a secure connection. NSStream does a number of validity checks when establishing the secure connection, and if they don’t all pass, the streams appear to be valid, but no data gets sent or received. This is somewhat frustrating…

Read the whole article for further advice and sample code!

Continue Reading →
0

Streaming in OpenAL

For the latest in our “just in case you ever need to know how” notes, here’s what looks like a comprehensive study in

Streaming in OpenAL

streamingHighLevel2.png

Not that there appears to be anything particularly wizardly technical about streaming in OpenAL compared to streaming using any other set of APIs, but hey, it beats having to figure out all the appropriate calls yourself!

Continue Reading →
1

Tip: Grayscale UIImage

Here’s a handy routine to easily convert an UIImage to grayscale, like this:

grayscale.png

- (UIImage *)convertImageToGrayScale:(UIImage *)image

{

  // Create image rectangle with current image width/height

  CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height);

  // Grayscale color space

  CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();

  // Create bitmap content with current image size and grayscale colorspace

  CGContextRef context = CGBitmapContextCreate(nil, image.size.width, image.size.height, 8, 0, colorSpace, kCGImageAlphaNone);

  // Draw image into current context, with specified rectangle

  // using previously defined context (with grayscale colorspace)

  CGContextDrawImage(context, imageRect, [image CGImage]);

  // Create bitmap image info from pixel data in current context

  CGImageRef imageRef = CGBitmapContextCreateImage(context);

  // Create a new UIImage object

  UIImage *newImage = [UIImage imageWithCGImage:imageRef];

  // Release colorspace, context and bitmap information

  CGColorSpaceRelease(colorSpace);

  CGContextRelease(context);

  CFRelease(imageRef);

  // Return the new grayscale image

  return newImage;

}

That would be a stylish effect for a “please wait” pause or the like, we figure.

Continue Reading →
1

BarTint

Here’s a handy-looking little tool called BarTint for playing with your interface colours:

BarTint is a tool for developers and designers of iPhone apps, to assist in the visualization of the various bar-type objects (toolbars, navbars, segmented controls) when a tint color has been applied to them.

Because of the gloss and caustic shader applied to these objects, when you specify a color, you don’t necessarily get what you think you’re going to get. BarTint takes the guesswork out, letting you see exactly what a color combination looks like on the device, and allows you to forward the Objective-C required to produce that UIColor to yourself over email…

BarTint.jpg

Very nice, very nice. And FREE, no less!

XPilot

Continue Reading →
3

Generating Barcodes

So, you want to generate barcodes on your iPhone screen?

OK, well neither do we at the moment, or any time in the past for that matter; but just in case the idea ever comes up, here’s a new library (well, a new port) for you:

Cocoa-Touch-Barcodes

This is a fork of Jeff Lamarche’s Cocoa Barcodes project, with the code modified to work on the iPhone and iPad. In my testing, a CCD and laser scanner can read UPC and Code 128 barcodes directly from the screen w/ no issue…

Handy if you need it!

Continue Reading →
1

Icon template

[UPDATE: Now points to the iPhone 4 savvy version!]

Here’s a handy template for your iPhone and iPad icon design needs:

ists
iPhone-4-icon-PSD.png

- 512 pixels, iTunes Store style (Caution: very ugly. Talk to Apple about that, not me.)


- 512 pixels, iPad style (either have different overlays. Who’d have thought?)


- 512 pixels, iPhone style.


- 72 pixels for iPad home screen.


- 57 pixels for iPhone home screen.


[UPDATE: -114 pixels for iPhone 4 home screen!]

- 48 pixels for iPad Spotlight (with Spotlight background).


- 29 pixels for iPad / iPhone Settings and iPhone Spotlight (with both backgrounds).

Yes, it is getting complicated these days, isn’t it?

h/t: MacFanatic!

UPDATE:

And here is a post about another icon template for Illustrator CS 5; and if you’re wondering about appropriate sizes for icons for Android, Linux, Windows, Safari, or anything else, check out their

Icon Reference Chart

And here is a script, iPhone-Photoshop-JSX-Icon-Exporter, to create all the needed sizes from one 512×512 icon.

And here is iOS Icon Template for Perfectionists, reputedly correcting a corner issue with the above template.

And finally, QA1686 App Icons on iPad and iPhone is where you should go for the current Final Word™!

Continue Reading →
1

Data Entry Screens

Here’s a worth reading post on how to make data entry screens that center the current entry field above the keyboard by simply using a UIScrollView, instead of the mess of hardcoded animation blocks that we’ve been using up ’til now:

How To Create A Data Entry Screen

Couple problems with the code as presented, but read to the end of the comments and apply the keyboard notification responses there and you’re just about good!

Continue Reading →
1
Page 60 of 90 «...3040505859606162...»