My UITableViewCell containing a UIScrollView stopped scrolling vertically in iOS 9 - objective-c

I just noticed a behavior change that seems related to migrating to iOS 9.
I have a UITableView. In the first UITableViewCell I have a UIScrollView that I use to page through images. It should only scroll left<-->right. Finger dragging up and down should drag the UITableView up and down. Up until iOS 9 it did do that beautifully... Now when I compile for iOS9 devices or simulator I can still scroll the images left<-->right but the table no longer scrolls up and down. Those touches just get sucked into the abyss.
Let me add that when I compile from Xcode 7 to my device running iOS 8.4 it still behaves as intended. Scrolls up and down when dragging in the embedded UIScrollView.
Furthermore, when I download my last released version (compiled on previously released Xcode for iOS 8.1 target I get the expected behavior on the iOS 9 phone.
Additional wrinkle of weirdness: if (back in xcode7 compiling live to iOS9 device again) I start scrolling vertically from one of the other cells and the table is still gliding to a stop THEN I CAN drag up and down from the UIScrollView. What the heck?
Anything obvious jump out here?
Thanks,
Bill

Something in iOS 9 changes with respect to self's frame, apparently. I had to change this:
self.scrollView.contentSize = CGSizeMake(self.frame.size.width*self.pageImages.count, self.frame.size.width);
to this:
self.scrollView.contentSize = CGSizeMake(self.frame.size.width*self.pageImages.count, self.window.frame.size.width);
See that reference to window in the final version? Second time that bit me. :)

Related

IOS - Migrating storyboard to Xcode 8 resize

I used to have a story board in Xcode 7.3, today I started migrating to Xcode 8 by hand because I want to clean some stuff in this version.
The problem that I faced is that in the storyboard when I change the device type the content of the view controller scene is not adjusted to the phone.
This is an example:
The above is the same size as the storyboard in Xcode 7.3, actually Copy & Paste the View Controller Scene.
When I change the size to the next device I get this:
Now I have a space in the right. I'm using Auto Layout.
So I don't know what changed in this version or what do I need to do in order to make my storyboard fits on all iPhones sizes.
What I would need to see is if I change to a bigger phone then everything will auto fit on the new screen. Thats the way was working with Xcode 7.3.
Any advice?

Xcode 6, scroll view renders different in iOS7

I am making an app in Swift, with Xcode 6 beta 7, with base SDK iOS8. I want to build a form inside a scrollview with autolayout, and I am following this How-to.
It renders as expected in iOS 8 (simulator, both iPhone 4 and 5), but in iOS7.1 (Simulator or device) the scroll view seems to shift left, leaving no margin on the left and a bigger margin on the right, and the scroll indicator doesn't appear.
iOS8:
iOS7:
Is there anything I can do to fix this? Or should I wait Apple to fix this backward compatibility issue?

UIViewcontroller's view frame starting at unexpected location

We are started to convert our iOS 6 application into iOS 7. I tried to create one screen for my application. I used Xib file for design, I designed the screen from top to bottom with UILabel and UIButtons. When I tried to run the app in Simulator it showing differently from xib design. In simulator the designs are came down and bottom UILabel has hide.
I got the self.view.frame from viewDidLoad() was (0,64,32,504). But, it is showing correctly in viewDidAppear (0,0,320,568).
How can I resolve this issue in Xcode 5? Could you please help me to solve this.Looking forward your reply. Thanks.
You cannot depend on the frame in -viewDidLoad, because it hasn't been resized for the device at that point. You need to wait for -viewDidAppear.

In Xcode my UIButton is centered, however when I build and run the app it isn't. How do I fix this?

In Xcode my UIButton is centered and locked in the right place using the grids but when I run the app I'm building from a tutorial I'm following the button is slightly to the right.
Is there a quick fix for this other than shifting the button to the left in Xcode until it's centered in simulator which is pointless because the guides in Xcode are there to help so I'd like to take advantage of them and not need to do this.
Make sure you have unchecked the use Autolayout option for your Xib.
if is horizontal centered image, try like this:
ps: make sure that the parent view of the UIButton is also centered in the screen
After updating XCode I realised the issue was that XCode was launching ios simulator for 3.5inch iphone. I changed the device to iphone 4inch retina and this fixed the issue.

How to position static buttons and iPhone 5

I am working on an app where i have 12 buttons and labels underneath on one of the views. They are placed on the storyboard directly. I want to make sure they will get properly repositioned in iPhone 5. The solution that i tried is just to deselect all the lines in the autosizing for all the buttons. Now when i try it on iphone 5 the buttons get resized. The problem if i stretch the storyboard and move the buttons they get messed up when running on the smaller screen. So i can only position them on the smaller screen and then it seems to work. The app does not rotate. I would like to know if this is a good solution or there is a better solution for this case. I would like for the app to support iOS 5+
Thank you!
If you want layouts to work with varying screen sizes, you should become familiar with the new constraint-based layout scheme in iOS 6. A WWDC video on the subject can be viewed at http://www.youtube.com/watch?v=Dkr9eKxlMAk&feature=player_detailpage.
Essentially, you're going to use the old struts and springs system for pre-iOS 5 and conditionally use the new scheme for iOS 6. (iPhone 5 won't run any iOS version prior to 6.)