UA-17470720-3

Jump to content


Photo
- - - - -

STV 3.2.0 has just been released!

announcement

  • Please log in to reply
6 replies to this topic

#1 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 28 April 2013 - 12:13 AM

Dear all,

We're really excited to announce that STV 3.2 is finally out!

STV 3.2 is almost like a major version upgrade if you consider the amount of new features it brings to the STV series. As a matter of fact, it's probably the most feature packed minor version release we've ever had! Let's have a look at some of its awesome new features:


UISearchDisplayController Support

STV now natively supports displaying a UISearchDisplayController during it's automatic search. To enable this in your projects, simply set the new enableSearchDisplayController property to TRUE and STV will take care of everything else!

SCSearchViewController

We've created a new SCViewController subclass called SCSearchViewController. The new view controller automatically provides a UISearchBar control, which saves you the hassle of having to create one yourself when using STV's automatic search features. Using this new class, you can start doing stuff like:

SCSearchViewController *mySearchVC = [[SCSearchViewController alloc] init];
mySearchVC.tableViewModel = myTasksModel;
[self.navigationController pushViewController:mySearchVC animated:YES];

and that's it, the above code is all you now need to provide automatic search functionality for your models! Here is what this new feature combined with our UISearchDisplayController support looks like on our own Custom Cells App:

Attached File  SCSearchViewController.png   97.37K   175 downloads



SCObjectSelectionModel

We've now added support for creating object selection models via our new SCObjectSelectionModel class. Using this new class, you'll be able to have your app users automatically categorize and search for objects while selecting them! To have STV use the new class for it's automatically generated selection detail view, simply pass it on in the detailViewController cell action:

myObjSelectionPropertyDef.cellActions.detailViewController = ^UIViewController*(SCTableViewCell *cell, NSIndexPath *indexPath)
{
  SCObjectSelectionModel *objSelectionModel = [SCObjectSelectionModel modelWithTableView:nil];
  // categorize using the first character of the object's title
  objSelectionModel.modelActions.sectionHeaderTitleForItem = ^NSString*(SCArrayOfItemsModel *itemsModel, NSObject *item, NSUInteger itemIndex)
  {
    NSString *objectTitle = (NSString *)[item valueForKey:@"title"];
    // Return first charcter of objectTitle
    return [[objectTitle substringToIndex:1] uppercaseString];
  };

  // Yes, this too makes use of our awesome new SCSearchViewController! <img src='http://sensiblecocoa.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' />
  SCSearchViewController *selectionSearchVC = [[SCSearchViewController alloc] init];

  selectionSearchVC.tableViewModel = objSelectionModel;

  return selectionSearchVC;
};



Themes Layout Control

Not only can your beloved themes feature control the 'skinning' of your app, but it can now also control how every single view is laid out! This is tremendously useful when styling table view cells for example, since you can now resize labels or move text fields around using a single really trivial theme file!

To achieve this, we had to re-engineer the theming system and have it kick in at several stages during a cell's life cycle (as you probably know, cell layout for example is only effective inside layoutSubviews). We've also had to add support the CGRect and CGSize data types in the theme file. To give you an example of how powerful this new feature is, here is all the theme code you need to reposition a cell's textLabel and have it drop a dark shadow:

SCTableViewCell
{
  textLabel.frame:  CGRect(10,10,150,30);
  textLabel.shadowColor:  darkGrayColor;
  textLabel.shadowOffset:  CGSize(1,1);
}

Sensible Key Path!

We're all aware of how to access properties deep down the object hierarchy using the valueForKeyPath method. For example, to access a customer's address street name, you'd typically code:

street = [myCustomerObject valueForKeyPath:@"address.street"];

STV has always fully supported this, and will automatically display cell data based on your key path setting. However, a lot of the times you simply cannot use this technique because there is an array in the middle, and Apple's own valueForKeyPath method does not support having an array in the middle of your key path. With our new STV 3.2, we've actually introduced our own key path method that does support arrays! With our new method, you could easily call any of the following:

firstInvoiceDate = [myCustomerObject valueForSensibleKeyPath:@"salesData.invoices[0].date"];
lastInvoiceDate = [myCustomerObject valueForSensibleKeyPath:@"salesData.invoices[n].date"];
beforeLastInvoiceDate = [myCustomerObject valueForSensibleKeyPath:@"salesData.invoices[n-1].date"];
//etc.

This new feature becomes especially essential when you're dealing with web services, as many web services return the value you want STV to automatically fetch deep inside an array or even two in its response JSON object. For example, the YouTube search web service returns three video thumbnails in an array, so you'll then need to tell STV exactly which thumbnail to display using the super convenient bindings string. Using this new feature, the bindings string can now look like this:

// Automatically fetch and display the video's thumbnail, title, and description
NSString *bindingsString = @"1:media$group.media$thumbnail[1].url; 2:media$group.media$title.$t; 3:media$group.media$description.$t";

To see this in action, you can download the full YouTube web services app here. (requires the STV+WebServices framework)




This is a screen shot of the app

Attached File  YouTube.png   157.41K   159 downloads


New Web Services Features

STV web services binding has quickly gained amazing popularity amongst the STV user community! Usually with only a single page of code, we're able to have STV automatically talk to the web service and display its results in our own custom cells (again, the YouTube app is an excellent example). We've now pushed this a little bit further with these new features:
  • STV now natively supports automatically encoding the username and password using Base64 encoding, and will automatically set the authorization headers for HTTP basic authentication.
  • STV now natively supports token authentication.
  • STV now supports an additional web services batching system where the batch start index can be specified (useful for batching from web services like YouTube and several others who don't return a next batch URL).
  • Object editing is now optimized to only update the web service store if the edited object has really changed (even if the user taps Done).
And last but not least, STV 3.2 fixes all issues reported (and identified as bugs) in our bug tracking system. Furthermore, it implements many new additional features from our users' feature list requests. For a full change log of STV 3.2, please refer to the file called changelog.txt in your downloaded package.


Please leave us your feedback on the new release, we highly appreciate all your input.

Thank you very much for all your support!
  • cometlinear, Everett, wizgod and 2 others like this

#2 devia

devia

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 20 posts
Reputation: 8
Good

Posted 30 April 2013 - 01:44 AM

Hi, thank you guys. Are the documents ready now?

#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 01 May 2013 - 05:04 PM

Hi devia,

Yes, all documentation has been updated with the lastest 3.2.0 changes.

#4 devia

devia

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 20 posts
Reputation: 8
Good

Posted 01 May 2013 - 07:24 PM

It seemed that Introduction to Sensible TableView 3.0 PDF is not updated with latest 3.2.0.

#5 Barrett Jacobsen

Barrett Jacobsen

    Starting Out

  • STV 3.0 Pro
  • Pip
  • 6 posts
Reputation: 2
Good

Posted 19 June 2013 - 06:25 AM

Is there a sample project that shows implementing a user searchable and sortable table view?



#6 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 19 June 2013 - 07:52 AM

Hi Barret,

 

Our "Core Data App" sample has exactly this under the tab called "People". This tab contains a sorted searchable list of people.



#7 Barrett Jacobsen

Barrett Jacobsen

    Starting Out

  • STV 3.0 Pro
  • Pip
  • 6 posts
Reputation: 2
Good

Posted 19 June 2013 - 09:48 AM

Hi Barret,

 

Our "Core Data App" sample has exactly this under the tab called "People". This tab contains a sorted searchable list of people.

 

It looks like the sorting in that sample is static, I was hoping for a sample where the user chooses the sort criteria (i.e. there's a way for the user to set the sort to be by name, birthday, address at runtime)







Also tagged with one or more of these keywords: announcement

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users