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
using Xamarin.Forms; | |
namespace ${Namespace}.Views | |
{ | |
public partial class MainPage : ContentPage | |
{ | |
public MainPage () | |
{ | |
InitializeComponent (); | |
} |
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
mkdir drawable-xxhdpi; mkdir drawable-xhdpi; mkdir drawable-hdpi; mkdir drawable-mdpi | |
for file in $(find . -type f -iname '*-xxhdpi*'); do | |
mv "$file" "drawable-xxhdpi/${file/-xxhdpi/}" | |
done | |
for file in $(find . -type f -iname '*-xhdpi*'); do | |
mv "$file" "drawable-xhdpi/${file/-xhdpi/}" | |
done | |
for file in $(find . -type f -iname '*-hdpi*'); do | |
mv "$file" "drawable-hdpi/${file/-hdpi/}" | |
done |
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
using System; | |
using UIKit; | |
namespace Utils | |
{ | |
public static class Zeplin | |
{ | |
public static UIColor TopazColor(this UIColor color) | |
{ | |
return UIColor.FromRGBA( |
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
// 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
// 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
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
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
// 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 (); |