Code Monkey home page Code Monkey logo

dynamicimageplacer's Introduction

DynamicImagePlacer

DynamicImagePlacer is a Library for iOS developer and designer for simply replace the image files in resource bundle without rebuild the app.

Supports iOS 5+

Background

After doing serveral application projects in a team, I find that some basic facts of team co-working between application developer and UI/UX designer.

  • They are both busy. Developer are focusing on layout creation, feature implementation, bug fix, etc. While designers focus on the colors, pixels, size, or something else.
  • For certain kinds of image resources of an iOS application (Navigation Item Image, Tabbar Item Image, Toolbar Item Image, View Background Image, etc.), the sizes of these images are fixed or can be fixed at the very early time in the project.
  • Developers always use some "SELF FOUND IMAGES" to fit the icon components first.
  • Designers want to see their parts used in the application as soon as possible after they made a minor change. (May be an color change or 1 pixel change)
  • Developers are working on some tmp branch, even can not get current code base compiled, they are lazy to change to the version that is installed in designer's device. So they think maybe designers can replace the images theirselves.
  • Designers refuse to learn how to use Xcode, they even do not download it.

So here comes the DynamicImagePlacer idea, with which

  1. Developers will not work for designers on only changing the image files.
  2. Designers will be able to use an iOS with developing application installed and replace the images to see the effects.

Fundemental

Slightly use some techniques like Runtime Method Swizzling and setting up an iOS webserver.

  1. Use runtime method swizzling to hook UIImage native implementation.
  2. Set up webserver to interact with developer/designers.
  3. Designer upload the image for replacement and the webserver store images into application's document directory with same name of the original images.
  4. When application get restart, code/Storyboard/Xib usage of the original image in resource bundle will be replaced with the replacement version image in the docuemtn directory.

So you should better disintegrate DynamicImagePlacer in the build in case you will submit it to AppStore, although I have carefully written the macros to make sure the Runtime Method Swizzling code will not be included in release build, which also means you can not use the DynamicImagePlacer feature in Release build.

Installation

  • Add DynamicImagePlacer to your project
  • Add the files in the Source directory
  • Install the libaries in the Support directory

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the "Getting Started" guide for more information.

Podfile

platform :ios, '5.0'
pod "DynamicImagePlacer", "~> 0.0.1"

Usage

You can use DynamicImagePlacer in almost any type of iOS projects. For example, the Sample project is an simple project like below. It has an UIImageView and a UIButton whose image is set by Storyboard, and an UIImageView whose image is set by code.

image

You can just add one line code in your application:didFinishLaunchingWithOptions: delegate.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[DynamicImagePlacer sharedPlacer] startServer];
    return YES;
}
  1. After startServer is called, a webserver on port 8080 will be set up after DynamicImagePlacer start its process. Developer can use a computer in the same local network with target iOS device to access http://[ip]:8080/.
  2. If you do not know the IP address, you can check the unread notification of the iOS device, DynamicImagePlacer should have pushed the message.
    image
  3. On the webpage you can see all the icons (Exception app icon, default image) list and with white placeholders and related links. image
  4. You can drag the icon file in to the right of destination icon that you want to change image
  5. You can repeat 4 to replace the image you dragged in, or press delete link in the right of Replacement section to delete the image to let original image work.
  6. After doing all the changes, you need to kill the app for once.
  7. Restart the application, you will see your uploaded image is used.
    image

dynamicimageplacer's People

Contributors

angelbear avatar

Stargazers

Evgeniy avatar Peter Jenkins avatar Douglas Fischer avatar  avatar Rob Saunders avatar  avatar Tatsuya Izumori avatar

Watchers

James Cloos avatar Evgeniy avatar  avatar

Forkers

rsaunders100

dynamicimageplacer's Issues

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.