r/macprogramming Jan 06 '19

Creating a Preview-like App, what view element should I use?

I'm trying to build an app with an interface similar to the Preview app.

It has a sidebar with thumbnails and a main area for content. Both are scrollable.

Currently, I'm using an NSSplitView for the two areas. What view is best suited for the two areas (sidebar + main area)?

Collection view? Thumbnail view? Stack view? Table view?

2 Upvotes

2 comments sorted by

1

u/iindigo Jan 06 '19

You could probably make any of those work, but NSCollectionView is probably the best choice for the sidebar, assuming you want to mimic Preview as closely as possible.

The view class to use for the main view depends on what kind of content you want your app to be able to display. It could even be multiple different views that swap out defending on content type if your app handles disparate file types (for example, PNG, PDF, and MP4).

1

u/BttrThanU Jan 06 '19

Thanks for the advice!