For a little less than a year, I've been writing code built atop Twitter, specifically Matt Gemmell's MGTwitterEngine. I've got a few things running on this code, which I've not talked about publicly (other than minor hints on Twitter), but have been well-received by the few people who have seen it. Still, these projects have needed to extend both MGTwitterEngine and related libraries to add functionality or fix bugs. I'll spend this blog post documenting some of those changes across the different projects.

MGTwitterEngine

Most of these changes were made to make the engine's behavior a bit more extensible. Here's the GitHub repository.

  • MGTwitterEngineID is a typedef for unsigned long long values. Everywhere a user ID or tweet ID is returned, it will return one of these. You will want to check your existing Twitter code to make sure there are no potential Twitpocalypse-related problems, updating old data types to the new MGTwitterEngineID.
  • Subclasses of MGTwitterEngine can now override a new method, -_sendRequest:withRequestType:responseType:, if they want to use custom networking code (such as with an NSURLRequest queue class). I use this to implement both Twitter's password authentication and OAuth, and decide at runtime which to use.
  • Added a -connectionStarted: method to MGTwitterEngineDelegate, which can be used to update your UI.
  • Fixed a few bugs in the YAJL parser which crashed or parsed incorrectly.

Things I still need to do:

  • In my custom subclass of MGTwitterEngine, I use a class I wrote called TCDownload, which I'll talk about below. There are still a few references to it in my MGTwitterEngine class; those should be fairly straightforward to remove. Update: Thanks to Uli Kusterer, the dependency on TCDownload has been removed. The changes have been merged from his fork into mine.
  • Add full support for Twitter lists. I have some basic Twitter list functionality working in a private subclass, but far from all of it. There are some problems with the YAJL parser that don't appear easily fixable with the stock MGTwitterEngine (specifically, the API key for the list description is the same as the key for the user's bio, and these are overwriting each other internally). I'm going to look into replacing the manual parsers
  • Add full support for new-style retweets. Haven't started this yet.
  • Add support for geolocation in incoming and outgoing tweets. Haven't started this yet.

yajl

I've forked yajl to support 64-bit tweet IDs, mainly by changing the callback methods and the string parser from strtol to strtoull. Here is the GitHub repository.

SSCore

This is a repository of scattered classes which serve various purposes. There are two classes which are relevant for our discussion, TCDownload and TCOAuthDownload. You will need the TCDownload class if you use the vanilla MGTwitterEngine fork, although I'll be removing those dependencies. Here is the GitHub repository

  • TCDownload is a generic wrapper that encapsulates an HTTP request to the interwebs. It wraps NSURLRequest and NSURLConnection under the hood. It automatically queues request and gets callbacks on a background thread (although you can change either of these). I use it a few places inside my MGTwitterEngine fork, but removed most of those changes and put them in a subclass.
  • TCOAuthDownload is a subclass of TCDownload which accepts OAuth tokens and sends out requests with the correct headers. It relies on the OAuthConsumer framework, which I'll talk about below.

OAuthConsumer

This framework deals with OAuth. Twitter has officially announced that basic auth will be dead in June 2010, so getting on the OAuth bandwagon now is a good idea. Here's my fork of the OAuthConsumer framework on GitHub.

  • Changed the signature code to use Common Crypto instead of the C libraries' HMAC APIs. This seems to work more consistently on both Mac and iPhone.
  • Added a -parseHTTPKey:value: method which is used to parse extended attributes in OAuth access tokens. Twitter uses this to pass some special metadata, like the username of the logged-in user. Subclasses of OAToken can extend this to parse those tokens.

OAuthery

This isn't strictly a tool for doing Twitter development, but it can be handy when learning how to implement the OAuth login flow. I posted about it more back in January, and you can find the code and a prebuilt app over at GitHub.

Status:
 

We've all got our thoughts on what the Jesus Tablet will be, so here are my guesses. I fully expect to be completely wrong on all of this, as many of these answers are completely blind shots and that Apple will blow my expectations out of the water.

Hardware

  • 8"-10" touch screen, running at 1280x720
  • Very thin; less than 1/2" thick (the iPhone 3GS is 0.48" thick)
  • About 1lb heavy, light enough to hold in one hand
  • 8 hours of battery life
  • 32 or 64 GB SSD
  • WiFi
  • 3G over GSM, and Apple's US 3G partner will continue to be AT&T
  • There will be some way to pair your Tablet cell connection with your iPhone's cell connection; either with an official announcement of AT&T tethering, or by adding your Tablet to the 3G account
  • Front-mounted camera
  • Some kind of collapsible stand in the frame, so the device can sit on a table

Input/Output

  • Multi-touch on the display, exactly like the iPhone
  • Multi-touch on the back of the device, similar to the surface of the Magic Mouse
  • Photos and video via front-mounted camera
  • Audio via front-mounted microphone and speakers, wired headphones, or Bluetooth
  • Dock connector
  • Expanded voice recognition
  • Software keyboard, no Bluetooth keyboards available

