• This repository has been archived on 03/Jun/2022
  • Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Objective-C
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Remixer for iOS: Live adjustment of app variables.

Remixer for iOS

Build Status codecov CocoaPods Chat

Remixer is a framework to iterate quickly on UI changes by allowing you to adjust UI variables without needing to rebuild (or even restart) your app. You can adjust Numbers, Colors, Booleans, and Strings. To see it in action check out the example app.

If you are interested in using Remixer in another platform, you may want to check out the Android and Javascript repos. With any of the three platforms you can use the Remote Controller.

Using Remixer in your app

Requirements

  • Xcode 7.0 or higher.
  • iOS 8.0 or higher.

Quickstart

1. Install CocoaPods

CocoaPods is the easiest way to get started. If you're new to CocoaPods, check out their getting started documentation.

To install CocoaPods, run the following command:

sudo gem install cocoapods

2. Create Podfile

Once you've created an iOS application in Xcode you can start using Remixer for iOS.

To initialize CocoaPods in your project, run the following commands:

cd your-project-directory
pod init

3. Edit Podfile

Once you've initialized CocoaPods, add the Remixer iOS Pod to your target in your Podfile:

target "MyApp" do
  ...
  pod 'Remixer'
end

If you want to use the Remote Controller feature of Remixer, you need to use pod 'Remixer/Firebase' instead. For a complete setup guide check out this link.

Once you've added Remixer to your Podfile you need to run the following commands:

pod install
open [your-project-name].xcworkspace

4. Initialize Remixer

Now you’re ready to add Remixer to your app! Begin by importing the Remixer header file and call [RMXRemixer attachToKeyWindow] in your AppDelegate's didFinishLaunchingWithOptions:

#import "Remixer.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  self.window.rootViewController = [[UIViewController alloc] init];
  [self.window makeKeyAndVisible];
  
  // Let Remixer know that it can attach to the window you just created
  [RMXRemixer attachToKeyWindow];

  return YES;
}

// OPTIONAL: Make sure you propagate these two events if you're using Remote Controllers.
- (void)applicationDidBecomeActive:(UIApplication *)application {
  [RMXRemixer applicationDidBecomeActive];
}
- (void)applicationWillResignActive:(UIApplication *)application {
  [RMXRemixer applicationWillResignActive];
}

@end

5. Add variables

To use Remixer variables in your code simply import Remixer.h and create as many as you want. Remember to hold on to the variables you create, otherwise they'll get discarded automatically.

IMPORTANT: Update blocks should always use a weak reference to self.

#import "Remixer.h"

@implementation ExampleViewController {
  UIView *_box;
  RMXColorVariable *_bgColorVariable;
}

- (void)viewWillAppear {
  // IMPORTANT: Create a weak reference to self to be used inside of the update block
  __weak ExampleViewController *weakSelf = self;
  // Add a color variable to control the background color of the box.  
  _bgColorVariable =
      [RMXColorVariable
          colorVariableWithKey:@"boxBgColor"
                  defaultValue:[UIColor redColor]
               limitedToValues:@[[UIColor redColor], [UIColor blueColor], [UIColor yellowColor]]
                   updateBlock:^(RMXColorVariable *variable, UIColor *selectedValue) {
                     weakSelf.box.backgroundColor = selectedValue;
                   }];
}

- (void)viewWillDisappear {
  // This is optional but it will make sure the variable is removed from the overlay when
  // you push view controllers on top of this one.
  _bgColorVariable = nil;
}

5.1 Types of variables

Remixer currently supports 5 types of variables: [RMXColorVariable], [RMXStringVariable], [RMXBooleanVariable], [RMXNumberVariable] and [RMXRangeVariable]. Each one offers an initializer that takes a key, a default value, optional constraints (like limitedToValues or minValue) and an update block. All variables should be instantiated through these designated initializers.

6. Refine their values

