No commit activity in last 3 years
No release in over 3 years
RubyMotion image view controller that lets you preview images by means of tilt
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5
>= 0
 Project Readme

iOS (RubyMotion) Image Controller with Tilt Control

Code Climate

This library facilitates the use of tilt to preview images. So for images that extend beyond the space allocated to them, a simple tilt of the device will let you preview the rest of the sections of the image. Special thanks to team lorempixel for their super awesome service of providing great placeholder images.

Animated GIF of Sample Implementation

Usage

Installation

Add this line to your application's Gemfile:

gem 'motion-gyro-image-controller'

And then execute:

bundle

Sample App

A sample app is included for reference. To get it up and running, simply clone the repository and run rake or rake device depending on whether you want to preview it in the simulator or device.

Using in your app

But here is how you can go about using this library:

  1. Initialize the image controller as follows:

image_controller = GyroDrivenImageViewController.new ```

  1. Set up the origin and size of the view using the following method:

image_controller.set_up_view(x_origin, y_origin, width, height) ```

  1. Set the control variables for sensitivity, update frequency and image motion rate:

image_controller.update_interval = update_interval # sample value: 1.0/120.0 image_controller.motion_rate = image_motion_rate # sample value: PI/180.0 image_controller.shake_threshold = shake_sensitivity # sample value: 0.1 ```

  1. In case you intend to use this in an image gallery, you may need to assign each image an index. We have provided an index value for each controller:

image_controller.index = index ```

  1. To set the actual image, there is a method that accepts an instance of UIImage. The sample app provides an example of how to use the setImageWithURL method to pull images from a server and use them. The syntax for the method to set the image is:

image_controller.set_image image ```

Contributing

See the CONTRIBUTING document. Thank you, contributors!

License

iOS (RubyMotion) Image Controller with Tilt Control is Copyright (c) 2016 Multunus Software Pvt. Ltd. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Multunus logo

iOS (RubyMotion) Image Controller with Tilt Control is maintained and funded by Multunus Software Pvt. Ltd. The names and logos for Multunus are trademarks of Multunus Software Pvt. Ltd.

We love open source software! See our other projects or hire us to help build your product.