Coder Social home page Coder Social logo

swift-slides-transition's Introduction

Swift-Slides-Transition

Collection View Transition to Image View ( Cocoa / macOS )

Show images from a directory or zipped file in a Collection View

On double-click perform a transition into an Image View for a single image and vice versa

The development environment now is Xcode 8 under OS X 10.12 aka macOS Sierra.

The storyboard method ( main.storyboard ) is used for coupling AppDelegate, WindowsController and three ViewControllers together. The transition between two view controllers is carried out by a storyboard segue.

You will find some useful methods to exchange data between all these objects. I wrote this program to become familiar with the Swift language and to get a feeling how to display images on the screen. It contains a lot of useful stuff regarding handling of windows, menus, images, segues, resizing images for thumbnails and so on.

The program is written in Swift 3 and respects the latest changes.

Usage: When starting the program you can choose a folder ( preferably containing images ) which afterwards are displayed in a collection view. The items of the collection view can be dragged as you like, you can even drag an item onto the desktop or in another folder. It is possible in the same manner to drag an item from the desktop or the finder into the collection view where it is shown immediately.

When you decide to look more intensely into an image, double click on the single item representing it. Then a transition from the collection view to a single image view is executed, in which the image is shown. The image is scaled so that it fits best into the main Screen. Clicking on the "Back" button will lead back to the collection view.

Both views are supporting now the "Full Screen Mode" of macOS.

The image files can be of different kind, including besides the normal types also EPS, multipage TIFFs and PDF documents.

The sequence of the shown images is controlled by the cursor keys ( look into the menu "View", too ):

  • back space : return to collection view

  • left : previous image

  • right : next image

in case of multi-page TIFFs or PDFs use

  • up : previous page of document

  • down : next page of document

The program does fill the recent documents entries under the "File" menu und you can use them in the normal manner.

There is a link in the source code to the ZipZap framework

Thanks to this framework also images from a zipped archive are read and stored in expanded form in a temporary folder. Thus they can be displayed in the collection view.

The program was inspired by an excellent article written by John Marstall

My thanks go to the Stack Overflow sites. Without the folks there and whose answers this program would not exist.

Disclaimer: Use the program for what purpose you like, but hold in mind, that I will not be responsible for any harm it will cause to your hard- or software. It was your decision to use this piece of software.

swift-slides-transition's People

Contributors

ekuester avatar

Watchers

 avatar  avatar

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.