To trigger the in-app Remixer panel run the app and swipe up with 3 fingers (or 2 if you're using the simulator). From here you can see the controls for the variables that are currently in use. If you see variables that shouldn't be there, double check you're using weak references in your update blocks.

You can also trigger the overlay from code using [RMXRemixer openPanel].

Remixer remembers the refinaments you make to the variables. It does so by storing the latest selected value in NSUserDefaults. To get rid of these refinaments you can delete and re-install your app.

Contributing

We gladly welcome contributions! If you have found a bug, have questions, or wish to contribute, please follow our Contributing Guidelines.

Is material-foundation affiliated with Google?

Yes, the material-foundation organization is one of Google's new homes for tools and frameworks related to our Material Design system. Please check out our blog post Design is Never Done for more information regarding Material Design and how Remixer integrates with the system.

License

Β© Google, 2017. Licensed under an Apache-2 license.

More Repositories

1

material-color-utilities

Color libraries for Material You
Swift
1,637
star
2

material-remixer

A set of cross-platform libraries and protocols to allow the sharing of design values and live refinement of apps during the development process.
1,249
star
3

flutter-packages

A collection of useful Material Design packages
Dart
827
star
4

material-remixer-android

Remixer for Android. Live adjustment of app variables.
Java
776
star
5

material-theme-builder

Visualize dynamic color and create a custom Material Theme.
409
star
6

material-tokens

Material Design DSP
CSS
234
star
7

material-components-flutter-adaptive

Now lives at https://github.com/material-foundation/flutter-packages/tree/main/packages
Dart
162
star
8

material-remixer-js

Remixer for JavaScript. Live adjustment of app variables.
TypeScript
97
star
9

pesto_flutter

Learn how to build the basil material study in Flutter with advanced theming techniques that support multiple device contexts. This file is a companion to the live workshop at Flutter Forward 2022
Dart
72
star
10

material-dynamic-color-flutter

Now lives at https://github.com/material-foundation/flutter-packages/tree/main/packages/dynamic_color
JavaScript
59
star
11

material-text-accessibility-ios

MDFTextAccessibility assists in selecting text colors that meet the W3C standards for accessibility.
Objective-C
58
star
12

material-internationalization-ios

MDFInternationalization assists in internationalizing your IOS app or components.
Objective-C
41
star
13

material-remixer-remote-web

A hosted remote controller for a Remixer target app.
TypeScript
26
star
14

material-sprited-animation-view-ios

UIView subclass that uses a spritesheet to animate between two image states
Objective-C
25
star
15

material-roboto-font-loader-ios

Objective-C
23
star
16

material-scrollview-delegate-multiplexer-ios

MDFScrollViewDelegateMultiplexer acts as a proxy object for UIScrollViewDelegate events and forwards all received events to an ordered list of registered observers.
Objective-C
21
star
17

material-font-disk-loader-ios

Objective-C
20
star
18

cocoapods-catalog-by-convention

Build a Catalog application using conventions and CocoaPods
Objective-C
19
star
19

material-automation

A Swift backend connected to our Github App for automation
Swift
15
star
20

github-squash-and-merge-pr-descriptions

A Chrome extension that populates GitHub squash-and-merge commit messages with the PR description.
JavaScript
13
star
21

material-symbols-and-variable-fonts

Learning Material Symbols and Variable Fonts
TypeScript
11
star
22

bazel-apple-framework-relative-headers

Bazel support for framework header imports
Python
9
star
23

arc-tslint

tslint linter for phabricator's arc command line tool
PHP
8
star
24

clang-format-ci

Run clang-format from your CI to automatically suggest style changes in PRs as in-line comments.
Shell
8
star
25

github-comment

A command line tool for posting pull request comments to GitHub
Swift
7
star
26

material-arc-tools

arcanist linters, unit tests, and hooks.
6
star
27

arc-hook-github-issues

An arc-hook for updating GitHub issues after running arc diff.
PHP
5
star
28

bazel_ios_warnings

Warnings we use for bazel iOS targets.
Python
5
star
29

SettingsKit

Easily generate a settings screen using a modular MVVM architecture.
Objective-C
5
star
30

clang-format

Pre-build clang-format binaries
Shell
4
star
31

bazel-workspace-apple

The Material Foundation's common Bazel workspaces dependencies for Apple targets
Python
4
star
32

bazel-test-host-apple

A generic Bazel test host for Apple targets.
Python
4
star
33

kokoro-ios-runner

A build and test runner for kokoro iOS.
Shell
4
star
34

arc-hook-conphig

Hookable configuration for phabricator's arc command line tool
PHP
4
star
35

arc-tsclint

PHP
3
star
36

material-testing-ios

This repository extends XCTest framework with testing helper additions.
Python
3
star
37

swatchie

1
star
38

graphite-oss-daemon

node.js graphite daemon for open source analytics.
JavaScript
1
star
39

compute-oss-dashboard

Google Compute Engine cluster configuration scripts for our open source analytics dashboard
Shell
1
star