This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyView < UIView | |
attr_accessor :state | |
end | |
class Test | |
def initialize(delegate) | |
delegate.controllerWithValue(1, someStringValue: nil) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
APP_ROOT = "/apps/<%= node['type'] %>/htdocs/current" | |
PID_FILE = "<%= node['unicorn']['pid'] %>" | |
COMMAND = "cd /apps/<%= node['type'] %>/htdocs/current && bundle exec unicorn -E production -D -c /etc/unicorn/<%= node['type'] %>.rb" | |
def pid | |
open(PID_FILE).read.strip.to_i | |
end | |
def running? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2012, HipByte SPRL and contributors | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright notice, | |
# this list of conditions and the following disclaimer in the documentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_init | |
# Fires right after the screen is initialized | |
end | |
def on_load | |
# Fires just before a screen is added to a view for the first time. | |
end | |
def will_appear | |
# Fires every time the screen will appear |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open HomeScreen.new(nav_bar: true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController < UIViewController | |
def viewDidLoad | |
super | |
image = UIImage.imageNamed("photo1.png") | |
@imageView = UIImageView.alloc.initWithImage(image) | |
@scrollView = UIScrollView.alloc.initWithFrame([[0,0],[320,480]]) | |
@scrollView.delegate = self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PickerViewController < UIViewController | |
def viewDidLoad | |
show_picker = UIButton.buttonWithType(UIButtonTypeRoundedRect) | |
show_picker.setTitle("show picker", forState:UIControlStateNormal) | |
show_picker.frame = [[10,10],[100,40]] | |
show_picker.addTarget(self, action: :display_picker, forControlEvents:UIControlEventTouchUpInside) | |
self.view.addSubview(show_picker) | |
end | |
def peoplePickerNavigationController(peoplePicker, shouldContinueAfterSelectingPerson:person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PickerViewController < UIViewController | |
def viewDidLoad | |
show_picker = UIButton.buttonWithType(UIButtonTypeRoundedRect) | |
show_picker.setTitle("show picker", forState:UIControlStateNormal) | |
show_picker.frame = [[10,10],[100,40]] | |
show_picker.addTarget(self, action: :display_picker, forControlEvents:UIControlEventTouchUpInside) | |
self.view.addSubview(show_picker) | |
end | |
def peoplePickerNavigationController(peoplePicker, shouldContinueAfterSelectingPerson:person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PickerViewController < UIViewController | |
def viewDidLoad | |
show_picker = UIButton.buttonWithType(UIButtonTypeRoundedRect) | |
show_picker.setTitle("show picker", forState:UIControlStateNormal) | |
show_picker.frame = [[10,10],[100,40]] | |
show_picker.addTarget(self, action: :display_picker, forControlEvents:UIControlEventTouchUpInside) | |
self.view.addSubview(show_picker) | |
end | |
def peoplePickerNavigationController(peoplePicker, shouldContinueAfterSelectingPerson:person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project/template/ios' | |
Motion::Project::App.setup do |app| | |
# Use `rake config' to see complete project settings. | |
app.name = 'dynamic_calayer' | |
app.frameworks += ['QuartzCore', 'CoreGraphics'] | |
end |