Warning: Undefined variable $page in /home/public/wp-content/themes/timoliver-2014/header.php on line 9

Warning: Attempt to read property "ID" on null in /home/public/wp-content/themes/timoliver-2014/header.php on line 9
Development |

Posts for 'Development'


Zooming to a point in UIScrollView

January 14, 2012 •

(Updated March 2015) I’ve rewritten the code for zooming to a CGPoint in a UIScrollView to be even better in a new blog post. Go check it out!

If there’s one piece of functionality that has become basically boilerplate on iOS, it’s the concept of double-tapping a zoomable UIScrollView to quickly zoom in on a given point. When I was writing the code for displaying pages in iComics, I assumed that this would be a really simple thing to do. I mean, surely all you’d need is a UITapGestureRecognizer attached to a UIScrollView that passes the location of any double-taps to the scroll view… right?

Nope. XD

Turns out that although there is a UIScrollView method called ‘zoomToRect‘ (which lets you zoom to a specific CGRect region of a UIScrollView), out-of-the-box, there is no official way to procedurally zoom into a specific CGPoint. This actually surprised me greatly since I would have thought it would be a standard part of UIKit.

In any case, I did a bit of searching around on Google, looking for some code that would let me do this easily. I found a few bits of code here and there, however they were written in such a way that unless the minimum and maximum scales of the scroll view were set up in a specific way (Uh, which in iComics’ case, they weren’t), the zooming wouldn’t work properly at all.

So, cutting to the chase, I decided to just roll my own category for UIScrollView to add that functionality to it. All it does is take a CGPoint (relative to the bounds of the scroll view itself) and a scale, and translates those to a CGRect that can then be passed to UIScrollView’s drawToRect method. 🙂

Continue reading

Introducing iComics!

January 13, 2012 •

 It’s the final day of my holidays today, and I’ve been silently beavering away on a little project of mine. As with all of my projects, I usually keep them absolutely off the internet until I’ve proven that they actually are viable, and I’m not just blowing smoke. XD

One of my reasons (if not, the main reason) for me buying an iPad was so that I would be able to read digital copies of my books, without needing to lug around their paper counterparts. In terms of being able to read eBooks as ePubs or PDFs, my iPad experience has been perfected thanks to the collective efforts of iBooks and GoodReader.

Unfortunately, up until now, when it comes to reading digital comic books on iPad, while there’s a nice selection of third-party comic readers available, for many varying reasons, I haven’t found one that I’ve been truly content with. Whether it be the way page turning is handled, or even getting the comics onto the device, I haven’t found one I’m happy to stick with.

So with that in mind, I would like to announce my next iOS app project, and I’m calling it iComics. 😀

Continue reading

MacBook Air!!

November 25, 2011 •

Shiny...So, in my last post, I added a rather cryptic photo of an Apple product I received for my birthday. Now that I’ve spent a week breaking it in,  I can write a blog about it!

It’s a shiny new MacBook Air. Core i7. 😀

Up until now, the 13″ MacBook Pro I’ve been using has been a loaner from work. And while that laptop has been absolutely fantastic, being absolutely invaluable in at work, not to mention being a great help with some of my side projects in helping further my knowledge of iOS dev, I figured that now that I’m actually starting to get requests for paid commissions, I’d be in a much better position if I bought my own hardware dedicated for that. It also means ensuring I have the proper licenses for all of the software I use is a lot easier too. ^_^;

So, after much research, and coming very close to buying a 15″ MacBook Pro, I decided to go with an Air.

Ultimately, when it came down to the tradeoff between power and physical weight, I decided that I’d rather go with a lighter laptop than a more powerful (but more heavy one) one. While the 15″ Pro is amazing, and from what I’ve seen, even runs rings around my desktop PC, I decided it was too big and too heavy for my liking. And going off the assumption that the Air would be at least as powerful as my 13″ Pro at that point, I figured it should handle everything perfectly.

And boy does it ever! 😀

If you’ve had any doubts that the MacBook Air doesn’t really stand up to the Pro series (at least the lower end), you can put them to rest. This thing is extremely snappy in pretty much every case I tried, and the graphics processor can handle running at 2560×1600 at no trouble at all.

Obviously, it isn’t as powerful as most of the Pros can potentially be (eg 8GB RAM, truly quad core CPU etc), so if you’re looking to do really intense things like edit video or play games, I might recommend the Pro. But for my kind of daily usage, which consists mainly of Photoshop design, web code,  and/or iPhone app design, this thing is perfect on all counts.

I’m still wrapping my head around Lion here. There are quite a few new features to get used to. Also, I’m still trying to figure out what other apps I need to fully deck it out. I might write another blog later… XD

Alright. Here endeth the Apple fanboy post. XD

ま、iずかんはここまでだみたい。

November 19, 2011 •

やあ、みんな! ちょっと前に英語の投稿を出したが、やっぱり日本語でも投稿した方がいいと思った。 最近、株式会社ポケモンの弁護士さんから聞いたんだから。

ポケモン会社からの最初のメールをもらった時、弁護士さんはどうかほとんどのポケモンのファン作成は許可をとってなくても、許可をとった作成もあるって言った。 それを待たずに、すぐに、iずかんが許可を取る可能性があるかどうかをきいてみた。

ま、その時から、あまりちょうしに乗ってる気をしなかったから、それをあまりだれにも教えていなかった。

そして、10月に、やっと弁護士さんから返事が届いてきた。

Continue reading

Laying iPokédex to rest

November 1, 2011 •

日本語版はこちらです!

Hey guys.

I thought I’d quickly let you know what’s gone down with iPokédex over the last few weeks.

When I originally received the first email from the Pokémon Company counsel for the first time, they had mentioned that even though the majority of Pokémon fan productions aren’t licensed, there are a few that had made it through the process.
Not skipping a beat, despite the fact that they also said that they don’t have the resources to license many more, I asked the counsel if they could perhaps check with licensing and see if there was any potential for iPokédex to be officially licensed.

I didn’t really broadcast this information too much (I mainly just kept saying ‘man it would be nice IF it got licensed’ XD) as I didn’t want to come off as ‘counting my chickens before they hatched’, so to speak.

Anyway, after a little while, about 2 weeks ago, I received the following email from the counsel:

Continue reading

Creating the iOS 5 UITableView bevel effect

October 23, 2011 •

So, as you might be aware now, Apple decided to give a bit of an overhaul to the grouped UITableViews where each of the table sections now have a cool inset bevel effect as opposed to a solid gray line.

When I was playing with iPokédex in the iOS 5 betas, I started thinking that the new table style started contrasting with the plain white boxes in the table header (eg for the main profile pic and the buttons).

So deciding to keep the entire list style as consistent as possible, I decided to replicate the bevel effect as a CoreGraphics function that I could then apply to all of my own custom subviews. While I was initially thinking of doing the whole thing as a static stretchable image in Photoshop, it became apparent that due to the various sizes of the elements, being able to programmatically set the size of the corner radii would ultimately be a lot easier (Hooray for programming making stuff lazier!  XD).

So after a couple of hours of examining the effect pixel by pixel in Photoshop, I found out that it’s a pretty simple effect to draw, but it would require 4 layered steps to actually draw properly:

Continue reading