Archive for 'Programming'

Embedding an HTTP Server

Now here’s a topic we haven’t posted anything on for multiple years now: embedding an HTTP server in your app. More specifically, making it convenient to do so, with

Java-style servlets in Obj-C using Mongoose Server

… in this post I’ll introduce a wrapper class for the Mongoose web server which tries to emulate the concept of Servlets, common to Java developers… Also note that while the sample project is aimed towards iOS devices, you should be able to use this wrapper in any Objective-C project…

If you’ve got something like a scripted game in progress, this kind of thing can save you a whole lot of cycles during development, indeed. If it looks like something worth looking into further for you, hey here’s the code on github to check out!

Continue Reading →
2

Glossy Buttons

So it’s been a while since our last shiny buttons post — and why yes, yes it’s time for an update; here’s a piece of code that looks like our new goto library for the shiny thing:

iPhone Glossy Buttons

The two points I was after was the “rounded” gloss on the top, and the neat highlights at the top and bottom to give the button the appearence of being inset in in the surface and rising above it.

So I looked everywhere on the net for code for such a button, without success … Anyway, I had to come out with my own code, and this meant understanding how Core Graphics does clipping – not a small thing!

rounded_button_2.png rounded_button_1.png

Now that’s some nicely done shininess, indeed. Definitely looks like we’ll be adopting that.

h/t: @rwenderlich!

UPDATE:

Custom shapes, borders, and gradients: waterlou / UIGlossyButton!

Continue Reading →
0

Tip: Auto Build Numbering

Here’s a handy tip for, as the title says,

Auto-incrementing Build Numbers in Xcode

What we want to do is to have the build number available in our Info.plist file, so that it can be read and displayed at run-time. And we also want Xcode to automatically increment this number for every build.

Add a key named CWBuildNumber to your Info.plist file, and set it to a sane start value, maybe “0″… Secondly we want to rewrite the target’s source Info.plist file, not the file bundled with the application, so make sure to order the script phase before the Copy Resources phase. Then just add this tiny script phase to your target build:

Works nicely no doubt, but around here we don’t want every build to auto-increment exactly; how we like to set our projects up is that in Info.plist CFBundleShortVersionString is the version string displayed in the App Store, “1.0″ and so forth, whilst CFBundleVersion is the number of the Subversion revision it was built with. Makes matching up code with bug reports trivial, that does. And the script there is applicable to that strategy too; just instead of incrementing by 1, set it to the output of svnversion:

svnversion is a program for summarizing the revision mixture of a working copy. The resultant revision number, or revision range, is written to standard output.

It’s common to use this output in your build process when defining the version number of your program…

Not so common in the iOS world, especially since everyone and their dog seems to use git these days for no compelling reason we can figure out; but it works nicely for us to identify the code that goes with a given build instantly.

Continue Reading →
5

NYXImagesUtilities

This looks pretty handy for a variety of image manipulation needs:

Introducing NYXImagesUtilities

1. Filtering

This category allows you to apply filters on a UIImage object, currently there are 3 filters : Sepia, Grayscale and changing opacity…

2. Masking

This category is composed of a single method which allow to mask an image…

3. Resizing

This category can be used to crop or to scale images…

4. Rotating

With this category you can rotate or flip an UIImage object…

Handy enough with that, but it’s been on rather a roll of updates since:

New category for NYXImagesUtilities : Saving

New category for NYXImagesUtilities : Reflection

New category for NYXImagesUtilities : Blurring

And at this rate, no doubt quite a few more by the time you check out the code from github!

UPDATE:

NYXImagesUtilities becomes NYXImagesKit

Continue Reading →
1

App Design Process

Here’s an interesting read on the process of designing an app:

The Process of Visually Actualizing an iPhone App (But Losing the Race)

Since I had a bunch of design work made for an app that did not reach App Store in time, I thought: Why not share this in a blog post so that people can see and feedback on parts of the design process that I use and advocate? So, here is a selection of some of the visual deliverables that I regularly produce in a mobile app project…

That sound like it’s a bit heavy on the paper side for you? There’s a number of visual design helpers springing up these days too. A couple that’ve caught our eye recently:

Prototypes is a $40 Mac app that lets you deploy mildly interactive image mockups to the device.

AppCooker is a $20 iPad app that has a really rather remarkable current and allegedly forthcoming feature set for all sorts of app design tasks; check out the review here.

The blog that review is from also has a previous series which looks like it nicely summarizes the state of app design up to the two just mentioned:

Prototyping tools for iOS app Design: Part 1 – classification

Prototyping tools for iOS app design: Part 2 – Pen, Stencils

Prototyping tools for iOS app design: Part 3 – Bitmap based kits

Prototyping tools for iOS app design: Part 4 – Vector based kits

Prototyping tools for iOS app design: Part 5 – Applications

Prototyping tools for iOS app design: Part 6 – Libraries

So getting through all that should bring you pretty much up to speed on the state of the union in design tools, we trust.

Aaaand while we’re collecting design-related stuff, here’s some more worth reading recentish links with hints and tips:

iOS Usability Tips and Resources for iPhone and iPad Apps

A Useful Collection of iPhone/iPad Apps Developer Tools and Resources

All It Needs Is Love

