This file contains 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
// In your ViewDidLoad setup | |
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
// ... other setup | |
var tapRecognizer = new UITapGestureRecognizer (this, new Selector ("HandleTapFrom")); | |
tapRecognizer.NumberOfTapsRequired = 1; | |
tapRecognizer.Delegate = new GestureDelegate (); |
This file contains 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
SomeView = Backbone.View.extend | |
viewMethod: -> | |
# do something in the view, can be called @viewMethod() or from outside like someView.viewMethod() | |
otherMethod = () -> | |
# whaddya call this? | |
otherOtherMethod = () -> | |
# whaddya call this? |
This file contains 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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
compass: { // Task | |
dist: { // Target | |
options: { // Target options | |
sassDir: 'source/sass', | |
cssDir: 'css', |
This file contains 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
// attempt to recreate the dictionary in Swift | |
var style:[String:NSDictionary] = [ | |
"$default" : [NSFontAttributeName : UIFont(name: "Raleway", size: 12)], | |
"strong" : [NSFontAttributeName : UIFont(name: "Raleway-Bold", size: 12)], | |
"h1" : [NSFontAttributeName : UIFont(name: "Raleway-Bold", size: 14)] | |
] | |
// use as an NSDictionary fails at runtime | |
style._bridgeToObjectiveC() as NSMutableDictionary |
This file contains 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
// Playground - noun: a place where people can play | |
import UIKit | |
var occupations = Dictionary<String, Any?>() | |
occupations["one"] = 1 | |
occupations["two"] = "two" | |
println(countElements(occupations)) |
This file contains 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
UIView.Animate(.2, 0, UIViewAnimationOptions.Autoreverse | UIViewAnimationOptions.CurveEaseInOut, () => | |
{ | |
Center = new CGPoint(Origin.X + 20, Origin.Y); | |
}, () => | |
{ | |
Center = Origin; | |
}); | |
// OR |
This file contains 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
package { | |
import reflex.containers.Application; | |
import reflex.behaviors.TouchScrollBehavior; | |
import reflex.components.Scroller; | |
import flash.display.Bitmap; | |
import flash.display.MovieClip; | |
/** | |
* @author David Ortinau <dave@davidortinau.com> |
This file contains 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
<s:Scroller width="100%" height="100%"> | |
<s:VGroup width="100%" paddingTop="20" paddingLeft="20" paddingRight="20" paddingBottom="20" gap="20"> | |
<s:Group width="100%"> | |
<s:Rect width="100%" height="100%" radiusX="8" radiusY="8"> | |
<s:fill> | |
<s:SolidColor color="#F1F0E6"/> | |
</s:fill> | |
</s:Rect> | |
<s:VGroup width="100%" paddingTop="20" paddingLeft="20" paddingRight="20" paddingBottom="20" gap="20"> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
creationComplete="view1_creationCompleteHandler(event)" | |
title="TextArea Workaround"> | |
<fx:Script> | |
<![CDATA[ | |
import mx.events.FlexEvent; | |
[Bindable] |
OlderNewer