iOS 7 to iOS 6 support [closed] - iphone

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have an app running on iOS 7. Now I want to support is 6+. Here is screenshot on iOS 7.
When I changed the deployment target to 6.0, things are positioned strangely on the screen. It shifted everything downward.
How can I fix it? Do I have to handle the positioning manually according to iOS version?
BTW I am not using auto layout.

At least two ways to handle this:
1. The big difference here is 0 in the y direction is actually 66px higher on screen in iOS7, by default, since views extends under the navigation bar and status bar.
If you're using storyboards, the simplest fix is to uncheck the 'under top bars' and 'under bottom bars' option when selecting your view controller.
However, this isn't the direction Apple's going in iOS7, though.
2. You can do the same as #1 by using the edgesForExtendedLayout property of your view controller.
3. If you're not using autolayout, then you can select your main view and change the iOS6/7 deltas option. In this case, you would want to enter -66 in the delta-Y box and 66 in the delta-height box. These are essentially insets that are applied to views when your app runs on iOS6.
4. Use autolayout with appropriate constraints and it should just work. I say should because it's easier to use autolayout if you think of layout in terms of relationships instead of frames and positions.

These are basics of iOS 7 UI. You have to read the transition docs, it's a MUST for iOS developers(you have to login ofcourse) :
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/index.html#//apple_ref/doc/uid/TP40013174
And you definitely have to watch the WWDC movies, especially:
building user interfaces for ios 7 (video number 201)
customizing your app's appearance for ios 7 (video number 214)
You can find them for free in iTunes.
Regarding you question:
It is the new iOS 7 approach that causes you issue. In iOS 7, the nav bar is translucent by deafult. In iOS 6 its not.
In case of translucency - the origin {0,0} is right under the navBar. So if the UIView with such origin in the first case will be under the nav bar, in second case - bellow. You can even notice the new iOS 7 approach of making everything under it nice and blurry - thanks to translucency.
To fix it, use
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}
and do the proper code formatting, like changing the origin in different cases.
It is very well explained, and so many more important updates in the docs and the videos that you really should check out, if you want not just to blindly develop, but also understand what are you doing.

