Skip to content

Instantly share code, notes, and snippets.

View ConstrainToParentCenterExtensionMethod.cs
public static void ConstrainToParentCenter(this UIView view, nfloat height = default(nfloat), nfloat width = default(nfloat))
{
if (view?.Superview == null) throw new InvalidOperationException("Must add view to a superview before calling this method");
view.TranslatesAutoresizingMaskIntoConstraints = false;
var verticalFormat = string.Format("V:[super]-(<=1)-[view{0}]", height == default(nfloat) ? string.Empty : $"({height})");
var horizontalFormat = string.Format("H:[super]-(<=1)-[view{0}]", width == default(nfloat) ? string.Empty : $"({width})");
View subscribe.cs
public class SightCallEventListener : Java.Lang.Object
{
[Export]
[Subscribe]
public void OnEngineStatusEvent(Event evt)
{
Console.WriteLine ("OnEngineStatusEvent: {0}", evt.ToString());
}
}
View TrackLoadTime.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using HockeyApp.iOS;
namespace AppToTrack.iOS
View key_utility.sh
#!/bin/bash
manifestPath=
placeholderKey=
googleMapsKey=
while getopts "m:p:g:" o; do
case "${o}" in
m) manifestPath="${OPTARG}" ;;
p) placeholderKey="${OPTARG}" ;;
@colbylwilliams
colbylwilliams / CustomWebView.cs
Created Jan 13, 2016
UIWebView subclass that only displays Copy & Paste
View CustomWebView.cs
using Foundation;
using UIKit;
using CoreGraphics;
using ObjCRuntime;
using MobileCoreServices;
namespace WebViewExample.iOS
{
public class CustomWebView : UIWebView
{
View AppDelegate.cs
using System;
using UIKit;
using Foundation;
using System.Collections.Generic;
namespace Notifications.iOS
{
#region APN Payload Container
/* *