To complete the article How to: custom fonts on iOS 3. 2 I propose the sources FontsBook , a simple iPhone application that displays in a table all system fonts, grouped by family.



To complete the article How to: custom fonts on iOS 3. 2 I propose the sources FontsBook , a simple iPhone application that displays in a table all system fonts, grouped by family.



With the release of iOS 3.2 you can include in your font resources for an application to be used esatamente as those provided by the system:
file. Applications That want to use custom fonts can now include fonts Those in Their application bundle and register Those fonts with the system by including the
UIAppFontsTheir key inInfo.plistfile. The value of this key is an array of strings Identifying the font files in the application's bundle. When the system sees the key, it loads the specified fonts and makes them available to the application.
), un oggetto di più basso livello con innumerevoli potenzialità. The class UIView exposes a pointer to the layer ( CALayer ), subject to a lower level with endless potential. The layer provides a number of methods and properties related to the display of the contents of the view. For example, you can manipulate the contents of a view in three dimensional space. Nell ' example that I report is interesting to note that the code is simple, and the whole is made using Interface Builder:

I respond to Mirko asking me how to make the reverse proposed in How to get Latitude and Longitude in Objective-C .
From the values of latitude and longitude, you can take advantage of the class MKReverseGeocoder to get a whole range of information, such as: the city, the state, the extended address, chap!
Let me demonstrate how it is possible to implement a simple slideshow of images with very few lines of code, using jQuery .
This technique can be implemented on any type of website, the important thing is to include the library jQuery . I used this technique for a site built in WordPress , developed in a few hours for an event.
The MapKit framework provides a lot of useful features, except the return Latitude and Longitude from an address. In JavaScript, for example, you can use the service provided by Google Geocoding and discussed in Google Maps: how to get Latitude and Longitude from an address . On Apple iPhone, or iPad, you can however overcome this obstacle by using a different Google services. Specifically, you can directly call the url:
1 | http://maps.google.com/maps/geo?q = [address] & output = csv |
Where is [indirizzo] enter the string with the address which we want to transform coordinates. The output returned is of the type:
1 | 200,8,41.9128300,12.2241172 |
). The first value, 200 , indicates that all is well ( 200 OK ). The second, 8 , is the Google accuracy parameter (1-10). The last two values are, finally, latitude and longitude. Let us now see a possible prototype of a method to be included in our applications:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | CLLocationCoordinate2D ) getLocationFromAddress : ( NSString * ) address { - (CLLocationCoordinate2D) getLocationFromAddress: ( NSString *) address { urlString = [ NSString stringWithFormat : @ "http://maps.google.com/maps/geo?q=%@&output=csv" , NSString * urlString = [ NSString stringWithFormat: @ "http://maps.google.com/maps/geo?q =% @ & output = csv", NSUTF8StringEncoding ] ] ; [Address stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]]; listItems = [ locationString componentsSeparatedByString : @ "," ] ; NSArray * listItems = [locationString componentsSeparatedByString: @ ","]; / / Int zoom = 0; 0.0 ; double latitude = 0.0; 0.0 ; double longitude = 0.0; listItems count ] > = 4 && [ [ listItems objectAtIndex : 0 ] isEqualToString : @ "200" ] ) { if ([listItems count]> = 4 && [[listItems objectAtIndex: 0] isEqualToString: @ "200"]) { / / Zoom = [[listItems objectAtIndex: 1] intValue]; listItems objectAtIndex : 2 ] doubleValue ] ; latitude = [[listItems objectAtIndex: 2] doubleValue]; listItems objectAtIndex : 3 ] doubleValue ] ; longitude = [[listItems objectAtIndex: 3] doubleValue]; { Else {} / / Error } CLLocationCoordinate2D location; location.latitude = latitude; location.longitude = longitude; return location; } |
, alla stregua della funzione explode ( ) del PHP per intenderci. The string returned in locationString is "split" by the method componentsSeparatedByString , like the function explode ( ) php to speak. In the example I proposed I entered - but commented - also the code to retrieve the Google parameter accuracy, precision or scale factor, denoted zoom .
For completeness, I created a small sample application with which you can try the method proposed above, enter any address and iPhone will show on the map.
I thank the team devAPP for the inspiration of this article.
After explaining how to locate our strings in Xcode , let's see now how much is simple - applying the same technique - to locate and view images / interfaces built with Interface Builder.
The process, as mentioned, is the same, if we have an image already inserted in our resources, or we insert a new one, and we want to "localize" - that is to manage two or more images based on the languages supported - simply click the button Right image ( Adium.png in this example) and select Get Info:

Make File Localizable click on the bottom left.

Click on Add and insert Localization Italian :

In order to obtain:

esattamente come accadeva con il testo: Our image is moved (physically, one of the rare times when that happens nell'alberatura Xcode is reflected in the filesystem) under virtual folders English.lproj and Italian.lproj as was the case with the text:

contiene una stessa versione dell'immagine. At this point each of the folders English.lproj and Italian.lproj contains a same version of the image. This image is manipulated in Interface Builder, where we will see - by default - the English version.
At this point, just overwrite one (or both files Adium.png ) to achieve localization of the images "flash".
Even the interfaces built with Interface Builder can be localized in their entirety, when it is deemed necessary. ) con interfaccia XIB , lo selezioniamo, scegliamo Get Info dal menu contestuale, rendiamo il file localizzabile, aggiungiamo la localizzazione in italiano: The procedure is identical to that performed with the graphical resources: add a ViewController (eg infoViewController ) interface XIB, we select it, choose Get Info from the contextual menu, we make the localizable files, add localization in Italian:

Clicking Inglese or English will open Interface Builder! ) all'interno della classica cartella Classes . This time, the filesystem, you will notice that you have created two folders ( English.lproj and Italian.lproj ) in the classical Classes folder. Both will have their file infoViewController.xib . The comfort in this, resolved evident in the code, and when we are going to instantiate our controller code you will have a "clean" like this:
1 2 | [ InfoViewController alloc ] ; InfoViewController * info = [InfoViewController alloc]; info.view ] ; [Self.view addSubview: info.view]; |
As you can see there is no record of any statement concerning the location, fully managed by the system. The two interfaces, of course, can be completely different, as they are to all effects as two separate files XIB.
I have been asked how to customize a graphical form, in particular a search form like the one on this blog. The technique used, or better that I use, it is obviously valid for any type of form. What changes is only the complexity of the work to be performed depending on the complexity of the form itself.
Create an Ajax Loader (or Activity indicator for those who are accustomed to using the Apple iPhone) to the Web is not a difficult thing: there are services that generate animated gif images of all kinds. However, the GIF format has the big disadvantage of not supporting the transparency as it should. The transparency in GIF current involves only one bit plane with the result that we do not have a uniform background color, image edges are noticeably wide and fragmented.
In Adobe Flash, you can use a wide range of external APIs provided by Web services such as Facebook , Twitter or Flickr . In this tutorial we will see how to integrate, in a really simple, the services of Google Maps in a movie / application Adobe Flash CS4.
Latest Comments
Ludovica : Hello! I'll explain my doubt. When I write a post not add pictures in the article (if so ...
Marco : hello @ Giovan Battista Fazioli, thanks for all the explanations of this excellent guide. I have a question to ...
Roberto : Roberto @: @ Roberto: I was wondering if using [cci] the_post_thumbnail () [/ cc i] to load on the homepage ...
Lorenzo : That's great! Thank you for the usefulness and effectiveness of assistance! I found your blog as ...
Shawn : I have upgraded to a new verison of WP-Bannerize and I ran into some errors. Is there a way to figure out the ...