Skip to content

iOS9 - left utility buttons, visible on first load #353

Open

Description

@mfrancekovic

Hi,

the lib worked perfectly for me on iOS7, iOS8, but now when building on iOS9, all of the left utility buttons are by default swiped in. User can swipe them out but still it's strange. Wondering what has changed on iOS9 to cause this.

Anybody with the same issue?

Activity

  1. skuske commented on Sep 29, 2015

    @skuske

    Yes, same issue here, but on iPad (mini 2) only, not on iPhone. Not tested on other devices than those.

    Any solutions yet?

  2. mcicak commented on Oct 2, 2015

    @mcicak

    I have this issue when changing app width on iPadAir2 multi task split.

  3. thepolymatt commented on Oct 4, 2015

    @thepolymatt

    Same problem here on iPhone.

  4. thepolymatt commented on Oct 4, 2015

    @thepolymatt

    So, I'm not quite sure why, but it appears that there is a strange conflict/race condition when SWTableViewCell calls layoutSubviews.

    If you set a break in contentOffsetForCellState, you'll see that layout for each cell is called twice. When its called directly via the layoutSubviews method, it sets the X offset correctly, but when called via the [super layoutSubviews] method, the cellState oddly ends up being kCellStateLeft.

    Workaround: If you move the [self updateCellState] inside the following If block:

    if (!self.cellScrollView.isTracking && !self.cellScrollView.isDecelerating)

    It seems to work as expected.

    Hope that helps everyone.

  5. hhp21 commented on Oct 8, 2015

    @hhp21

    I'm seeing the same issue on ios9 iPads only. @foreignmedia I tried your workaround but without success - in case I misunderstood, you are suggesting we modify the layoutSubview in SWTableViewCell.m to this?

    
    - (void)layoutSubviews
    {
        [super layoutSubviews];
        
        // Offset the contentView origin so that it appears correctly w/rt the enclosing scroll view (to which we moved it).
        CGRect frame = self.contentView.frame;
        frame.origin.x = [self leftUtilityButtonsWidth];
        _contentCellView.frame = frame;
        
        self.cellScrollView.contentSize = CGSizeMake(CGRectGetWidth(self.frame) + [self utilityButtonsPadding], CGRectGetHeight(self.frame));
        
        if (!self.cellScrollView.isTracking && !self.cellScrollView.isDecelerating)
        {
            self.cellScrollView.contentOffset = [self contentOffsetForCellState:_cellState];
            [self updateCellState];
        }
    }
    

    Thank you.

  6. thepolymatt commented on Oct 8, 2015

    @thepolymatt

    @hhp21 That's what I had but it seems like that wasn't a good work-around as the issue came back for me as well. I haven't been able to trace it back to the issue, but I'm still seeing my cells being laid out twice. Once with the correct cellState (Center) and one with the incorrect one (Left).

  7. skuske commented on Oct 20, 2015

    @skuske

    Fix #353 does actually not seem to fix this. At least not for me... :/
    Has anybody a reliable fix for this that works on any (!) device?

  8. skuske commented on Oct 20, 2015

    @skuske

    I observed this issue on iPad Mini (2) with iOS 9.0 installed. Now, with iOS 9.0.2 installed, it no longer occurs on my iPad. However, in Simulator with iOS 9.0, the issue is still there if it simulates iPad.
    Can somebody confirm that this has been fixed in iOS 9.0.1 or 9.0.2?

  9. skuske commented on Oct 22, 2015

    @skuske

    For me, the problem went away after upgrading to iOS 9.1 ...

  10. rvhelden commented on Oct 26, 2015

    @rvhelden

    For me the problem still remains after update IOS 9.1 and Fix #355
    Is it possible to close the left utility buttons programmatically?

  11. qi-wang commented on Oct 28, 2015

    @qi-wang

    Somehow the content offset is reset to zero during the super.layoutSubviews() call, that would cause SWTableViewCell.updateCellState() to set the cell state to Left when the cell is initially displayed.
    I tried to set layoutUpdating to make sure that the cell state does not change during the super call.
    The following fix in SWTableViewCell.m works for me.

    - (void)layoutSubviews
    {    
        BOOL isPad = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad;
        if (isPad == YES) {
            layoutUpdating = YES;
            [super layoutSubviews];
            layoutUpdating = NO;
        } else {
            [super layoutSubviews];
        }
    
        // Offset the contentView origin so that it appears correctly w/rt the enclosing scroll view (to which we moved it).
        CGRect frame = self.contentView.frame;
    ...
    
  12. rvhelden commented on Oct 28, 2015

    @rvhelden

    It worked for me! Thanks!

  13. edalford11 commented on Oct 29, 2015

    @edalford11

    This is happening to me on all devices on iOS 9.1. @qi-wang fix seems to solve it for me by just leaving out the iPad check.

  14. EGDBE commented on Nov 7, 2015

    @EGDBE

    qi-wang code fixed the problem in my real device iPad Air. Thanks!

  15. solidusex commented on Nov 7, 2015

    @solidusex

    Yeah, it worked~~~

  16. valeIT commented on Nov 14, 2015

    @valeIT

    worked, thanks

  17. matteogazzato commented on Feb 18, 2016

    @matteogazzato

    Hi, i've done a pull request based on this issue https://github.com/CEWendel/SWTableViewCell/pull/378. Hope it could be useful.

  18. added a commit that references this issue on Oct 13, 2016
  19. sharonSilicus commented on Nov 24, 2016

    @sharonSilicus

    I think this is again happening on iOS 10.0.1 and 10.1.1 on iPad Pro only

  20. issambellemallem commented on Nov 28, 2016

    @issambellemallem

    I have the same problem on Ipad IOS 9.5.3 or heigher

  21. dipakdipak commented on Feb 6, 2019

    @dipakdipak

    Instead of this:
    if (cell == nil) { cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; cell.leftUtilityButtons = [self leftButtons]; cell.rightUtilityButtons = [self rightButtons]; cell.delegate = self; }

    I have used following and it started working:

    if (cell == nil) { cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions