Code Monkey home page Code Monkey logo

Comments (8)

kohdesmond avatar kohdesmond commented on May 27, 2024 1

i got the same issues. But i guess i managed to solve it by setting Top Bar = Opaque Navigation Bar

from kydrawercontroller.

ColdLogical avatar ColdLogical commented on May 27, 2024

@kohdesmond what do you mean set top bar? On which controller?

from kydrawercontroller.

kohdesmond avatar kohdesmond commented on May 27, 2024

@ColdLogical on the storyboard
screen shot 2016-10-10 at 15 12 28

from kydrawercontroller.

psi-gh avatar psi-gh commented on May 27, 2024

@kohdesmond Do you mean 'simulated metrics'? How can it affect for the running app?

from kydrawercontroller.

kohdesmond avatar kohdesmond commented on May 27, 2024

@psi-gh not quite sure but the simulated metrics affected my auto layout.
but it seems to only affect iOS 10 and it might be a "feature" with xcode 8

@ColdLogical does the weird fix works for you?

from kydrawercontroller.

Fogrunner avatar Fogrunner commented on May 27, 2024

+1

I have encountered the same issue.

Does anyone know how to fix it?

from kydrawercontroller.

Fogrunner avatar Fogrunner commented on May 27, 2024

As ColdLogical mentioned, we can avoid awkward moving by calling below

drawerController.setDrawerState(KYDrawerController.DrawerState.Opened, animated: false)
drawerController.setDrawerState(KYDrawerController.DrawerState.Closed, animated: false)

However, we could see warning also.

To avoid this.

Chage code a little bit

public func setDrawerState(_ state: DrawerState, animated: Bool) {
...

to

public func setDrawerState(_ state: DrawerState, animated: Bool, completion : (() -> ())? = nil) {
..
    { (finished: Bool) -> Void in
       ..
       completion?() 
    }

And then call like this.

 setDrawerState(KYDrawerController.DrawerState.opened, animated: false)
 {
     self.setDrawerState(KYDrawerController.DrawerState.closed, animated: false
 }

You can avoid the warning.

from kydrawercontroller.

timusus avatar timusus commented on May 27, 2024

Note, calling:

drawerController.setDrawerState(KYDrawerController.DrawerState.Opened, animated: false)
drawerController.setDrawerState(KYDrawerController.DrawerState.Closed, animated: false)

Can cause an imbalance of calls to beginAppearanceTransition/endAppearanceTransition which can cause your app to stop presenting view controllers correctly.

Customising the KYDrawerController to include a completion handler to 'resolve warnings' as suggested above helps to some degree (doesn't guarantee a balance of above mentioned calls).

The whole idea of opening and closing the drawer with no animation to fix a layout issue is a total hack.

@ykyouhei can you please look into this issue?

from kydrawercontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.