andreamazz / BubbleTransition

A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
MIT License
3.32k stars 250 forks source link

Black background color on dismiss transition (Objective-C only) #12

Closed slxl closed 9 years ago

slxl commented 9 years ago
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    transition.transitionMode = .Dismiss
    transition.startingPoint = transitionButton.center
    transition.bubbleColor = transitionButton.backgroundColor!
    return transition
}

ios simulator screen shot 25 2015 19 40 51

Demo project, tested on simulator iOS8.3/iOS8.4 and on iPhone 5s iOS8.4

andreamazz commented 9 years ago

Tested now, it's working fine. I did a fresh clone also, just to be sure. Which version of Xcode are you using?

slxl commented 9 years ago

Version 6.4 (6E35b)

andreamazz commented 9 years ago

Yup, same version here, no issues.

slxl commented 9 years ago

What environment (iOS version, device/simulator) do you use?

andreamazz commented 9 years ago

8.4 on an iPhone 5s as you suggested above.

slxl commented 9 years ago

looks like I found, problem was with a setting for segue presentation (full screen instead of default in project), pardon, my fault

andreamazz commented 9 years ago

No problem :+1:

slxl commented 9 years ago

thanks for tool!

andreamazz commented 9 years ago

:+1:

slxl commented 9 years ago

@andreamazz problem still persists (but in my project only), looks like its something similar to what google returns for "dismiss modal view controller black screen" request, still looking for solution :/

all presentation settings and stuff are (i hope) identical, the only significant difference is that im using your BubbleTransition.swift in objective-c project. But I think that shouldnt be a problem

andreamazz commented 9 years ago

Can you share the code or reproduce part of it in a stand alone project? I'll be happy to take a look at it.

slxl commented 9 years ago

Will try tmrw, thanks!

peskish commented 9 years ago

I found solution here: http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=18661

Add this code in prepareForSegue:

UIViewController *controller = segue.destinationViewController;

if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
} else {
    controller.modalPresentationStyle = UIModalPresentationOverCurrentContext;

}
slxl commented 9 years ago

@andreamazz Despite being slowpoke, but I'm responsible also :)

https://dl.dropboxusercontent.com/u/18509214/TransitionTest.zip

here is a template project with a same structure as mine original. Would be great if you' have a look whats wrong there. Thanks! )

slxl commented 9 years ago

@andreamazz had a time to look?

andreamazz commented 9 years ago

Not yet, sorry, I'll get around it this weekend.

slxl commented 9 years ago

@andreamazz appreciate this, thanks! I tried few approaches already, we could discuss in skype if you want (id: slxl.ru)

andreamazz commented 9 years ago

Well, I'm confused. This is the view hierarchy in the sample:

screen shot 2015-09-27 at 19 15 27

You can see the starting view. This is the hierarchy of your sample:

screen shot 2015-09-27 at 19 14 52

The starting view is not in the hierarchy, that's why you see a black screen during the transition. Can't figure out why...

andreamazz commented 9 years ago

Ok, I started a new project, dropped in the animation, and I have the same issue. wth...

andreamazz commented 9 years ago

The same sample written in Swift works fine. Awesome.

andreamazz commented 9 years ago

Objective-C sample: http://d.pr/f/1fsLx

Swift sample: http://d.pr/f/1aNFW

slxl commented 9 years ago

@andreamazz good news everyone!

somehow in both (yours and mine) projects there was

controller.modalTransitionStyle = UIModalPresentationCustom; // incorrect

instead of

controller.modalPresentationStyle = UIModalPresentationCustom; // correct

thanks to apple developer's support )

andreamazz commented 9 years ago

Sneaky! Glad that this wasn't related to the lib itself.
Thanks for solving the mystery @slxl :+1:

Cheers

slxl commented 9 years ago

i'd say, glad it wasn't related to Obj-C :)

andreamazz commented 9 years ago

That would have been awkward :grimacing:

alicanbatur commented 8 years ago

This fixed for me, using controller.modalPresentationStyle = UIModalPresentationCustom; instead of controller.modalTransitionStyle = UIModalPresentationCustom; // incorrect

fyi. (I'm on a objc project btw.)