Software

  • It will run the iPhone OS 4.0; or rather, the iPhone OS will become a "Mobile OS X", consisting of the heavyweight Tablet and the smaller iPhone.
  • It will allow multiple apps to run at the same time, with some UI for viewing multiple apps alongside each other. This may not be possible on the iPhone.
  • It meant to replace a full PC for most common day-to-day needs
  • iPhone applications will not run "automatically", but will need to be resubmitted through the App Store approval process. Most applications will run without much modifications. Icons will need to be higher resolution.
  • A system-wide Dock for documents, applications, and small widgets will be onscreen at all times
  • The home screen will be significantly revamped, and renamed to the Dashboard. App icons, web clippings, and widgets will be freely arrangeable.
  • Handwriting recognition will be available for text input, with an optional stylus, or with a gesture such as two closed fingers drawing as if you had a pen.
  • Some gestures will be used on the back of the device, such as scrolling and zooming.

Apps

  • Standard kind of iPod and Internet communications apps the iPhone OS comes with. iTunes video, iTunes LP content, Maps, and Safari web content will look phenomenal.
  • Sketchbook, an unlimited workspace to sketch and write notes, with collaboration features.
  • iWork, a full port of the iWork application suite, tied to the Internet (and expansion of the iWork.com web application), with collaboration features.
  • iChat, a port of the Mac app, with a heavy emphasis on video conferencing

SDK

  • The SDK will be available immediately, with a simulator.
  • There will be an emphasis on application interoperability.
  • Applications will be able to register plugins with view controllers and UTIs. When an application wants to expose an object (say, an image) to other apps, it will look for app plugins which respond to the "public.image" UTI, load one which matches the UTI, and present the view without leaving the application.
  • Applications will be able to expose services, similar to how they work on Mac OS X. Services will be integrated into the voice control system.

Product

  • 32 GB model will be available for $899
  • 64 GB model will be available for $999
  • Available in US in March, major countries by summer
  • There will not be a WiFi-only model at launch.

Other Predictions

  • Updated MacBook Pros and MacBook Airs, with the mobile Core i5 "Arrandale" processors from Intel.
  • There will be no mention of Verizon
  • There will be no updates to the iPod or the Apple TV
  • There will be no announcements of the iPhone 4G
 

Beyond impressive. This is more than some governments have contributed so far.

, , ,    Tags
 

Ars Technica:

ChangeWave queried 4,068 current and potential smartphone consumers last month and noted that a full 21 percent said that they would prefer Android on their next smartphones—a jump of 15 percentage points from the year before. Comparatively, 28 percent of respondents said they would prefer iPhone OS; this makes the iPhone the leader in this category, though this number dropped four percentage points year over year.

Many iPhone developers and Apple enthusiasts are quick to shrug off the Android platform, for a variety of reasons ranging from aesthetic and design, to functionality and developer tools. Many of these criticisms are certainly valid. But iPhone has its own share of problems, and certainly is deficient in many ways to the Android.

With Google's press conference tomorrow, and CES for the remainder of the week, there will be a lot of focus on the Android platform. It will become a much stronger platform in 2010. It will be interesting to see how Apple responds with iPhone OS 4.0 (which history suggests they'll probably talk about in March).

 

VillainousStyle is a drawing library for defining a visual style from a chain of individual drawing instructions. Each instruction modifies the drawing context to perform common operations; such operations include shadows, fills, borders, and shapes. It allows for multiple style sheets which can be used to theme an application in multiple visual contexts. VillainousStyle sits on top of CoreGraphics, and does not use WebKit for rendering at all. It is a fork of the VSStyle and VSShape classes, originally from the Three20 project.

Stylesheets

VSStyleSheet is an abstract superclass for a set of styles. Subclass it and add methods for each style you wish to add. You will likely want to create a protocol for your styles to implement, to ensure that your stylesheet implements all the necessary styles.

There is a global stylesheet, which can be thought of as the "active" stylesheet. Call +[VSStyleSheet setGlobalStyleSheet:] to change the active theme, which will fire a VSStyleSheetChangedNotification. When that gets fired, you'll want to tell your views to update their styles and redraw.

Styles

Styles affect drawing and positioning. Most will affect the next VSStyle objects in the chain.

  • Fills
    • VSSolidFillStyle - Fills the current shape with a solid color
    • VSLinearGradientFillStyle - Fills the current shape with a gradient between two colors
    • VSReflectiveFillStyle - Fills the current shape with a glossy-style gradient between two colors
  • Borders
    • VSSolidBorderStyle - Draws a border around the current shape with a solid color
    • VSBevelBorderStyle - Draws a beveled edge border for a 3D effect around the current shape
    • VSFourBorderStyle - Draws a border around the current shape with four colors, one for each edge
  • Shadows
    • VSShadowStyle - Draws a shadow behind content with a given color, blur, and offset
    • VSInnerShadowStyle - Draws a shadow inside the content with a given color, blur, and offset
  • Positioning
    • VSBoxStyle - Adds a margin or padding to the content area
    • VSInsetStyle - Adds edge insets to the content area
  • Content
    • VSTextStyle - Draws text inside the current shape
    • VSImageStyle - Draws an image inside the current shape
    • VSMaskStyle - Clips the drawing area to an image mask
    • VSShapeStyle - Clips the drawing area with a VSShape object

