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 Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer (typeof(ViewCell), typeof(App.iOS.ExtendedViewCellRenderer))] | |
namespace App.iOS | |
{ | |
public class ExtendedViewCellRenderer : ViewCellRenderer | |
{ | |
public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv) |
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
//MIT license | |
//https://gist.github.com/nicwise/890460 | |
public static UIImage ScaleImage(UIImage image, int maxSize) | |
{ | |
UIImage res; | |
using (CGImage imageRef = image.CGImage) | |
{ | |
CGImageAlphaInfo alphaInfo = imageRef.AlphaInfo; | |
CGColorSpace colorSpaceInfo = CGColorSpace.CreateDeviceRGB(); |
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
//https://forums.xamarin.com/discussion/18460/uitextview-and-html | |
//https://gist.github.com/adrianstevens/933d66faaea83e165f5f | |
using System; | |
using MonoTouch.UIKit; | |
using MonoTouch.Foundation; | |
namespace YourNameSpaceGoesHere | |
{ | |
public class AttributedTextToHTML |
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
// | |
//Reference link : https://gist.github.com/jamztang/1578446 | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIView (ViewToImage) | |
// - [UIImage toImage] | |
// | |
// Follow device screen scaling. If your view is sized 320 * 480, |
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 System.Drawing; | |
using MonoTouch.CoreGraphics; | |
/// https://gist.github.com/mayoff/4146780 | |
///https://gist.github.com/pragmatrix/6406094 | |
static class ArrowPath | |
{ | |
public static CGPath pathWithArrowFromPoint( |
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
// leave the width at 300 otherwise the height wont measure correctly | |
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(10.0f, 0.0f, 300.0f, 100.0f)]; | |
// add text to the UITextView first so we know what size to make it | |
textView.text = [_dictSelected objectForKey:@"body"]; | |
// get the size of the UITextView based on what it would be with the text | |
CGFloat fixedWidth = textView.frame.size.width; | |
CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)]; | |
CGRect newFrame = textView.frame; |
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
//A multiplier of 0 or a nil second item together with a location for the first attribute creates | |
//an illegal constraint of a location equal to a constant. Location attributes must be specified in | |
//pairs. | |
// OR | |
//[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: | |
//A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal | |
//constraint of a location equal to a constant. Location attributes must be specified in pairs' | |
//Use | |
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self.view1 |
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
//Original Blog Post : https://gist.github.com/kautaleksei/19afe866371bf3168a3d | |
#import <Foundation/Foundation.h> | |
void method1(NSArray *numbers) | |
{ | |
NSArray *sorted = [numbers sortedArrayUsingSelector:@selector(compare:)]; | |
} | |
void method2(NSArray *numbers) | |
{ |
NewerOlder