Squiz Matrix for iOS Beta 1 Released

Today saw the release of Squiz Matrix iOS beta 1. This is the first round of beta testing for all users that signed up.

  • Beta
  • Beta

The beta version includes the following features.

Features:

  • Add multiple site configurations
  • Asset Map Browsing
  • Status Colors
  • Importing of files in app
  • Management of Imported Files
  • Asset creation of selected assets
  • Asset creation from imported files
  • Viewing of selected asset screens
  • Asset Details
  • Viewing/changing Asset Status
  • Viewing/changing Asset Attributes
  • Viewing/changing Asset Metadata
  • Viewing Asset Webpaths
  • Preview Assets including all file types
  • Asset Map sorting
  • Deleting of assets
  • Pull to refresh

Squiz Matrix 3.28.0 is required.

Note: Since this is a beta there will be issues, things not finished, and bugs. Make sure you contact us with any of these issues that you might find.

Interested in Helping Out?

You can still be a tester! Sign-up below.

Squiz Matrix for iOS: An Update

I just did a guest blog over on the Squiz Advocate blog about the status of my Squiz Matrix iOS app. Head over there to read the full post:

Squiz Matrix for iOS: An Update, on the Squiz Advocate Blog website

Newest iOS App Release: Retemodo

Apple just approved our newest iOS app, Retemodo. Retemodo is a reverse odometer, which counts down from a distance that you set. It is a great, easy to use utility app. All you have to do is start up the app, swipe or touch the numbers to set your distance, then click start. Then you can either watch the beautifully animated digits flip, or you can just forget about it. It works in the background and will alert you when your distance has been reached.

  • Retemodo Main View
  • Retemodo Back View

Want to support us?

ZSPinAnnotation: Custom MKMapView pin images from UIColor

2 months ago by Nicholas Hubbard in #iOS #Objective-C

Have you ever felt limited by the three Annotation pin colors that Apple provides with MapKit? Have you ever thought it was a pain to have to create custom images in photoshop every time you wanted to change the color? ZSPinAnnotation solves these problems by building the pin image on the fly. All you have to do is specify a UIColor and you get back a UIImage.

  • ZSImageView

If you want to create a ZSPinAnnotation you simply do the following:

UIImage *img = [ZSPinAnnotation pinAnnotationWithColor:[UIColor blueColor]];

The full implementation in mapView:viewForAnnotation:

- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation {

    if(![annotation isKindOfClass:[Annotation class]]) // Don't mess user location
        return nil;

    static NSString *defaultPinID = @"StandardIdentifier";
    MKAnnotationView *pinView = (MKAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
    if (pinView == nil){
        pinView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];
        //pinView.animatesDrop = YES;
    }

    // Build our annotation
    if ([annotation isKindOfClass:[Annotation class]]) {
        Annotation *a = (Annotation *)annotation;
        pinView.image = [ZSPinAnnotation pinAnnotationWithColor:a.color];// ZSPinAnnotation Being Used
        pinView.annotation = a;
        pinView.enabled = YES;
        pinView.calloutOffset = CGPointMake(-11,0);
    }

    pinView.canShowCallout = YES;

    return pinView;

}//end

iOS Beta Testers Wanted!

As time gets closer to some of our iOS app releases we are looking for individuals who are interested in being Beta Testers! Those special people will have a chance to play with beta versions as well as have input on new features and UI.

If anyone is interested we would be very grateful. Just follow the button below to come on board.

ZSImageView: A UIImageView Replacement for Loading Remote Images

When working on the iPad version of the Pacific Union College app I had a need for a UIImageView that could load a remote image while showing a default image during the loading time. Since I am doing everything I can to get away from the horrible Three20 Library, I figured that I would write my own UIImageView replacement.

ZSImageView allows remote image loading, using a default image and also rounding the edges of the view. It is pretty easy to add a ZSImageView to your project.

Download ZSImageView on github

  • ZSImageView

Create a ZSImageView and set the remote and default image:

ZSImageView *imageView = [[[ZSImageView alloc] initWithFrame:CGRectMake(0, 0, 200.0f, 200.0f)] autorelease];
imageView.imageUrl = @"http://www.desktopwallpaperhd.com/wallpapers/3/4501.jpg";
imageView.defaultImage = [UIImage imageNamed:@"no-image.png"];
imageView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:imageView];

If you want to round two of the edges and give the view a cornerRadius of 10 it is pretty easy:

ZSImageView *imageView = [[[ZSImageView alloc] initWithFrame:CGRectMake(0, 0, 200.0f, 200.0f)] autorelease];
imageView.imageUrl = @"http://www.desktopwallpaperhd.com/wallpapers/3/4501.jpg";
imageView.defaultImage = [UIImage imageNamed:@"no-image.png"];
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.corners = ZSRoundCornerTopLeft | ZSRoundCornerBottomLeft;
imageView.cornerRadius = 10;
[self.view addSubview:imageView];

ZSImageView requires the QuartzCore.framework. Once you have that added you need to copy ZSImageView.h and ZSImageView.m as well as JMImageCache.h and JMImageCache.m to your project. Then #import the ZSImageView.h header file where you need it and start using it.

Download ZSImageView on github

Squiz Matrix iOS App Progress and New Features

During my free time I have been working hard to build in new features to the Squiz Matrix iOS app. A few quick things I have added are new designs, pull to refresh, asset types to create, screens and preview.

Works With Your Squiz Matrix Install

The great thing about the Squiz Matrix iOS app is that it gathers all of its data from your server. So all asset types that are shown for creation are the same assets that are installed on your system, screens are generated from your server and all asset map details are from your server. It should look familiar, but with a few great enhancements!

Preview Video

The following demo shows a couple of the new features in action as well as the new design.

Comments/ Suggestions

I welcome your feedback! This app needs to have community input, so please feel free to comment so that I can know what kind of features you are interested in.

XML Parsing in iOS Using Squiz Matrix as a Datasource

The great thing about using a CMS like Squiz Matrix is its flexibility. So when we decided to build a Pacific Union College iOS app it was a snap to get Matrix working as the datasource.

I decided to use XML to provide the data (primarily from asset listings), but first I needed to do some proper setup and gather the tools that I would need.

The reason I didn't use JSON was, in Squiz Matrix it isn't always possible to create valid JSON, which means removing the trailing comma on a listing. It is possible on asset listings, but not on things like a Calendar Page, which was essential to our app.

The Parse File

In Squiz Matrix I needed to create a separate design file that would be applied to all of my assets that were acting as datasources, for this I used the following format:

<MySource_PRINT id_name="__global__" var="content_type" content_type="text/xml; charset=utf-8" />
<?xml version="1.0" encoding="UTF-8"?>
<body>
<MySource_area id_name="body" design_area="body" />
</body>

Example Asset Listing

For most of the tabs in the Pacific Union College app an asset listing is used.

  • Webpaths

Setting up the asset listing that would serve as the datasource was pretty straight forward. For a simple listing such as the Current News, I used the following setup:

Page Contents

%asset_listing%

Page Format

<item>
<title><![CDATA[%asset_name%]]></title>
<sub><![CDATA[%asset_attribute_summary^striphtml^trim^maxwords:30%]]></sub>
<created>%asset_created_Y%%asset_created_m%%asset_created_d%</created>
<id>%asset_assetid%</id>
</item>

Parsing the XML in Objective-C

When I started looking for an XML parser I was overwhelmed by the number of articles and blog posts about which parser was the best. There were comparisons between NSXMLParser and libxml2, as well as many people talking about KissXML. All of these were fair solutions that would work well, but I wanted something very lightweight that was easy to use. After searching around a bit, I found XML Reader by Troy Brant. It was a very simple XML Parser that turned the parsed xml into an NSDictionary object which is exactly what I wanted.

Using the parser is very simple, all you have to do it provide it with an XML string and an NSError object:

NSError *parseError = nil;
NSDictionary *dict = [XMLReader dictionaryForXMLString:xmlStr error:&parseError];

Once the parser spit out the NSDictionary I simply needed to loop through it in order to get the data that I wanted.

NSError *parseError = nil;
NSDictionary *dict = [XMLReader dictionaryForXMLString:xmlStr error:&parseError];
NSDictionary *newDict = [[dict objectForKey:@"body"] objectForKey:@"item"];

// Check if we have one or more results
if ([newDict isKindOfClass:[NSArray class]]) {
	
	for (id theKey in newDict) {
		
		NSString *title = [util cleanString:[[theKey objectForKey:@"title"] objectForKey:@"text"]];
		NSString *sub = [util cleanString:[[theKey objectForKey:@"sub"] objectForKey:@"text"]];
		NSString *assetId = [util cleanString:[[theKey objectForKey:@"id"] objectForKey:@"text"]];
		
		NSLog(@"%@ - ID: %@", title, assetId);
		
	}//end for
	
} else {
	// Do somethign else if not an array
	
}//end

Things To Think About

Getting the data from a URL and then parsing it can take some time. Not a huge amount of time, maybe a second or two depending on how fast your server is and how large your file is. But you don't want your users having their UI locked up until the data loads. So, in this case it is a good idea to load the data in the background:

/**
 * The initial call to the datasource
 *
 * @version $Revision: 0.1
 */
- (void)initDataSource {
	[self performSelectorInBackground:@selector(callDataSourceWithId:) withObject:@""];
}//end

Caching on the device is another thing that needs to be considered if your datasource comes from some URL. If users don't have an internet connection they still want to browse the app. For the Pacific Union College app we cache all datasource XML files and use those files if the user is offline.