UITableView no longer scrolling using xCode 4.5, deploying on 5.x or 6.0 - xcode

Deployed project using UITableView for display of images.
Upgraded to xCode 4.5, suddenly my UITableView no longer scrolls.
This occurs both on the device and on the simulator with iOS 5.0 -> 6.0
Additionally, I have found that I can no longer set the number of minimum touches for the PanGestureRecognizer programmatically.
Other StackOverflow ticket
In fact, a Zombie analysis reveals that the recognizer has been released. This could definitely explain the above behavior. My attempt to set the recognizer is as follows and crashes.
UIPanGestureRecognizer* pgr = [imageTableView panGestureRecognizer];
[pgr setMinimumNumberOfTouches:2];
[pgr setMaximumNumberOfTouches:2];
Is anyone else seeing this issue?

I had a similar problem when moving to iOS6/XCode 4.5. It seems that the UIPanGestureRecognizer now steals touches from underlying UIScrollViews or UITableViews.
I found a work around for this in the post below. It's not the top rated answer, so I'll re-paste the content below as well:
iphone - UIGestureRecognizer prevents UITableView from scrolling in Xcode 4.5
I had the same issue: I used to drag my TabGestureRecognizer directly onto the storyboard instead of creating them through code. With iOS6 this now seems to break scrolling.
I prefer adding views, gestures, etc directly onto the storyboard instead of through code.
You can still do this but with two changes:
1) Referencing Outlet Collections
Right-click the GestureRecognizer which is visible to you within the scene's dock.
Clear the section Referencing Outlet Collections
2) Attach the GestureRecognizer to the related view through code
Create an outlet for your GestureRecognizer
Add the following line within the viewDidLoad method:
[self.tableView addGestureRecognizer:_tabGesture];

Related

How to convert manual view controller to storyboard as a launch screen

New iOS requirements need Apps for iPhone or iPad must be built with the iOS 13 SDK or later and use an Xcode storyboard to provide the app’s launch screen.
But my project is very old and has never used Storyboards. All UI elements are created dynamically using ViewControllers.
I managed to create a storyboard file and set it as a launcher but it has no scenes and I do not know how to proceed. I would like to:
Create a scene where I place only the original launch image inside (hoping that apple still accepts this branding)
If it is possible to just connect my main ViewController with the scene (if that works with dynamical ViewControllers)
If nothing helps than I would need to create a simple scene which has just a bottom bar like my ViewController
I had this exact issue, here's what I did:
Create LaunchScreen.storyboard and set to use it as launch screen
Using the + button in the top-right (this was not an obvious step), add a View Controller into the storyboard
Untick "Use Safe Area Layout Guides" on the right panel if you're getting that error
Tick "Is Initial View Controller"
Then clean and run, for me it just worked. I did have trouble seeing it update though, as discussed here: Launch Screen storyboard not displaying image

How to incorporate a UISearchController into new (iOS8) UISplitviewController

I try to build a simple app based on the UISplitViewController template from Xcode 6 for universal apps (with Storyboard and CoreData/NSFetchedResultsController). This app should also provide a search bar for the MasterViewController. Unfortunately, Xcode 6 provides no InterfaceBuilder element for the UISearchBar/UISearchController combo (only the depreciated UISearchBar/UISearchDisplayController).
In the iOS Developer library, Apple provides the "Table Search with UISearchController" example, but this is not based on the UISplitViewController and supports only iPhone.
My problem is, that I'm not able to show the detail view on the correct ViewController under all circumstances. I tried to transfer the approach from the Apple example project to the UISplitViewController template. In this, one is encouraged to show the search results in a separate UITableViewController subclass (ResultsTableViewController) and use this as the searchResultsController of the UISearchController. I was not able to create a scene in InterfaceBuilder for this setup so I had to add these manually in code.
The problems begin when I click on a table cell of the ResultsTableViewController. This vc is not part of the scene in InterfaceBuilde and I don't know how to add it to the SplitViewController setting correctly. The biggest problem is the weird behavoir of the iPhone 6 Plus and the UISplitViewController. In portrait mode it behaves like an iPhone and doesn't seem to have a SplitViewController and only uses a NavigationController to which I push my DetailViewController. In landscape mode it behaves like an iPad with SplitViewController were I have to get the second ViewController of the SplitViewController childControllers and push the DetailViewController on this one.
Now it happens, when I start in portrait mode and switch to landscape mode that the DetailViewController is all gone, showing gray space where the DetailVC should be. It seems, when going to portrait mode, the DetailViewController gets kicked from the SplitViewController (or the SplitViewController gets kicked at all in favor for the iPhones NavigationController setup). When switching back to landscape the SplitViewController is initialized again but without proper initialization of the DetailViewController.
Is there any template or suggestion on how to correctly implement search capabilities on a universal UISplitViewController?
Cheers
Björn

