Xcode 6, scroll view renders different in iOS7 - 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?

Related

iPhone X launch image

I have added the Launch image of 1125px*2436px for iPhone X to get rid of black space at the top and bottom. However, adding so shifted the view to the left. All the textfields , buttons in the view are moved a little to the left. My app was developed without storyboards and autolayout.
iPhone 7 screenshot
iPhone X screen
xib view
Any ideas how this can be fixed?

My UITableViewCell containing a UIScrollView stopped scrolling vertically in iOS 9

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

iPhone 6+ does not have navigation bar back button item

I have developed an app in Xcode 5 before the new versions of iOS and iPhone 6/6+. It was working well in Xcode 5 with its simulators (iPhone retina 4 inches, etc.) but now that I have updated to Xcode 6 and I run my app in new simulators, it works great in the iPhone 4s, 5, 5s, and 6 simulators but not in the iPhone 6+ simulator.
I have a table view in my first view controller. If you tap on a cell the push segue brings you to an another view controller. There are two problems:
In every view controller, the top of the object (e.g. table view or a UIImage) is not shown and the scene is deficient.
when we go to the second view controller there is no back button item on the top in order to return to the home view controller.
How can I fix this? What is the problem?
I believe there is a bug in the iPhone 6+ simulator - I have also observed a similar behavior, but only on the simulator. Running the app on a real iPhone 6+ works as expected - the navigation bar is there as are all the buttons.
Its because iPhone 6+ simulator screen is too big to fit in some mac screen.
In a view controller the top object is not cut off, just use mouse scroller to scroll up to see the top object.
In second view controller again use mouse scroller to see back button.

Adding iOS 7 version of iPhone 4-inch launch image to project breaks launch image when run on iOS 7

I'm running into a problem on our landscape only app that targets iOS 6 and 7. Xcode gives me the following warning:
An iPhone Retina (4-inch) launch image for iOS 7.0 and later is required.
If I add the required images, when I launch the app on iOS 7, I get a black launch image shown. On iOS 6, it displays correctly. But without the images, it works just fine on both iOS 6 and 7.
I am already using Asset Catalogs in this project, so I don't think that's an issue.
I would really like to get rid of this warning, but I haven't been able to figure out a way around it.
XCode is looking for Portrait orientation for iPhone. You need to provide it for the launch image, but don’t let your application to rotate when device is in Portrait mode.
In order to do this you need to do the following:
Go to General -> Deployment Info -> Device Orientation. Deselect Landscape Left and Landscape Right. Select Portrait, then Landscape Left and Landscape Right, order is important!
Add the following function to your code (if not yet):
-(NSUInteger)supportedInterfaceOrientations
{
return (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight);
}
That’s all!
In my case (landscape only app), I was able to fix it by doing the following:
adding portrait to the supported orientations for the iPhone in my Info.plist
replacing shouldAutorotate: methods with supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation in my view controllers.
added application:supportedInterfaceOrientationsForWindow: to my app delegate.
Also I had to make sure that in the Info.plist that the portrait orientation was listed first. Xcode had added it to the end of the list, but if it was there, it would still be a black display on launch. Moved to the top, it was properly detected by iOS when the app was launching.
LaunchImage import a 640*1136 picture,
BTW, LaunchImage in Images.xcassets
sample picture

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.)