Is there a workaround for random xcode segue actions? - ios

I have a strange situation. Have searched high and low but found nothing for others experiencing the same.
In my app there is a table view controller with multiple cells. Each cell does a push segue to a different view controller. When run, most work fine, but a few begin the segue (I see the text on the view controller beginning to slide in) but then the scene goes blank. The navigation is present and lets me unwind back to the table view controller.
The strange thing is that when I rebuild and rerun it's different segues that act that way and the ones that were previously acting funny are now correct. I thought this might be an issue in the simulator but the app I put on the App Store is doing the same thing.
Is this a known bug in XCODE and does anyone know of a workaround?
I am running XCODE V5.1.1 under OS X V10.9.3.
Thanks!

Related

How to smoothly translate view in iMessage extension in iOS 10?

I have issue when I try to push view controller in willTransitionToPresentationStyle:. The view was blinking for a split second before it fully expanded. It might be a small glitch or bug since iOS 10 and Xcode 8 are still in beta. But when I manually requested to change presentation style to MSMessagesAppPresentationStyleExpanded by calling requestPresentationStyle: after I push view controller, it went to expand mode more smoothly. Does anyone have similar issue?
I have had similar problems with transitions in iMessage apps. I think this should improve considerably when iOS 10 and Xcode 8 come out of beta, but for now we have to deal with Xcode's bugs.
There's a few things I've done to make this look better. Inside my extension I have a method that checks the presentation style every time the view changes. This method manages two different UIs - one for MSMessagesAppPresentationStyleExpanded and one for MSMessagesAppPresentationStyleCompact. This method hides and shows specific views accordingly. In my compact UI I have a button that allows the user to expand the interface by clicking it (this is basically the same as clicking the up arrow at the bottom right of the screen).
I've noticed that if you let the user expand the messages app after the view has been loaded for a while the transitions are much smoother and less buggy. Not sure why this is the case, but you should give it a try. Also, I've found segues to be extremely buggy, so that's why I went with keeping everything on one view controller.

Segue back button disappeared in iOS 9

Before iOS 9 was released, I've developed an app targeting iOS 8.4. I've used some UITableView connected each other via segue of kind "Show (e.g. Push)". It worked perfectly with the right behavior: every time I switched from a UITableView to another, the back button appeared, so the user is able to turn back to the previous scene; the back button appeared also from UITableView to UIViewController, using the same kind of segue. Now I have upgraded to the latest version of Xcode and targeting the app to iOS 9.0, I got this problem: now, if I go from UITableView to another UITableView, the back button doesn't appear anymore, but if I go from UITableView to UIViewController, the back button appears. I've seen other developers has had a similar problem (as you can see here, here and here), but I don't understand how they have solved (except for the third link, but it's not my case). Anyone knows how can I get back button working again? Thanks in advance
It looks like the guy who posted the second link is having the same problem as you. In a comment he said that the way he fixed it was getting rid of the extra navigation controllers:
No need put the navigation controller for each view. put the navigation controller start view only.
So that is what I would suggest doing. Only put a navigation controller on the first view controller. Get rid of all the others.
So, thanks to Caleb's and ogres' suggestions, I solved my problem in this way as you can see in this screenshot, I hope it helps anyone who will have the same problem!
If you have two UITableViews and you want connect them to each other, you just need one NavigationController.

Apple Watch: Status bar not visible after presenting a modal screen from page based navigation

When i present a modal screen from a page in page based navigation, the whole screen shifts up and the status bar is no longer visible.
Here is a gif of the issue:
I am using xCode 6.2 version.
This was not happening in xCode 6.2 Beta 4..
I am not sure if this is a simulator issue or this will actually happen on a real device too.
Does anyone have the same issue? Is there a workaround?
I reported a bug to apple (20109240) and it was marked as a duplicate of (19862945), and that one is still open.
Thanks in advance
This is a known issue in the final release that exhibits itself in two cases:
When presenting a second modal controller (paging or single) over an existing paging modal controller
When presenting a menu using Force Touch over a paging modal controller
This has been discussed in the Apple Developer Forums, and the only workaround I've heard about is one that I use in my app. Unfortunately, there's no simple code to share that solves the problem, so I'll describe the approach (which I'd consider messy, but workable).
First, you need to keep track of interface controller presentations. I have a framework for this, but you may have to roll your own. When a child interface controller has its willActivate called two times in a row (in other words, without a call to a different child interface controller) you can assume that a modal was presented/dismissed on top of it.
Your presenting/parent controller can then inform all children that the modal menu bug has happened, and those child controllers can unhide a replacement status bar with its own Cancel/Close button. With some work, you can recreate a pixel-perfect version of the standard status bar with identical behavior.
The final twist is to detect when your Watch app is suspended, then resumes. In that case, willActivate is also called twice. If you don't handle that situation, you'll end up unhiding the replacement status bar and have two on the screen simultaneously. Not a great scenario.
Getting this right is very tricky, but it does work. I just wish I had a simple code sample that you could inject.
Update: I pushed some of my workaround code to GitHub: https://github.com/mikeswanson/JBInterfaceController

UISplitView equivalent on the iPhone.

I have an iPad app which I am attempting to make universal and port over to my iPhone following this tutorial. http://www.appcoda.com/ios-univeral-app-tutorial/ (feel free to post a link if you believe it will help me).
So far, I have added a new storyboard file, named it Main_iPhone.storyboard and configured my target etc. However my iPad app is a UISplitView controller, with options on the side (in the master view) which control my detailview.
What I want to know is the iPhone equivalent of this object as i was made aware it cannot be used on the iPhone. Guidance needed on this one.
Thanks.
This is a very generalized answer since I have no idea what your app does.
The rootviewController of the app should be a navigation controller. The the root controller of the navigation controller should be the view controller that is on the left side of the split view controller. I'm going to assume that is a tableviewController.
When the user selects a row in the tableview controller, push the view controller that was on the right side of the split controller.
Now you have a master-child relationship.
Another thing to consider is that with the upcoming iOS 8 release, you'll be able to easily implement iPad like master-detail views on iPhone. (the concept is size constraint classes). As a developer, you can download the new xcode beta (and osx yosemite beta) to test this out.

Blank screen for iOS 5 tab after dismissing modal and coming back from background after a memory warning

Run a app with tabs using iOS 5 simulator or device
Bring up a modal dialog
Simulate memory warning (for devices go to some apps that are memory intensive)
Switch to another app (if you have not done so already)
Come back to the app
Dismiss the dialog
You will see a blank screen (the window). Test project to demonstrate this bug / issue: http://github.com/chetanpungaliya/iOS-5-TestModal
I ran into this myself today and can't find any explanation other than it's an iOS 5 bug. After a bit of hacking, I found a workaround. Before you dismiss the modal view controller, change tabBarController.selectedIndex to a different view controller index and then back again.
You can see this in a clone of your project at https://github.com/xjones/iOS-5-TestModal. I also submitted this to you as a pull request.
EDIT: added openradar report
Someone has also posted this on openradar: http://openradar.appspot.com/10529236
I too had the same issue and fixed it. The problem is that the outlets that we connect via xib are set to nil in viewDidUnload method. This method is called on all views that are not currently visible, when memory warning occurs. When we come back to those views, their viewDidLoad method is called again. The only way to fix this is to remove setNil methods from viewDIdUnload to dealloc method and everything will work fine.

Resources