Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set iOS 6/7 Deltas programmatically

I was developing a UISplitView app by using Xcode 4.6 when I left iOS6 I had design:

enter image description here

Now I migrate to new Xcode5 and now I have this design:

enter image description here

UINavigationBar overlaps completelly my UISearchBar...

Leo Natan told me about using a iOS 6/7 Deltas but since I'm creating and adding my UISplitViewControllers programmatically,

this may doesn't work I need to set the iOS 6/7 programmatically but I don't know how, any help I'll appreciate

like image 526
Jesús Ayala Avatar asked Sep 25 '13 15:09

Jesús Ayala


2 Answers

In iOS 7 there are now extended edges, and that's why navigation bar overlaping the searchbar. You can set self.edgesForExtendedLayout = UIRectEdgeNone; this is UIVewControlelr property. You can also make checks depending on version of iOS and You can do things depending on current version of iOS in device.

NSString *version = [[UIDevice currentDevice] systemVersion];
int ver = [version intValue];
if (ver < 7){
//iOS 6 work
}
else{
//iOS 7 related work
}
like image 149
Adnan Aftab Avatar answered Oct 20 '22 01:10

Adnan Aftab


Also, you can use NSFoundationVersionNumber

if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
  // > iOS7
} else {
  // <= iOS6
}
like image 5
Alessandro Pirovano Avatar answered Oct 20 '22 02:10

Alessandro Pirovano