GithubHelp home page GithubHelp logo

malcommac / dmsplitview Goto Github PK

View Code? Open in Web Editor NEW
116.0 116.0 24.0 303 KB

New NSSplitView class with multiple subviews resize behaviors and animated transitions

Objective-C 98.71% Ruby 1.29%

dmsplitview's Introduction

Hello ๐Ÿ‘‹ I'm Daniele and I work as Mobile Tech Lead Manager at ImmobiliareLabs, the IT dept of Immobiliare.it.
I'm a passionate software engineer with a love for minimalism, product design and sushi.
I started programming on macOS in 2000 and iOS on 2007.

malcommac

OpenSource Projects

Maintaing and developing tools consumes resources and time.
While I enjoy making them your support is foundamental to allow me continue its development.
Consider becoming a Sponsor](https://github.com/sponsors/malcommac) of my works.

RealHTTP is lightweight await/async http client made for Swift.

RealFlags makes it easy to configure feature flags in your codebase.

Before async await there was promises. Hydra is a fast full-featured promise library for Swift.

Async/await client to interact with GitLab API v4 with Swift

With over 3 milion of downloads on CocoaPods, since 2015 SwiftDate is the #1 toolkit to parse, validate, manipulate, compare and display dates.

It allows you to use all system's location based services (plus external services like Google Maps, MapBox, OpenStreet and Nokia Here) directly from an easy to use and elegant APIs set.

SwiftRichString is a library which allows to create and manipulate attributed strings easily on all Apple Platforms.

Create complex scrollable layout using UIViewControllers or plain UIViews and simplify your code.

dmsplitview's People

Contributors

cbess avatar emiscience avatar jakepetroules avatar malcommac avatar tbaranes avatar terhechte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dmsplitview's Issues

Sizes of views change on window resize

Hey,

I know this is not trivial and you may ignore me if this is to much work, but would be nice to have.

When the window resizes the views changes size also. It is desired that when window resized only the middle view should change size while the left and right view should stay at the same size. Check out XCode to see this behaviour.

Message being sent to delegate when it should be sent to eventsDelegate

In the following method:

  • (BOOL) setPositions:(NSArray *)newPositions ofDividersAtIndexes:(NSArray *)indexes animated:(BOOL) animated completitionBlock:(void (^)(BOOL isEnded)) completition

near the top of that method, you have the following:

        if ([self.eventsDelegate respondsToSelector:@selector(splitView:splitViewIsAnimating:)])
            [((id <DMSplitViewDelegate>)self.delegate) splitView:self splitViewIsAnimating:YES];

You should be sending the call to splitView:splitViewIsAnimating: to self.eventsDelegate, but you are actually sending it to self.delegate

Splitview inconsistent state error when using autoSaveName to restore state of split view

When you set an autoSaveName for the split view, collapse a view, then quit and re-launch the app, the following error is displayed:

<DMSplitView: 0x100192e20>: the delegate <DMSplitView: 0x100192e20> was sent -splitView:resizeSubviewsWithOldSize: and left the subview frames in an inconsistent state:
Split view bounds: {{0, 0}, {816, 337}}
Subview frame: {{0, 0}, {100, 337}}
Subview frame: {{110, 0}, {644, 337}}
Subview frame: {{764, 0}, {152, 337}}
DMSplitViewExample[41225:303] The outer edges of the subview frames are supposed to line up with the split view's bounds' edges. NSSplitView is working around the problem, perhaps at the cost of more redrawing. (This message is only logged once per NSSplitView.)

The same thing is happening in my app as happens in the example app.

Alignment bug with centre aligned subviews when toggling panels

If you have a subview within a panel that is supposed to be aligned centred (either no strut is selected or the top strut is the only one selected for Autosizing in Interface Builder), then when you toggle any of the panels, the subview will end up being right-aligned instead of maintaining its centre position.

For example, the initial view with the icons properly centred:

Screen Shot 2013-02-16 at 6 35 46 PM

Then after clicking on the Toggle buttons (left and right), it looks like this:

Screen Shot 2013-02-16 at 6 35 58 PM

It's happening in the example app and in my app that's using DMSplitView too.

I'm not sure what's causing this problem. It doesn't happen if you drag the left pane so it's fully closed, but it does with the right most pane. It also doesn't happen on the left pane if you double-click on the divider bar to collapse or expand the view.

Also, after this happens, no amount of dragging the divider bar will correct it. The subview (the icon in this case) is stuck to the right edge of its superview.

And it doesn't matter if you use animated transitions or not. Same problem.

Any workaround for this that you know of?

applyPriorityResizeFromOldSize: can incorrectly skip height resizing on certain views

High level overview of the bug: You're using a dictionary for priorityIndexes, so you effectively loose sight of view indexes if you have 2 or more subviews set to the same priority.

Here was my specific scenario:
I have a vertical DMSplitView with 3 subviews. I want the middle subview to be resized when the window is resized, but I'd like the outer subviews to stay at a fixed size (unless they are manually resized).

So in my setup, I had the following priorities set for my subviews:
subview 0: 490
subview 1: 1
subview 2: 490

Because priorityIndexes uses priority as the key, it lost sight of subview 0 (because when I made the call to setPriority: 490 ofSubviewIndex: 2, that overwrote the entry in the dictionary for subview 0.

The main problem this created was that subview 0 would no longer get vertically resized because subview 0 wasn't in the priorityIndexes dictionary anymore.

The obvious workaround for my case was to simply set subview 2's priority to 489 and now it resizes as expected.

Crashes when resizing window

Very nice controller. Thank you for sharing it. Right now it crashes when the window gets resized. In your demo you can test this by resizing the window down.

MaxSize is ignored

When dragging pane dividers, the MaxSize of a pane is not taken into consideration; only the MinSize.

MaxSize seems to not take effect on initial resize either.

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.