UA-17470720-3

Jump to content


Photo
- - - - -

STV iOS 11 issues


  • Please log in to reply
20 replies to this topic

#1 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 25 April 2018 - 03:03 AM

Hi all,

 

STV seems to have a few issues with iOS 11 that I've been trying to fix over the last few days without success.  Maybe someone else has already fixed this and can point me in the right direction.

 

Here's some code to show the issues, a simple viewDidLoad:

 

 

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationBarType = SCNavigationBarTypeEditRight;

    NSMutableArray *stringItems0 = [NSMutableArray arrayWithArray:@[@"String Item 0", @"String Item 1", @"String Item 2"]];
    SCArrayOfStringsSection *stringsSection0 = [SCArrayOfStringsSection sectionWithHeaderTitle:@"Strings Section Header" items:stringItems0];
//    stringsSection0.footerTitle = @"String Section Footer";
    stringsSection0.allowAddingItems = YES;
    stringsSection0.allowMovingItems = YES;
    stringsSection0.allowDeletingItems = YES;
    stringsSection0.allowEditDetailView = YES;
    stringsSection0.addNewItemCell = [SCTableViewCell cellWithText:@"Add a string item..."];
    stringsSection0.addNewItemCellExistsInEditingMode = YES;
    stringsSection0.addNewItemCellExistsInNormalMode = NO;
    stringsSection0.placeholderCell = [SCTableViewCell cellWithText:@"No string items!"];
    stringsSection0.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
        if (cell.isSpecialCell) {
            cell.accessoryType = UITableViewCellAccessoryNone;
        }
        else {
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        }
    };

    [self.tableViewModel addSection:stringsSection0];
}

 

Some issues I'm seeing in no particular order:

 

 

Editing a String Item and tapping Done and the cells alpha is set to 0.0f after a slight delay. This seems to be happening deep within UITableView via  _updateWithItems:updateSupport:. Tapping Cancel instead of Done and the alpha is left at 1.0f.

 

 

Editing a String Item, tapping Done, and then Edit, and the cell reappears, however the cell still has the old value and not the  new value. Selecting the cell to edit it again shows the new value correctly.

 

After adding a new String Item STV seems to get the new cell confused with the "Add a string item..." cell.

 

 

And then note if the footerTitle is enabled then everything works as expected!!

 

 

 

 

 

Had anybody else been seeing these sort of issues in their apps, and have any fixes?

 

 

 


Cheers,

Dave

www.dgapps.ie

#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 03 May 2018 - 01:27 AM

Hi all,

 

Is it just me that's seeing these disappearing cell issues with STV and iOS 11?

 

Nobody else?


Cheers,

Dave

www.dgapps.ie

#3 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 06 June 2018 - 10:11 PM

Hello again all,

 

 

It looks like all the same issues still exist with STV and iOS 12 Beta 1 :-(


Cheers,

Dave

www.dgapps.ie

#4 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 06 June 2018 - 11:44 PM

set a breakpoint in STV code on every line where alpha is changed and find where its being set ?


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#5 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 June 2018 - 12:50 AM

Hi Ozie,

 

Thanks for the reply!

 

 

STV doesn't set the alpha of it's SCTableViewCell anywhere in STV code.

 

-[UITableView _updateDragStateForCell:atIndexPath:] is setting the alpha of the cells and it happens sometime after any of the STV DidDismiss blocks are called.


Cheers,

Dave

www.dgapps.ie

#6 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 07 June 2018 - 01:21 AM

any style sheet set?


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#7 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 07 June 2018 - 01:23 AM

i have not used STV in years.. but ill download the last 9.4 Xcode and give you demo code above a whirl


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#8 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 June 2018 - 01:28 AM

I'm not using any STV Themes.

 

Using just the code above exhibits the disappearing behaviour.

 

If you could take a look that'd be great, another set of eyes might spot something I've been missing!


Cheers,

Dave

www.dgapps.ie

#9 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 07 June 2018 - 03:31 AM

ok.. tested

i found nothing you posted happening at all.. cells do not get an alpha change.. add new row moves down when a new row is created

tested the code under ios9 and 11.4

 

only used the sim not a real device.. but everything worked fine


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#10 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 June 2018 - 04:24 AM

Thanks very much for taking a look Ozie.

 

Just to confirm this is with Xcode 9.4 with base SDK set to Latest iOS (iOS 11.4) and building to a Simulator?

 

And stringsSection0.footerTitle = @"String Section Footer"; is remarked out so that footerTitle is nil? If the footerTitle is set to anything then it does all work as expected.

 

Here's a link to a screen recording from a 6s Plus to show what I'm seeing: https://www.dropbox....-15-09.MP4?dl=0

 

 

 

 


Cheers,

Dave

www.dgapps.ie

#11 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 07 June 2018 - 04:40 AM

yup xcode 9.4 base set to ios11.4 running in the sim iphone8

code exactly as above.. footer is still remarked 

 

same iphone6+ https://www.dropbox....tvtest.mp4?dl=0


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#12 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 June 2018 - 05:10 AM

ArghghghghghghRgrg! That's me pulling my hair out! This has been bugging me for months now!

 

Just to confirm, Sensible TableView 5.4.0 as well?

 

Could it be something in my Xcode setup causing this then? I don't think I'm doing anything unusual at all.

 

Any chance you could send me a copy of your project so I can see if there's anything at all that's different that might be causing this?


Cheers,

Dave

www.dgapps.ie

#13 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 June 2018 - 05:15 AM

I've just tried STV 5.3.0 and 5.2.1 and they both have the same disappearing cells as 5.4.0, so it's not that.


Cheers,

Dave

www.dgapps.ie

#14 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 08 June 2018 - 07:35 AM

Hi Ozie,

 

Thanks very much for your project, much appreciated.

 

The first obvious differences was that you were using the dynamic framework and I was using the static framework. But no, it wasn't anything to do with that :-(

 

The next obvious difference was that you were using a storyboard for your ViewController class, and I'm using just code.  So using the storyboard, and the simple viewDidLoad code at the top of this thread, everything works as expected! Hurrah!! :-)

 

As soon as you move away from the storyboard and all the problems come back :-(

 

Here's another simple viewDidLoad:

 

 


- (void)viewDidLoad {
    [super viewDidLoad];
    SCTableViewSection *selectionSection = [SCTableViewSection section];

    NSMutableArray *selectionItems = [[NSMutableArray alloc] initWithArray:@[@"Zero",@"One",@"Two",@"Three",@"Four"]];

    SCSelectionCell *selectionCell = [SCSelectionCell cellWithText:@"Selection"
                                                       boundObject:nil
                                       selectedIndexesPropertyName:nil
                                                             items:selectionItems
                                            allowMultipleSelection:YES
                                      ];
    selectionCell.allowAddingItems = YES;
    selectionCell.allowMovingItems = YES;
    selectionCell.allowDeletingItems = YES;
    selectionCell.allowEditDetailView = YES;
    selectionCell.allowNoSelection = YES;
    selectionCell.addNewItemCell = [SCTableViewCell cellWithText:@"Add an item..." textAlignment:NSTextAlignmentCenter];
    selectionCell.addNewItemCellExistsInNormalMode = NO;
    selectionCell.addNewItemCellExistsInEditingMode = YES;

    [selectionSection addCell:selectionCell];

    [self.tableViewModel addSection:selectionSection];
}

 

When adding or editing the items too be selected then I'm still seeing disappearing cells, edits not appearing after dismissing from the edit view, and STV confusing the Add an item... cell with any newly added cells.


Cheers,

Dave

www.dgapps.ie

#15 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 08 June 2018 - 08:26 PM

gee wiz.. i have not used Xcode for years now...

 

ok I can see your problem occurring.. and its easy to stop :P

 

just one line of extra code in your example code and the problem disappears 


Edited by ozie, 08 June 2018 - 08:27 PM.

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#16 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 10 June 2018 - 02:23 AM

Please put me out of my misery!! 

 

What's the one line of code??????


Cheers,

Dave

www.dgapps.ie

#17 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 10 June 2018 - 02:30 AM

hahahaha

 

so iOS11 does not like a tableviews headerview being NIL

 

so there are two things..

1) using your example code above (not the very first example code, the later one) you can enter in
 

selectionCell.detailViewControllerOptions.tableViewStyle = UITableViewStylePlain;

 

so the plain style of a table view does not have the nil headers and footers.. just if you enter this in.. you get a funny looking tableview when editing, because the table is plain but it still has a header and footer view.. but the problems you see disappear..

 

2) setting the new iOS11 features on the editing tableview.. it can stay grouped style.. and the background of the table looks right using:

selectionCell.cellActions.detailModelWillPresent = ^(SCTableViewCell *cell, NSIndexPath *indexPath, SCTableViewModel *detailModel) {
        detailModel.tableView.estimatedSectionHeaderHeight = 0;
        detailModel.tableView.estimatedSectionFooterHeight = 0;
};

 

the new estimatedSectionHeaderHeight & estimatedSectionFooterHeight being zero makes the table happy

 

so the cells were not having an alpha of 0.. there were being drawn off the screen where your could not see them.. if you scrolled after they disappeared, they showed back up when they were re-draw correctly

 

so this fix would be a every view where the tableviews are grouped..

I did not spend any time looking into STV code changes to correct the problem:)

 

have fun


Edited by ozie, 10 June 2018 - 02:31 AM.

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#18 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 10 June 2018 - 02:46 AM

ok.. i think this is the global fix.. changing the STV code.. (will need better testing than i quickly did) :)

 

edit the SensibleTableView > STV-Core > Models > SCTableViewModel.m file

 

add this code to line 190

 

if ([[_tableView class] instancesRespondToSelector:@selector(estimatedSectionHeaderHeight)])
{
    _tableView.estimatedSectionHeaderHeight = 0;
    _tableView.estimatedSectionFooterHeight = 0;
}

 

that should fix the problem on all views.. without having to change every view of code you have :)


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#19 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 10 June 2018 - 05:26 AM

Testing, testing, I'll be back in a while....


Cheers,

Dave

www.dgapps.ie

#20 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 11 June 2018 - 11:57 AM

Hi Ozie,
 
After testing your fix all morning and afternoon it looks like it works without breaking anything else. Hurrah!
 
Thank you, thank you, thank you!
 
I've been looking into this for weeks now, off an on.  Oddly I'm still seeing -[UITableView _updateWithItems:updateSupport:] calling setAlpha:0.000000 without a corresponding setAlpha:1.000000 on cells, but only sometimes now, and it doesn't seem to be effecting the visibly of the cell ¯\_(ツ)_/¯

 

How did you work out so quickly what was happening?

 

 

Is it OK to add your code to the source at https://github.com/wizgod/STV ? Looks like I'll need to read up on GitHub Pull Requests and how that all works. The last time I was committing changes to public code was using CVS on Sourceforge.

 

 

Once again, thank you.


Cheers,

Dave

www.dgapps.ie




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users