Money Can’t Buy You Love: Why Some Apps Work, Some Don’t

HOW TO: Create a Blockbuster Mobile App

h/t: @joe_carney, @globalmoxie, @Dylan_Beadle, @jfmartin67

Continue Reading →
1

Unit Testing Intro

So apparently tutorial juggernaut Ray Wenderlich is actually a franchise these days. When did that start? Haven’t been paying enough attention, apparently. But the team seems pretty solid, if this latest one we noticed is any indication:

Unit Testing in Xcode 4 Quick Start Guide

We’ll cover how to set up Xcode to use three different unit testing frameworks:

  • OCUnit, which is the unit testing framework built into Xcode
  • GHUnit, which is a third party framework with some extra cool features
  • OCMock, which helps you write mock objects to aid tricky testing scenarios

Good stuff, good stuff.

UPDATE:

It’s from Mike Ash, so you know it’s worth reading: Writing Unit Tests

Objective-C Library Of Matcher Objects For OCUnit, GHUnit, Cedar, More For Easier Testing

Continue Reading →
3

Tip: UIWebView Resizing

So let’s say you’ve got some rather long scrollable content you’re formatting on the fly in a UIWebView. And then the client decides they want the font size to be user changeable. No problem you think, tick ‘Scales to Fit’ and ‘Multiple Touch’, and …

… and now your content is drawn at ‘unreadable squiggle’ size. Whoops. But lo, courtesy of this Stack Overflow question, here’s a super easy way around that:

If you have control of the web page, it is easier to control the UIWebView with http than programmatically.

<meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;” />

<meta name=”apple-mobile-web-app-capable” content=”yes” />

Handy, that ‘viewport’ thingy!

Continue Reading →
0

Twitter Workshop

So how about that iOS 5? Pretty nifty [REDACTED] huh? And have you checked out [REDACTED] yet? And woah, man look at [REDACTED] will you?

But you can find links to all that good stuff plenty of places no doubt; here’s a non-redacted, why non-WWDC even, one you might have missed and if you’re around San Francisco on Wednesday you probably want to check out:

Twitter and iOS – an Integration Workshop

Hi everyone,

We’re incredibly excited about the announcement that Apple made at WWDC today. We believe that Twitter’s deep integration with iOS is going to open up a lot of exciting opportunities for developers. For your apps, this includes:

  • single sign-on and lightweight identity
  • taking advantage of the tweet sheet feature
  • the ability to tweet a photo from your app
  • pulling down a user’s following graph

and a whole lot more. As part of the announcement, we’re looking to host a workshop at Twitter’s headquarters this Wednesday (6/8) from 6:30pm to 8:30pm at 795 Folsom Street. At this event, we’ll cover what the integration hooks mean for developers. Loren Brichter will also be talking about ABUIKit, a UI framework specifically for Mac, which we’ll be open-sourcing.

… RSVP at [this] link

We hope you’ll be able to join us for the evening.

–@jasoncosta

Good stuff, good stuff. As apparently the last person on the planet with a computer that has managed to avoid getting a Facebook account so far, we’re certainly quite pleased indeed that Apple chose the correct social platform to integrate with!

h/t: @alanQuatermain!

UPDATE:

Further interesting commentary here: How Twitter + iOS 5 Will Change Mobile Apps

Continue Reading →
0

Game Developer Resources

OK, now this is one seriously epic collection of development-related links, not iOS focused but worth a read nevertheless:

The Ultimate Indie Game Developer Resource List

This is a list of SERVICES, free and not, that will help you on your path to STARTING and FINISHING a game and SELLING it. Articles are NOT included. If you would like to read articles, check out The Big List of Indie Marketing and Business Tips, 100+ Resources for Video Game Professionals or The Game Programming Wiki

Covers engines, libraries, art, sounds, fonts, deployment, websites, commerce marketing … well, pretty much everything, really!

h/t: @IndieToolShed!

Continue Reading →
0

Moai SDK

The good folk over at ManiacDev have a pointer to a new cross-platform SDK coming out — Moai “The mobile platform for pro game developers”:

The open source Moai SDK enables game developers to focus on great gameplay and content, code in the easy-to-use Lua scripting language they already know, use ready-to-roll libraries for animation and physics, and avoid rewriting game code for different devices…

Now, what makes this one better than the also Lua-based Corona SDK which at first glance seems aimed at about the same space and is rather popular? The big one seems to be this “Moai Cloud” bit:

Ready-to-scale cloud service for Lua game logic, databases and additional game content. Offer unlockable game content, store persistent player and world state, and write multiplayer logic in the scripting language you’re already using…

That does look like something pretty nifty actually. And hey, the pricing sounds right:

There are game engines aimed at huge studios that cost a million bucks. Others that cost a few thousand. Some for aspiring indie game makers that are nearly free – but any games that succeed will have to pay fat royalty percentages. None of these models seem right to us. That’s why developers can build games with Moai SDK for free, release them for free, and even those who score big hits won’t owe royalties based on their use of the Moai SDK…

Presumably they’re banking on making a buck off the cloud services then. In any case, this certainly does look like an interesting new option to keep tabs on for your game development! Sign up for the beta here; or just check out the introductions here.

Continue Reading →
3
Page 30 of 97 «...10202829303132...»