UITableView questions (and hopes)

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Murray
Posts: 1
Joined: Fri Dec 27, 2013 1:26 am

UITableView questions (and hopes)

Post by Murray » Tue Dec 31, 2013 5:13 am

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 :o . 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

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: UITableView questions (and hopes)

Post by Klaus » Tue Dec 31, 2013 1:36 pm

Hi Murray,

1. welcome to the forum!

2. yes, you are asking for the world :D

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! 8)

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 :D


Best

Klaus

P.S.
Yes, groups of buttons for a "faked" tabbar!

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: UITableView questions (and hopes)

Post by Jellicle » Tue Dec 31, 2013 11:14 pm

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
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: UITableView questions (and hopes)

Post by Jellicle » Thu Jan 09, 2014 10:32 am

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
Attachments
tableviewdemo.livecode.zip
(68.32 KiB) Downloaded 255 times
Last edited by Jellicle on Mon Jan 13, 2014 9:02 am, edited 4 times in total.
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: UITableView questions (and hopes)

Post by Nakia » Fri Jan 10, 2014 6:26 am

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.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: UITableView questions (and hopes)

Post by Jellicle » Fri Jan 10, 2014 11:25 am

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
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: UITableView questions (and hopes)

Post by Jellicle » Mon Jan 13, 2014 6:19 am

Hi all

I've updated the demo with faster scrolling. Use the previous download link.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: UITableView questions (and hopes)

Post by Jellicle » Tue Jan 14, 2014 9:59 pm

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
Attachments
tableViewDemo.livecode.zip
(69.52 KiB) Downloaded 295 times
14" MacBook Pro
Former LiveCode developer.
Now recovering.

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: UITableView questions (and hopes)

Post by endernafi » Thu Jan 16, 2014 11:04 pm

Hi folks,

Gerry's stack is so well-built that I can't stop myself to work on it 8)
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
Attachments
20140116_tableViewDemo.zip
(89.97 KiB) Downloaded 290 times
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: UITableView questions (and hopes)

Post by jacque » Fri Jan 17, 2014 11:02 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: UITableView questions (and hopes)

Post by endernafi » Sat Jan 18, 2014 12:57 am

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
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Post Reply