My App become halt when I click UISearchController Swift 5 - swift5

UISearchController on navigationbar was working fine , but after some time when I was trying to implement searcher functionality on home controller this problem occurs. Then I undo all things but same thing is happening.App works fine but as so as I click on UISearchController on top of navigationbar, the app goes on halt.
The same problem is occurring on other controllers also..What I do plz help me out

Related

Swift navigation bar animation issue

I am at a loss with what is potentially a simple fix.
I have a basic ViewController with a UINavigationController, and a UISearchBar embedded.
Basic view layout
When I PUSH a new UIViewController onto the Nav - I get a brief animation issue where a black background appears, and also the cancel button doesn't disappear.
Animation glitch
It's only brief, but annoying enough.
When I return back using the back button, the search bar reverts to white, and then switches to red.
Back display issue
I wondered if I had configured something wrong, so I created a fresh project and left everything with the defaults. Yet I get the same issue.
Stripped back and the same issue
I'm using xCode 9.3 - with swift 4.1
Any ideas?
Check the extendedLayout settings of your view controllers (these can be set in code or in the storyboard editor). They need to be the same for both view controllers or you'll get this animation glitch.
In your case the problem might be the embedded search bar. It seems to be present only for one of the view controllers. You've got navigation bars with two different heights because of that. The framework doesn't respond well to that...

iOS Keeping a SearchBar in palce with SWIFT

I am programming with Swift for iOS 8.
I would like to have a SearchBar on top of a Table that looks like and behave exactly like the one in Contacts App in the iPhone.
So far I have a UIViewControl embedded in a NavigationController, added an UISearchBar and an UITabelView to the UIViewControl. The Table is populated with data and searching is working. Problem: when I dismiss the keyboard, the Cancel Button is greyed out.
When I add the SearchBar with code and put it in self.tableView.tableHeaderView,
Keyboard and Cancel buttons works as expected but the SearchBar stays not in place when scrolling the tableView.
None of the many tutorials and advices I found solved the problem.
Any advices or tips?

XCODE 5 - Storyboard Segues Push vs Modal

I am currently learning iOS development and I began with a simple Tabbed Application. It has the default First and Second View in it. I added a TableView with static cells content. I then added another View Controller. I created a Segue using the storyboard. When I set the transition to modal, it works fine. When I set it to push, the app is crashing (Uncaught exception).
Any idea why?
How can I get more information regarding the exception? Can I make the app stops when it encounters an exception?
Figured it out.. I need to add a Navigation Controller to use push...

UIToolBar missing due to iPhone Message Compose Screen within the app

Something going wrong badly due to Message Compose Screen.
I am working on a TabBar based application. In some screens I am showing ToolBar instead of tabBar by setting hidesBottomBarWhenPushed = YES; and its working fine everytime. But In 1 screen I am sending SMS by opening Message Compose Screen within the iphone App. So problem occurs if I open Message Compose Screen and i clicked Cancel button of Message Screen.
So, whenever going back to that module where I was showing ToolBar. So on click of button no ToolBar. Totally blank, no toolbar and no tabbar (tabbar is quite obvious i have already set hidesBottomBarWhenPushed).. But why toolbar now showing due to Compose screen ?
There is no link with compose screen to this screen. Far different implementation and different controllers.
I have check by debugging, Toolbar frame is also fine.
Please help
Issue fixed... had problem with adding it to keyframe window
I think it is because the MFMessageComposeViewController has got a navigation bar. Your application should be a navigation based application for that. Otherwise your toolbar's frame position will be affected. I had this kind of problem once. So i changed the application into navigation based but hid the navigation controller.
Hope this might help you,
Happy coding!

iphone animation stops after one pass

I'm running SDK 3.2.3 I have a simple tab bar controller with three view controllers. Each view controller has an NSArray of images for a simple animation. The animation runs a loop when each of the tabs is pushed however if you go back to tab one after you've pressed another tab, the animation doesn't run again. Any code I could put in here to have it run again and again? help would be much appreciated.
You should consider to stop your animation on the viewWillDissappear method and start it again in the viewWillAppear.
Anyway, if you dont paste ypur code is very difficult to help you