Button inside UITableViewCell prevents scrolling only in iOS8 - ios

I have a custom UIButton inside a custom UITableViewCell which was working on all versions and devices until I test it on iOS8.
When you try to scroll the table over the button it works (scrolls) on all devices and on all iOS versions except iOS8.
I for sure played with
_tableViewController.tableView.canCancelContentTouches=YES;
_tableViewController.tableView.delaysContentTouches=YES;
But nothing changes.
Did something change especially related to touches or scrollviews, or... on iOS8?
update
Strangely, replacing UIView with UIScrollView (adding the following codes to the viewcontroller) solved the problem. I still don't know why this is required in iOS8.
-(void)loadView{
UIScrollView *scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0,0,1,1)];
self.view=scrollView;
}

Related

Custom UITableViewCell layout changes on click (iOS7 only)

In order to get my app in line with guidelines for iOS8, I've implemented auto layout in my custom table view cell. On iOS8 this looks fine - the cells are laid out as I'd like at all screen sizes. On iOS7 however, the text boxes start out with only one line of text each, with the remaining text cut off (with an ellipsis). When touching the button however (on touch down), the cell's layout changes and it looks more like it does on iOS8. I can't seem to find what is being called here, and there aren't any constraint errors/warnings coming up in the console. Any idea how I might debug something like this, or is this a known bug in iOS8 so far?
I've noticed too when using self-sizing cells made in a storyboard. I was able to get it to work correctly by calling layoutIfNeeded in the cell's didMoveToSuperview method,
-(void)didMoveToSuperview {
[self layoutIfNeeded];
}

UIView inside UIScrollView becoming touch-unresponsive with iOS 7.1

I am developing an iPad app which presents to the user a set of zoomable pages. There is a (paged) UIScrollView used for scrolling between pages, and each page consists of another UIScrollView which allows pinch&zoom, and contains as subview the actual page content which is a custom UIView subclass with CALayer drawings.
Everything was working fine as of iOS 7.0.x. Unfortunately, when running the app on iPads updated to iOS 7.1, the pages'UIView is completely unresponsive to touch events: none of the UIGestureRecognizers attached to it is ever fired, touchesBegan/Moved/Ended methods are never called, and even pinch gestures that should be captured by the parent ScrollView are not recognized anymore if they happen inside the UIView's bounds (outside of it, they work).
When i set to NO the parent Scrollviews' scrollEnabled property, the touch events properly reach the UIView but of course this is not the behavior I need.
Apple documentation doesn't say anything about changes in UIKit framework, and I also have no clue on how to debug this, since on previous iOS releases everything was working as expected.
Any idea?
Edit 31/03/2014:
I was able to do some more debug, and noted that if I omit to add to the UIView's CALayer a couple of sublayers (that come from two custom subclasses of UIView), the problem doesn't occur.
I ended up solving my issue.
What I did was to stop adding the CALayers as sub-layers to the UIVIew, and instead adding the CALayers' parent views as sub-views to the main UIView.
I still have no idea on why this is happening in 7.1, given that no changes from 7.0 was mentioned in the documentation for this topic.
Anyhow, hope this can help...

Preventing autoscroll with UITextView embedded in UIScrollView on iOS 7

I've been using the technique of wrapping a UITextField in a UIScrollView to prevent autoscrolling, for details on this, see this discussion on SO:
Disable UIScrollView scrolling when UITextField becomes first responder
This has been working fine for some time now on iOS versions < 7. However, it no longer seems to work on iOS 7. Has anybody else encountered this? Has anybody found a fix?
Figured out what was happening ... I had code that was setting the contentOffset.y to 0.0f in certain cases ... but on iOS 7, that was causing the scroll view to scroll up too far, and it should be setting it to -64.0f. I mistakenly thought this was being caused by UIScrollView's autoscrolling behavior.

(iOS7) Scroll to cursor in UITextView in UITableView in UIScrollView

I have a problem since I updated to iOS7.
I have base UIScrollView horizontally and there is UITableView on it
(looks like a navigation style).
And I addChild UITextView on UITableView not on the cells.
And it scrolled to UITextView's cursor when typing keyboard. And it works greatly until iOS 6 but not since updating iOS7.
How can I solve this problem?
Thanks.
Handle textViewDidChangeSelection in UITextViewDelegate:
- (void)textViewDidChangeSelection:(UITextView *)textView {
[textView scrollRangeToVisible:textView.selectedRange];
}
The exact solution depends on your application, you can handle by subclassing UITextView but I would prefer a decorator pattern here (on UITextViewDelegate protocol).
I hope it helps.
Have you created your XIBs in xCode4 and now trying to open it in xCode5?
If yes than please check your XIBs properly as Xcode5 updates older xCode 4.x XIBs and sometimes it results in a unpredicted output.. I faces the same issues when all my views just disappears after opening it in Xcode5..
Also do try to change the settings of the xib in File Inspector to open in xcode 4.x and view as ios6.1 and earlier and see if it changes anything..

UIScrollView layoutSubviews behavior changes in iOS 5?

I'm working on a component that is a subclass from UIView and contains a UIScrollView.
When scrolling, I noticed different behaviors depending on which SDK I build with. On iOS 4 the layoutSubviews message is send on the scroll view's superview (which is my component) but on iOS 5 it seems that the message is not send anymore...
After taking a look at the iOS 5 release notes and changelog, I did not find any mention of such a change. Did I miss somethin?
In iOS5, layoutSubviews is not called on a scrollView's superview. But it was in iOS4.
If you want this behavior in iOS5, do this in your subclass of UIScrollView:
- (void)layoutSubviews {
[super layoutSubviews];
// causes layoutSubviews to get called on superview
[self.superview setNeedsLayout];
This was probably changed to be more efficient. Just because UIScrollView is scrolling, doesn't mean it's superview needs to layout itself.
I had big probs with resizing the size of button witch was subview in tableview. The nib loaded the smaller button and after loading I resize it. But the table view content didn't. (In iOS 4.* it was perfect but in iOS 5). So I figured out that I have to place my resizing in ViewDidLoad. I hope it helps to some1 =)

Resources