[Open Source]FVGravityView

No Comments

Hey folks, I’m proud to announce my new open source project for iPhone. It’s called FVGravityView. It’s basically an UIView that has the ability to fall. Yes, fall. It uses the accelerometer to detect the device position and the view will fall depending on it. It’s basically an UIView that recognizes gravity.

A few thing:
-The default velocity is 20, but you may change this value by changing the velocity property.
-FVGravityView supports dragging. To enable it, set the property isDragable to YES.
-Say you want to invert the gravity. Just set the isInverse to YES.
-It’s basically an UIView, so you may add subviews to it. It also has every drawing capabilities that an ordinary UIView has.

To download the sample project, click here.

PS: I didn’t try it on an iPad, but it should work with no problems at all.

[Quickies]IRCClient, IRC made easy

No Comments

Have you ever needed/wanted to implement an IRC chat on your Cocoa application? It might be easier than you think! There’s a Cocoa “bridge” for the libircclient library. The lib was written by Georgy Yunaev. Get the files on this link. These few lines of code will make it work:

IRCClientSession *session = [[IRCClientSession alloc] init];
MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];

[session setDelegate:controller];
[controller setSession:session];

[session setServer:@"irc.dal.net"];
[session setPort:@"6667"];
[session setNickname:@"test"];
[session setUsername:@"test"];
[session setRealname:@"test"];
[session connect];

[session run]; //starts the thread

FVImageSequence for Mac OS X/iOS

2 Comments

When I got to know Rainer Brockerhoff, one of my first questions was about networking. One of his advices was to write some open source code. A few days ago I was working on my customer’s app. He needed something similar to Apple’s 360° demo. I did not want to do that on a UIWebView as the performance is not the best. After looking for a view that does that, I found there was no one available. So I decided to write my own. Now I’m releasing it as an open-source project. The first of many.

FVImageSequence is basically a subclass of NSImageView/UIImageView that allows you to create the 360° effect by using a sequence of images. To use this view, you will have to add a image sequence to your project. All images must have the same prefix(i.e. myimage0.png, myimage1.png, myimage2.png). Set the prefix of the images you want to use by setting the prefix property.

You must also set the number of images. Just set the numberOfImages property in order to do that.

Also, don’t forget to set the property extension with the extension of the files(i.e png, jpg, gif).

Optionally you might set the increment property. This property basically tells the view how many images it should increment. If instead of incrementing 1 image, you want to increment 5, just set it to 5.

If you’re using the iOS version, don’t forget to enable the user interaction on Interface Builder.

Download the source code and the sample project from this link.