Very Strange View Behavior When Implementing 3D Touch Preview - ios

I'm running into a very strange issue with 3D Touch previewing in my app. As you press into a cell to show a preview, a view seems to grow out of the top left corner, until it's about to show the preview view controller, at which point it's the full size of the view controller.
Here's a video of the behavior
I haven't been able to replicate in any apps I've created from scratch; however, creating a new tableview and view controller in the same app it still does it:
Video
I know this isn't a lot to go on, but I've exhausted my debugging knowledge. I'm not getting auto layout errors, when I debug the view hierarchy the view just isn't there. I'm hoping someone has experienced this and knows how to fix it.
Thanks!

It took me a while to hunt this bug down. Turns out it's caused (in my case) by https://github.com/icanzilb/EasyAnimation. When I remove the library the bug is gone.
Cheers!
Edit: As it happens it's documented here: https://github.com/icanzilb/EasyAnimation/issues/14

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.

A mysterious view is appearing/disappearing during a screen refresh

I'm in XCode 6.1.1 and iOS 8.x
As pictured, I have a map, and a tableview that shows details about a particular property on the map. There is also a toolbar along the top (blurred) that has up/down arrows on it to move to the next property, which basically rebuilds the tableview and refreshes the screen.
Well notice the weird square that's about 1.5" x 1.5" in the center of the screen.
That square quickly appears and disappears in the center of the screen when the screen is refreshed moving from property to property.
I have no idea where that view is coming from.
Is there an instrument in Instruments to catch this view in the act so I can figure out what it is and where it's coming from.
I've used the Time Profiler, but I don't recognize anything in the backtraces that helps me figure out where this mystery view is coming from, and I don't believe it's being created by any of the code in my app, which makes it more troublesome.
If this was your app, how would you figure out where this mystery view is coming from?
I found the answer within an Instruments time profile backtrace... turned out there was a third party activity indicator buried deep in some code.
Dooh!!
Instruments to the rescue once again.

iPad UIViewController subview reset issues

I am not really sure how to phrase this question but to keep it simple;
I originally started my app for iPhone but now made it universal. Being that did that, I started making iPad.xib files as well... Everything is complete now and everything is working how it should except ONE thing...
On the Controllers, I have an instructions button, (button that when touched, a uiview gets added to the center of the screen and says the instructions).
That all works great but for some reason when I touch it on one of the new iPad Controller (from the iPad xib) all the buttons that were moved around the view prior to touching the button, start to revert back to the initial position...
I do have a function that makes them do that, but to my knowledge, it is not being activated when this instructions button gets touched. If it were, I'm sure this "error" would also happen in the iPhone simulator...
Anyone have any idea? I keep looking at different solutions but can't really figure this out.
Thanks!!
This is most likely due to auto layout. If you change the frame of a view by setting frames, when the view updates (for any reason), the views will revert to the frames that are determined by their constraints. To fix the problem, you should move your buttons around using constraints, or turn off auto layout. While turning off auto layout is the easy way to fix this, you really should learn how to use that system.

iPhone 5: view size changes after playing a video

I'm in the process of updating an older app I've developed to new iphone 5 screen dimensions. I have a page that I was able to stretch vertically but I have a weird issue.
Problem
Currently the page looks like this:
Everything is stretching as normal. As you can notice, at the top I have a button that links to a video. When you press this button, the default iOS "videoView" we'll call it, comes up and plays my video like normal. When I press the "done" button to exit the video, here is what my page looks like when I return.
You can see the view gets stretched horizontally and vertically. Springs and struts for this view are as follows:
Any idea what might be going on here?
EDIT
Here is the view hierarchy. It's custom.
Not sure if it is the exact same problem, but I think there is a WWDC 2012 video showing a problem with the evolution of ViewControllers, perhaps it is the same problem you are facing.
The video is : Session 236 - The Evolution of View Controller on iOS
and also the sampling code of this video can be usefull.
To get the video go to you apple developer account and videos are freely downloadable through iTunes.
Link to WWDC 2012
Hope it will help you
EDIT
I went quickly through the video and I am not sure it is the same problem as you. However this video explains new iOS6 features in the layout and hierarchy of the view controllers which I hope will help you.

CoreAnimation stack going crazy

I've been asked to help fix a bug for a client, who is an inexperienced developer. However, I'm absolutely stumped by this one.
The problem is that after a string of opening and closing a view controller, which is being pushed onto a navigation controller, all of the subviews will disappear (including the navigation bar items) and show straight through to the window. After this happens, I can still press the buttons on the navigation bar, but they will immediately disappear on touch-up, and restoring a stable UI state is impossible without a quit & relaunch. Another obscure side effect is that after closing the app, Springboard will flash as I swipe between screens. My initial thoughts were that this was a memory issue (e.g. subviews getting released on memory warning), but I have since cleaned all the leaks & checked all the viewDidLoad/viewDidUnload handling of outlets and the problem is still happening. So now I think that with the Springboard effect, that the code is somehow messing up the state of core animation entirely.
Has anyone seen anything like this before? Or have any idea how it would be possible to make this much of a mess? I would attach some screenshots, but trying to take a screenshot with the phone when the app is in this state causes a system crash.
I've not experienced this, but maybe a memory warning is eating some of your views?
I know that iOS is free to unload view controllers that aren't visible.
I'd stick a breakpoint in viewdidunload or similar and see if that triggers.
As it turned out, this bug was caused by a UIView being deallocated while it had a superview.

Resources