Skip to content

Instantly share code, notes, and snippets.

@pcolton
Last active December 10, 2015 08:58
Show Gist options
  • Save pcolton/4410841 to your computer and use it in GitHub Desktop.
Save pcolton/4410841 to your computer and use it in GitHub Desktop.
Sample of monitoring CSS file changes with Pixate and RubyMotion. #pixate #rubymotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
PixateFreestyle.initializePixateFreestyle
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = UIViewController.alloc.init
@window.styleMode = PXStylingNormal
@button = UIButton.buttonWithType UIButtonTypeSystem
@button.setTitle "Pixate", forState: UIControlStateNormal
@button.frame = [[100, 100], [80, 40]]
@window.addSubview(@button)
PixateFreestyle.styleSheetFromFilePath('/Users/pcolton/Desktop/test.css', withOrigin:PXStylesheetOriginApplication)
PixateFreestyle.updateStylesForAllViews
PixateFreestyle.currentApplicationStylesheet.monitorChanges = true
@window.makeKeyAndVisible
true
end
end
@pcolton
Copy link
Author

pcolton commented Mar 21, 2014

Updated to use new PixateFreestyle object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment