UISearchBar issue with iOS7 - ios

We have added an accessory view on right side of the search text field of UISearchBar.
We have developed our app with base SDK iOS 6, in iOS 6 all thing works well, but when we install the same app on iOS 7, the right accessory view of search text field is not being shown.
Please let me know how can we can resolve this.
Thanks.

Yes some of the component like UISwitch, accessory view of iOS 6 won't be visible in iOS 7 and vise-versa, if you use those UI component by drag-n-drop in Interface builder.
Here is three ways to use UI Component properly in iOS 7 & iOS 6 and previous version
Create such component programmatically and set the frame properly and add those view into main view as subview and run app in any version of iOS smoothly.
Create two separate projects for iOS 6 and below & for iOS 7 and later.
And the third is extension of first one , upgrade your project into iOS7 and build it in the same and run it in the iOS 6 and below, you will fill some UI component to not properly aligned, align those manually by setting frame and also you may find some UI component invisible, so do as first point says. create those UI component programmatically.

Issue has been fixed now by subclassing the UISearchBar and overriding the layoutSubviews method to find the search text field and assign the rightView of text field.

Related

iOS 8 with Xcode 6: PSCollectionView not scrollable and cell not selectable with Tabbed Application

I am using PSCollectionView, which is a Pinterest-style waterflow collection view. It is working very well with iOS 7 on Xcode 5&6 and in iOS 8 with Xcode 6, but in iOS 8 with Xcode 6 with TabBarController as the root controller, the view is not scrollable and cells are not selectable, just like the view is locked, even though it can load the data as normal.
I am wondering what may be the general reason for the collection view that is not scrollable and its cells are not selectable?
This class has already been 2-3 years, there may be some incompatibility within itself. For walking around, do you know there is any other Pinterest-style waterflow collection view that is working well now with iOS 8 with Xcode 6 that I can use instead?
Any ideas are appreciated! Thank you in advance!
After days trying to figure out this issue, finally got the solution.
It turns out it is nothing to do with the TabBar Controller nor iOS 8, it is the new setting of constraint of Xcode 6. I have to tick the "Installed" even though I already check "xC hR Installed" in the Attribute Inspector of the view used to show PSCollectionView. Now everything is working.
PS: but still don't know why I have to tick both of them to make it work. Any ideas?

How to make .xib files compatible to both iOS7, iOS6 and earlier [duplicate]

This question already has answers here:
Status bar and navigation bar issue in IOS7
(11 answers)
Closed 9 years ago.
I am using .xib files in my app and I am using xcode5.
If I run my app in iOS6 and earlier, the alignments are missing.
Any one know about this issue?
Do we have to create separate .xib files for iOS7 and iOS6?
EDIT: I turned off Autolayout but under iOS6, the views are still going down by 20 pixels.
If you haven't done so already, turn off AutoLayout in your xib files. Autolayout only came in with iOS 6 and newer iOS versions.
Also, you can preview what XIB files look like between iOS 6 and iOS 7 via a popup menu in the File Inspector:
in iOS7, the app windows starts from y=0px (in iOS6-, it begins at y=20px).
The quickest and easiest way to handle this, (and since you're already using Xcode5), is to switch off Autolayout and utilize the iOS6/7 Delta values for every view.
Basically:
Select every viewController's main view and uncheck "Use Autolayout"
Select every subView (UIButton, UILabel etc), go to the frame setting section
Increase their Y frame values by 20
but it seems you, #SudhakarTharigoppula, don't need to do this step.
...just do the next step
Enter a value of -20 for ΔY
This will start your app by leaving 20px in iOS7 but back in iOS6, the ΔY of -20px will compensate for the extra 20px you had given to every subView.
see: Status bar and navigation bar issue in IOS7

ios 7 support for existing iPad app

I have existing iPad app supporting iOS 5 and 6.
Can anybody help me to list down item that I need to take care while supporting iOS 7?
One thing I noticed that in existing code ((UITableView*)self.superview) in UITableViewCell doesn't work. superview of UITableViewCell is UITableViewWrapperView that need to be fixed in existing code.
The things are:
1. Navigation bar height and view style are different
2. Status bar is transparent in iOS 7 as in iOS 6 it was opaque.
3. Small thing is about the tint color. By default it is light blue in iOS 7.
4. Button borders have been removed.
Issue's i have faced while running the app in IOS 7.
Status bar issue (view controller get overlaps 20 pixel.)
FixForStatusBarIssue
Customize alert view won't work in IOS7. (We can't customize the alert view in IOS 7.)
My Fix -> You need to customize the view exactly like u want because you can't customize alert view in IOS7.
Issues related to threads.
My Fix -> Use dispatch_queue(GCD with delay) in case of UI not responding (Presenting a view controller from background thread.)
Zbar sdk memory leaks while presenting and dismissing the SDK (more than 5 times app getting slow.)
FixForZbarMemoryLeakIssue
this are the issues i have faced. fixes i have suggested working fine for me. You just use it if you need hope it will work.
Apple's iOS 7 UI Transition guide
Read descriptions of every single element you used in your app.
And be aware of the style and position of the bars (navigation bar/tab bar/tool bar...).
iOS 7 has changed a lot in view hierarchies, you can use Reveal to make things easier.

XCode 5 Table VIew Cell's Accessory -> Detail show nothing on iOS 6 device

I am migrating my app from iOS 6 to iOS 7. In XCode 5, I can see the Detail logo in the cell.
But, the reality is in iOS 6 device I can't see the Detail logo.
My App used to utilise Details Disclosure as accessory way. But, in iOS 7, it looks ugly. That is the reason I chosen Detail.
How to fix this?
Just use accessoryView, put any button you want there, and it will look the same on both iOS versions
You can also use the "detail disclosure" accessory instead of just using the "detail" accessory directly on your storyboard:
The down side of doing this is that it takes more space on the tableview in iOS 7 but the good one is you don't need add a custom button and you can attach segue from storyboard.

Make the keyboard in my iOS 7 app translucent/transparent

I've seen that iOS 7 brings some cool features in terms of design, and I was wondering whether I can make the keyboard transparent, as I've seen in some apps.
If so, how can I do it?
I've done a bit of research but haven't found much about it.
Assuming you're working with Xcode 5, the keyboard in iOS 7 IS transparent by default. You don't have to do anything. In IB/Storyboard, place a UITextField onto a ViewController, and turn that ViewController's view green (or some other color). When you click in the UITextField and the keyboard comes up, you'll notice that you can see the view's background color through the keyboard.
In order for the keyboard to be translucent by default, you will need to build your app on Xcode 5 with your Base SDK set to iOS 7.
If you are using an IB file originally created in an earlier Xcode, click on the File Inspector and change the View As property to Xcode 5.

Resources