Page 1 of 1
UITableView questions (and hopes)
Posted: Tue Dec 31, 2013 5:13 am
by Murray
Hello
I am very new to LiveCode and loving the concept. The problem I have is trying to create an IOS tableView with all the associated functionality. I'm quite surprised that there aren't any videos or tutorials about this

. I have found one video that used CSS to build the structure but this seemed overly complex.
I understand that I can use DataGrid for the base information/table but how do I then link this off to a new Page with the associated details? How can I create sections/group in the main table view? (eg. by date or another group). I assume that each record should be in an Array.
Also how would I add buttons for New and Edit and the relevant functionality. Edit would provide the ability to move a record above or below other records. Also the ability to delete a row (with a confirmation icon).
While I'm asking for the world, is there a straight forward way to display a Tab bar at the bottom of the screen. I'm guessing a Group of Buttons that look like the tab bar.
Any help is very much appreciated.
Cheers
Re: UITableView questions (and hopes)
Posted: Tue Dec 31, 2013 1:36 pm
by Klaus
Hi Murray,
1. welcome to the forum!
2. yes, you are asking for the world
But we cannot explain this here, so I advice to take a look at this site,
load the PDF and work HARD through the examoles!
Datagrids are the most complex bests you can imagine in Livecode.
I am an experienced Livecode user (since 1999) but need to read up
the datagrid PDF over and over when I start a new project with datagrids
involved.
Hint: Start small!
Make little examples of for the different aspects of your project
and then combine them.
We will surely help you out wirth specific questions about datagrids
Best
Klaus
P.S.
Yes, groups of buttons for a "faked" tabbar!
Re: UITableView questions (and hopes)
Posted: Tue Dec 31, 2013 11:14 pm
by Jellicle
I have data grids working well as table views - check out my app Nine Square on the App Store. You can swipe each row to the right to reveal buttons etc. I don't use drag to re-order the lists but I can imagine a way to make that work.
I might break out the essential parts of my method into an example stack when I get time in the next couple of days.
Gerry
Re: UITableView questions (and hopes)
Posted: Thu Jan 09, 2014 10:32 am
by Jellicle
The attached file is a demo of an iOS table view with a couple of useful features.
The demo has a scrolling data grid that is populated with data on opencard. The data is taken from an invisible field named "records".
You can swipe the rows of the data grid to the left to reveal a delete button. You can pull down to refresh the data grid - nothing is actually refreshed though - it just demonstrates a method for implementing that feature.
I've put this together fairly quickly so there are sure to be bugs - but I hope it provides a starting point for your own experimentation.
Enjoy.
Gerry
UPDATE: faster scrolling
Re: UITableView questions (and hopes)
Posted: Fri Jan 10, 2014 6:26 am
by Nakia
Just had a quick play with that TableView demo and its quite good.
It should good into the Tutorials/Resources section as it will really help new comers understand the complexities of the DG.
Re: UITableView questions (and hopes)
Posted: Fri Jan 10, 2014 11:25 am
by Jellicle
Nakia wrote:Just had a quick play with that TableView demo and its quite good.
It should good into the Tutorials/Resources section as it will really help new comers understand the complexities of the DG.
Good idea. I have a few things to add to it (smooth scrolling for starters!) so I might wait until it's had a bit more work before posting it there.
Gerry
Re: UITableView questions (and hopes)
Posted: Mon Jan 13, 2014 6:19 am
by Jellicle
Hi all
I've updated the demo with faster scrolling. Use the previous download link.
Gerry
Re: UITableView questions (and hopes)
Posted: Tue Jan 14, 2014 9:59 pm
by Jellicle
Hi all
Ender Nafi has built on my original demo and added some great enhancements (and squashed some bugs). With his permission I'm posting his version here. I think you'll agree it's a great advance on my work.
The main changes are:
Swipe left AND right to reveal buttons. The row now swipes more smoothly, too.
Pull to refresh shows graphic feedback
Gerry
Re: UITableView questions (and hopes)
Posted: Thu Jan 16, 2014 11:04 pm
by endernafi
Hi folks,
Gerry's stack is so well-built that I can't stop myself to work on it

I've added another animated feedback to the refresh / update process:
An arrow which rotates in conjunction with the scroll and finally turns into a turning recycle icon.
Personally, I would and will use this one.
It's more iOS 7 style
Unfortunately, that rotating image wobbles just a bit.
Livecode doesn't get along with image transformations, you know;
and fixing it is way beyond my ken.
Anyone willing to make contribution to this,
I'm sure that we all would be happy to see some of
these cool animations.
Best,
~ Ender Nafi
Re: UITableView questions (and hopes)
Posted: Fri Jan 17, 2014 11:02 pm
by jacque
Does iOS support animated gifs? That would be the easiest solution, but a quick search seems to say it doesn't. Another way is to use an image app to make separate frames of the rotation and then show them serially in the stack.
Re: UITableView questions (and hopes)
Posted: Sat Jan 18, 2014 12:57 am
by endernafi
Jacque,
It never occurred to me using a gif;
after reading your post, I did a quick test with this:
http://dribbble.com/shots/1206014--Anim ... o-Check-In
It worked fine in the simulator,
kept crashing in iPod Touch 4 {doesn't even open},
worked kinda slow but seamlessly in the later and more powerful iDevices:
iPhone 4 - 5, iPad's, iPod 5, ...
Those who read this post should keep in mind that I didn't downsize or crop that gif.
It's 5mb., no wonder iPod 4 couldn't handle it
So, animated gifs could be a solution for certain tasks.
Best,
~ Ender Nafi