Lessons learned from eaGeier #7

Creating a Done Button

As described before, the eaGeier needs a doneButton e.g. to close the date picker.

As it is needed on several occasions, it is best to create it lazily in its getter method. To do that create a custom button, set its frame and its font. To get the “button-style feeling” set the background using a gradient image. Setting its alpha to 0.8 shows what is below but still keeps the text of the button readable. And finally set the action which should be fired when the the button is touched:
Continue reading “Lessons learned from eaGeier #7”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Lessons learned from eaGeier #6

Creating a Date Picker

The eaGeier needs the possibility to enter a date e.g. to specify the purchase date for a voucher. Just providing a simple text field seems a little bit tedious. Thus – instead of opening a normal keyboard – the eaGeier provides a date picker, when a date field is selected, but at the same time keeps the possibility of entering a date via a hardware keyboard.

First the class handling the text fields needs to be the <UITextFieldDelegate>, and to implement the <UIPickerViewDelegate, UIPickerViewDataSource> protocols.
Continue reading “Lessons learned from eaGeier #6”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Final Project: eaGeier available at App Store

The eaGeier, developed as final project for the Coding Together course, is now available at the eaGeier - m2m server software gmbh.

It’s an tool for accounting on cash basis mainly used for small companies in Austria (Einnahmen-Ausgaben-Rechnung) and Germany (Einnahmen├╝berschussrechnung).

The app is a local port from the server application at www.ea-geier.at.

A demo of the app is available at YouTube.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Lessons learned from eaGeier #4

Sending a PDF File

Yet again the excellent documentation at Apple provides all you need to send an email. Start by initializing a mail-composer view controller, add a subject, a text and the file you want to attach as NSData. To allow the user to set the mail recipient just provide an empty array for the recipients. Set the delegate if you want to use the delegate functionality and finally present the mail view controller.

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
[mail setSubject:@"A Subject"];
[mail setMessageBody:@"A text you want to send with the PDF file." isHTML:NO];
[mail addAttachmentData:[NSData dataWithContentsOfFile:thePathToYourPDFFile] 
               mimeType:@"text/pdf" 
               fileName:fileNameOfThePDFFile];
[mail setToRecipients:[NSArray array]];
[mail setMailComposeDelegate:self];
[self presentModalViewController:mail animated:YES];
Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Lessons learned from eaGeier #3

Printing a PDF File

Printing works like before straightforward following the instructions of the documentation at Apple. Start by obtaining a printing controller and check if printing is available at all:

UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
if  (pic && [UIPrintInteractionController canPrintData:pdfDataWeWantToPrint] ) {
    // we should be able to print
}

Continue reading “Lessons learned from eaGeier #3”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Lessons learned from eaGeier #2

Creating a PDF File

The eaGeier allows to print its data or to export it via email as PDF file. For both it needs to create a PDF file first.

Creating a PDF file works straightforward following the instructions of the documentation at Apple. Start by opening a new file and start with a page:

UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil);
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 612, 792), nil);

Continue reading “Lessons learned from eaGeier #2”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!