Wednesday, 26 August 2009

MonoTouch "Restaurant Bill Splitter"

Okay - my first "real" iPhone via MonoTouch beta application is complete... welcome to Restaurant Bill Splitter, the easiest way to determine who pays the check :-)

Here it is before any data entry and after you have entered the total restaurant bill (plus the subtotal of any alcohol in that figure) and chosen the number of drinkers versus non-drinkers who are going to pay.



Here is the Interface Builder screen shot


You can also download the MonoTouch BillSplitter solution (11Kb) and view the c# code for Main.cs and MainWindow.xib.designer.cs. Even though MonoTouch is currently still in (closed) beta, it is VERY cool to be able to write c#/.NET targetting the iPhone platform. There is still quite a bit to get my head around (mostly the Apple stuff: XIBs, Views, delegates, events, Interface Builder, etc) but hopefully once I get the hang of it, much more complex applications will be forthcoming...

NOTE: there is one known bug in there... I'm having trouble making the keyboard disappear when you press the [Done] button - so if you're wondering what all the ResignFirstResponder() delegates are for, it's my attempt to debug/fix the keyboard problem. That is also the reason for the [Split] button, which otherwise wouldn't really be required since the calculations happen 'on change' for each of the input controls...


UPDATE: this is the class diagram for the app (obviously excludes stuff *in* the XIB, but includes the .xib.designer.cs). I've also posted the class diagrams for Foundation and UIKit online.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.