Shapes

Shapes affect the fills and borders, but do not clip the content styles.

  • VSRectangleShape
  • VSRoundedRectangleShape
  • VSRoundedLeftArrowShape - a rounded rectangle with a left-facing arrow
  • VSRoundedRightArrowShape - a rounded rectangle with a right-facing arrow

Future Ideas

  • iPhone static library
  • Cappuccino library
  • File-based stylesheets that can be read/written from VSStyleSheet objects
  • GUI builder for styles
  • More styles!

Status:

Active

 

The templates that ship with Xcode are not the greatest. Some of them are inconsistent and don't enforce good coding standards (e.g. missing a dealloc method). Other templates which would be useful just flat out don't exist (e.g. an NSOperation subclass, or a protocol header file). This project aims to supplement or replace the built-in templates for Xcode to speed up coding and improve the quality of code.

Coding Standard

All files will be processed by Xcode. The generated source files must produce consistent, readable, commented code. The code must have these characteristics:

  • Each file must have a comment block at the top describing the file.
  • Each class must implement its superclass' designated initializer and dealloc.
  • Stub methods must be organized by their purpose, class or protocol. -- Each group must be organized by their class hierarchy, with protocol stubs following. -- Each group must be prefaced by a pragma mark naming the class or protocol the methods were implementing. -- Clusters of methods (such as relating to KVO) should be organized along the lines above, with a pragma mark.
  • All method implementations should contain a method call to their super implementation if needed.
  • All method implementations should contain a commented out stub line that will signify where to insert their code.
  • All comments must be in the form of two slashes //, and none using the /* */ form. This will allow developers to comment out large blocks of code as needed.

Wish List

  • Different people want different things in their template. For instance, someone may want to include an implementation of observeValue:... for every class. Would be nice to have a template generator application (yeah yeah, very meta) which would make templates customized to the developer.

Status:

Inactive

 

URL Shrink is a new OS X tool with a very simple purpose - converting URLs to shorter permalinks on various web services. As the internet has matured, and services like IM, IRC, and Twitter have forced us to write shorter messages, it was clear that a system was needed that was as ubiquitous as Quicksilver.

For now, the main service of URL Shrink is just converting a URL that is on the clipboard, although this will be expanding over time (including things like a system text service, a command line client, a Quicksilver plugin, etc.). To do this, there is a keyboard shortcut (option-shift-space) which will convert the URL in the background to a tiny URL using one of the services provided. If you've selected one as your favorite, it'll choose that one. For example, I'm personally partial to is.gd, so all the URLs that are processed by URL Shrink on my machine go through is.gd.

At a low level, URL Shrink is a system where multiple shrinking engines can be added. It was designed to be extremely easy for developers to write just a little bit of code to integrate with other web services, including private URL services. For information on that, see the project page below.

URL Shrink is licensed under the BSD license. I encourage its adoption within other applications; I'll be adding .framework and .a targets for building this into Mac and iPhone apps respectively. Indeed, the project was born out of the URL shrinking capacity of another app I'm working on.

Status:

Inactive

 

I could not be more pleased about this news. iTunes 8.1, which was released about an hour ago, renamed "Party Shuffle" to iTunes DJ. I've used Party Shuffle for a long time as a queue of music to play for day-to-day work, and have been frustrated with Apple's Remote iPhone app and its lack of support for Party Shuffle. But their 1.2 App Store update, also released earlier today, has full support for it.

iTunes DJ divides iPhone users into two groups - guests and, for lack of a better term, the admin. The admin's iPhone is paired to iTunes as before, and they get the iTunes DJ playlist added. You can skip through songs, cast a vote (addressed below), and request songs. While iTunes DJ is playing, selecting a song anywhere else throughout the app brings up a menu asking if you want to add to iTunes DJ or play on its own.

Guests don't have to pair their iPhones to iTunes. They get to see a modified Now Playing screen, devoid of playback control. They can, however, request songs for iTunes DJ, and cast votes for songs. When they request a song, it automatically casts a vote for it.

Votes are pretty simple on the facet, but appear quite useful. Songs in the queue can be voted on by anybody. As they get voted on, they are automatically resorted in the queue by number of votes. However, you might get some guy at the party vote-clogging all night; fortunately, votes can be shut off by the admin.

All in all, this is the Big Deal feature in iTunes 8.1, and seems very well thought out.

, ,    Tags
 

Tim Cook, acting CEO of Apple:

We're not going to play in the low-end voice phone business. That's not who we are, that's not why we're here. Goal is not to lead unit sales, but to build the world's best phone.

Hopefully this kills the stupid iPhone nano rumors. Kills 'em dead. It's not coming, people.

,    Tags
 

The EFF is submitting requests for DMCA exemptions to the US Copyright Office. Among others, they are asking for an exemption for iPhone owners to be able to jailbreak their own devices.

Note that this is different from exempting the iPhone Dev Team, who create and distribute the jailbreaking solution, from lawsuit and/or persecution under the DMCA. This is solely for iPhone owners to do what they want with the device they paid for.

Page 1 of 2 Next →