Showing views in interface builder outside viewcontroller hierarchy in xcode5

I often make use of views in interface builder that live outside of the viewcontroller hierarchy (see screen grab below for simple example).
Before upgrading to Xcode5 I could get this view to appear on the storyboard by writing an IBAction outlet and dragging a connection from the code to the view in the storyboard.
If you paused over the button for a moment it would flash and then open up as a view on the storyboard that is then a lot easier to work with.
Since upgrading this function no longer seems available. Has anyone found out how to get these views to appear on the storyboard?
Edit:
Using the temporary viewcontroller as described in this answer seems one approach, although fiddly since you need to move the UIView stack between viewcontrollers each time you want to edit the layout. Using a separate XIB is starting to seem like the sanest approach.
https://stackoverflow.com/a/13713385/1060154
Finally, we get this back in Xcode 7.
Hallelu!

Xcode 4.5 "Apply retina 4 Form factor" toggle button not working properly

I'm trying to update an IOS app for IOS6 and iPhone 5, but I have a problem resizing some views from the main Storyboard.
When I click on the new "Apply Retina 4 Form Factor" button, some of the views included in the StoryBoard don´t resize. I´ve checked all the settings for every Scene and seem to be configured in the same way. Any idea? Thanks in advance.
You might have found your solution but I just had a similar problem. For future notice, I found the fix was in the show size inspector and instead of using layout rectangle, I used frame rectangle.
I was having the same problem, this answer worked for me and finally removed the letterbox:
https://stackoverflow.com/a/12927282/539149
So add a 640x1136 launch image called Default-568h#2x.png and set the "Retina (4-inch)" target setting to it. More info for the other sizes here:
http://www.idev101.com/code/User_Interface/launchImages.html
Just in case it helps others, I had tried these links and none of them got rid of the letterbox, but they did at least enable the resize masks:
Resize of UIViewController in storyboard
Xcode 4.5: can't set root view autoresizingMask in Interface Builder
how do you resize (visually, not programmatically) the detail view of a UISplitViewController in a storyboard?
iphone 5 and storyboard setting autoresizing masks

iPhone simulator not responding when using storyboards

I'm quite new to iOS Programming. I've done Objective-C for about a year, and now I want to start making apps for the iPhone. I think I'm missing out on something really simple, though. What I've done is this:
First I created a new Single View Application with TestApp as a product name. I enabled Use Storyboards, Use Automatic Reference Counting and Include Unit Tests. After creating the project, I dragged a UIButton onto the View in the storyboard file.
Note that I didn't write a single line of code. I launched my app in the iPhone Simulator and pressed the button, but it's not responding. I know I didn't assign an action to the press of the button, but the gradient of the button isn't changing, as I know it should. The User Interaction Enabled properties of both my view and my button were enabled.
Recently, I've created a few apps in Xcode that worked just fine, but I didn't use storyboards in those projects. Thus, I'm guessing there's something extra to do when using storyboards of which I'm just unaware. I'm using Xcode 4.5 and the iPhone 6.0 Simulator.
I wrote NSLog(#"View was loaded."); statement in the viewDidLoad method of my ViewController to make sure this view controller was actually loaded. (I know my button wouldn't show up if it was the wrong view controller, but I did this just to make sure.)
I also wrote a changeTitle: method in my ViewController to change the title of my button to New Title after it was pressed, just in case the button worked but its gradient just wouldn't respond to a tap. I linked this IBAction to my button, but it wasn't called.
In my ViewController, I created an IBOutlet of a UIButton which I connected to my button. In the viewDidLoad method of my ViewController, I changed the title of my button to New Title, this actually worked. The title of my button changed to this new title when launching my app in the iOS Simulator. The button itself still wasn't responding, though.
As a last try, I also wrote [button setEnabled:YES]; in my ViewController's viewDidLoad method, but this didn't help. My button still doesn't respond to any tap. What am I missing out on?
This is weird. I had an issue with my printer, so I restarted my computer. After this, this issue was suddenly solved as well (just like my printer issue). I'm not sure how this could have affected anything, but I'm glad it works again!
Ran into the same issue.
Apparently Content Reseting the Simulator worked for me
Very strange this..

Resources