Make a backup or copy
Switch back the "View as" property from 7.0 and later to iOS 6.1 and Earlier.
Beware, all your iOS7 prior settings will be lose after switching back
Rearrange the x coordinate to all subviews because everything will be a bit downer now.
(Because in iOS7 the default x=0 coordinates are under the navigation and status bar, and in pre-iOS7 it starts right above the navigation bar or status bar)
At viewDidLoad add the following line:
if ([self respondsToSelector:#selector(setEdgesForExtendedLayout:)]) [self setEdgesForExtendedLayout:UIRectEdgeNone];

Did you Try
self.edgesForExtendedLayout=UIRectEdgeNone;
Try
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
// here you go with iOS 7
self.edgesForExtendedLayout=UIRectEdgeNone;
}

Related

Xcode 11 Safe Area Does Not Go FullScreen

Since I am using Xcode 11 I am having problems with the Safe Area. My App is an ArKit- App that uses an ARSCNView. after upgrading to Xcode 11 the safe Are doesn't allow me to display it full screen anymore. Actually all the views in all ViewControllers can't be displayed in full screen. I really don't know where to start. Did anyone experience this kind of behavior?
Thanks!
Edit:
I unchecked all the necessary boxes I hope. The behavior I still get is this:
Storyboard Main
Inspector
Live View
There seems to be a view underneath. But I never added one and the inspector doesn't show. This changed with xcode11.
I just found out what happened to my ViewControllers. I am checking for internet connection with a LaunchViewController. The segue from this controller to the next one did not specify "full screen". I still don't know why I have to explicitly tell the segue to do so in Xcode 11. But in the end that solved my problem.
Thank you
The Safe Area is used as a reference for constraints for views and objects that you want the user to be able to interact with. It is used as a guide during the layout of objects on the screen. If you want to take advantage of the entire screen, constrain your views to the superview (basically the main view of the view controller). This is handy for displaying things like backgrounds on the entire view. Take a look at Apple's human interface guidelines for more info:
Apple's Human Interface Guidelines: Adaptivity and Layout
Similar Question:
iPhone X - Safe Area does not achieve full-screen experience?

Resize app automatically depending on screen size in swift

I just started making an app, and I have done a lot but I was not working with auto-layout. My whole app is in landscape mode, and I want it to work on all iPhone's. I now designed it for the iPhone 5, but when I open it on iPhone 6, there is a lot of whitespace. Is there a button to automatically resize everything? Or must I add auto layout and do every designing bit again?
Unfortunately you're probably going to have to layout everything again with auto-layout. A way to expedite your process would be converting the storyboard to auto-layout and then selecting "Reset to Suggested Constraints". You can access this option by pressing the small triangle icon in the bottom left.
Despite this, you probably will need to update a lot of the constraints manually. But this should give you a step in the right direction.
Have you tried Size Classes? Or Stack Views?
Size classes:
Apple documentation # https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Size-ClassSpecificLayout.html
Apple documentation on Stack Views #
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/LayoutUsingStackViews.html#//apple_ref/doc/uid/TP40010853-CH11-SW1
A good tutorial on "Stack Views":
https://www.raywenderlich.com/114552/uistackview-tutorial-introducing-stack-views

Best practice for developing for iphone 4s and 5/5c/5s screen sizes [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is it better to build separate views for the different screen sizes for the height of the iPhone. Or is it better to creat a #define IS_IPHONE5 and adjust the view's code based on the hight of the phone? Any other ideas would be appreciated.
Have you thought about using Auto Layout? It's the Apple-recommended way to do this.
You can find some posts online bashing Auto Layout. You shouldn't be discouraged by them, because from what I've seen they can mostly be divided into 2 groups:
incorrect understanding of Auto Layout by the authors,
poor Auto Layout implementation in Interface Builder in Xcode 4 (it's gotten a lot better in Xcode 5).
Using Auto layout is great option. Other then this you should create different views and use them depending on device and screen.
Creating different views for the different device screen resolutions is not a good idea. You should try to avoid constants when it comes to screen dimensions. If Apple decided to bring out a 6" phablet tomorrow with a different resolution you'd have to update your app and create an entirely new view for that resolution.
If you no longer have to support iOS5 then you should definitely go for auto layout. Take a look at this Ray Wenderlich tutorial to better understand auto layout:
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
If you still need to support iOS5 then go with auto-resizing masks (the above tutorial also explains auto-resizing in short), it has its limits but you can correct this in viewDidLayoutSubviews in UIViewControllers and layoutSubviews in UIViews.

UITableView overlaps status bar on iOS7 beta 4

Here is a UITableView that worked fine in iOS6 overlapping the status bar in iOS7. What is the best way to solve this problem? Using iOS7 beta 4. This behavior existed since beta 1.
META:
Complain about me disobeying NDA to Apple directly at 800-275-2273 or Stack Overflow at 212-232-8294; or help me solve this problem here which is clearly superior to Apple's forums.
If you're happy to have the "Language" section title to not overlap but don't mind the content overlapping once you scroll past it you can try this in your ViewController's viewDidLoad:
[self.tableView setContentInset:UIEdgeInsetsMake(20,
self.tableView.contentInset.left,
self.tableView.contentInset.bottom,
self.tableView.contentInset.right)];
One answer is described here https://devforums.apple.com/message/830042#830042 (yes, you need to be a paid developer to access it). All answers are various levels of hackery. Given how bad this situation is, there will probably be a different solution in the final version.
As per the rant thread (https://devforums.apple.com/thread/197429?tstart=0 "We all are royally screwed!!!") I do really think Apple should be using its own resources for beta testing rather than leaning on its vendors. In a FOSS project we would call this a community, but Apple is closed so we are vendors.
Starting with iOS 7, this is the expected behavior for a UITableView that's managed by a UITableViewController which is not inside a UINavigationController.

IOS new Facebook iPhone App UISplitViewController Layout [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
SplitView like Facebook app on iPhone
another break away .net developer here now trying to get used to the world of IOS.
I like the layout of the new Facebook iPhone app (October 2011), and want to implement something similar in an app I am doing. I know that the UISplitterControl is not available on iPhone but Facebook seem to have pulled a little magic to make it appear so on their new app.
In Facebook's implementation it looks to me that they have used a UINavigationController which slides to the right by x when the NavigationBar icon is tapped thus exposing a view underneath with the menu items.
Would appreciate if someone could help me work this out as the solution would also be a great learning curve.
I've tried setting a UINavigationController as the AppDelegate window root view controller, then using initwithframe to load a custom view which includes the menu items as a subview hidden behind the UINavigationcontroller root view. Then when the UINavgationController menu item button is clicked slide the NavigationController to the right thus exposing the view underneath with menu items.This presents two problems, first that the subview positioning doesn't work and also how can I slide the actual UINavigationController to the right to expose the menu view underneath.
Please help!
Might also want to check out my implementation on Github. It's specifically designed to resemble Facebook's implementation as much as possible (from a technical point of view). Also it leverages iOS 5's new UIViewController-Containment features, which most others don't. Thus it works flawlessly in both landscape and portrait modes. It's universal of course and highly flexible. One class only. The way you use it is similar to any other Apple made controller.
there is a similar post here: SplitView like Facebook app on iPhone.
you can also checkout the code directly at: https://github.com/mystcolor/JTRevealSidebarDemo
I'm having exactly the same question, my guess is that the "SplitView" is actually more likely a modal view that takes up only part of the screen. I haven't had the time to try it just yet but the following post might give some hint on how this can be done:
http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/
You might want to check out this project
https://github.com/aaronbrethorst/StackScrollView
Here some howto
http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience
Similar to the one "MyPad" is using.
Note: This is only for iPad but you might find some usefull stuff in it
I created a component that mimics the behavior of the Facebook slide out menu. It is available on github.
Here is link from stack overflow where people have discussed on same topic.
Also there are several links that can be helpful:
SplitView like Facebook app on iPhone