Neev’s Experiments with iOS7 – Issues and Solutions

Contributed by Dhananjay Kumar Singh on 23 Oct 2013

Apple Inc. released the latest version of its mobile operating system, iOS 7 at the Apple Worldwide Developers Conference (WWDC) on June 10, 2013. iOS 7 was released on September 18, 2013 amid much fanfare. iOS 7 comes with a redesigned UI and many a modifications in its functionality. The list of iOS 7 supported devices include iPhone 4 and higher versions, iPod Touch, iPad 2 and higher versions, and the iPad Mini.

According to mobile and tablet website optimization company, OnSwipe, over 31.27% of all iOS-based devices now run on iOS 7.

We, at Neev, have been following the launch of iOS 7 and the changes that came with it very keenly. Based on our in-house experiments, here are some issues we found while building an existing code (that existed in older versions of iOS) in XCode5:

  1. Issue:

In Table View, the content in the cells of a table as well as the gridlines are not visible. This issue occurs when we try to superimpose another view onto a table view cell.

Solution:

Replace the below code used in older version of iOS:

NSArray *array = [cell subviews];

for (UIView *view in array)
{
[view removeFromSuperview];
}

[cell addSubview:dateSwitchView];

with the following code when you switch to iOS7:

NSArray *array = [cell.contentView subviews];

for (UIView *view in array)
{
[view removeFromSuperview];
}

[cell.contentView addSubview:dateSwitchView];

The above code can be used as a fix in all the versions of iOS.

 

2. Issue:

The navigation bar obstructs the view of the View Controller by overlapping on top (44 pixels) of the View Controller when both are in the same view.

Solution:

This issue occurs because Apple has introduced a translucent UI in iOS7. The translucent UI feature needs to be negated to overcome this issue.

The following code needs to be added before navigating to the ViewController:

Self.navigationController.navigationBar.translucent = NO;


3. Issue:

Extra space is consumed at the top in the table view of View Controller.

Solution:

In iOS7, the following code needs to be added:

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {

//IOS 6
} else { //iOS 7
[baseTableView setContentInset:UIEdgeInsetsMake(-20,0,0,0)];
}


4. Issue:

In a popover window, when we try to navigate from one View Controller to another, the View Controller we try to navigate to is not displayed in full size view and its size is curtailed.

Solution:

The following code needs to be added to the ViewController we try to navigate to:

(void)viewWillAppear:(BOOL)animated
{

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
[self setContentSizeForViewInPopover:CGSizeMake(320, 900)];
} }


5. Issue:

In the popover window, when we navigate to another View Controller and then, click on the ‘Back’ button to navigate back to the previous View Controller from where we started out, the size of the popover window does remains unchanged.

Solution:

In the previous View Controller, the following code exists:

-(void)viewWillAppear:(BOOL)animated

{

[self setContentSizeForViewInPopover:CGSizeMake(320, 172)];

}

In addition to the above code found in the previous View Controller, we need to add the following code to the other View Controller from which we try to navigate back to the previous View Controller:

-(void)back:(id)sender
{
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
[self setContentSizeForViewInPopover:CGSizeMake(320, 172)];
}

[self.navigationController popToRootViewControllerAnimated:YES];
}

-(void)viewWillAppear:(BOOL)animated

{

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {

// Load resources for iOS 6.1 or earlier

} else {

[self setContentSizeForViewInPopover:CGSizeMake(320, 900)];

} }

Stay tuned for more updates as we continue to unearth and solve more issues and challenges we face in application development on iOS7.

-Contributed by Dhananjay Kumar Singh

Visit us at Neevtech.com to know more about our offerings.

Tags: , , , , , , , , , , , , , ,

facebook comments:

Leave a Comment

Security Code: