Skip to content

Instantly share code, notes, and snippets.

View gist:5862063
- (void)drawRect:(CGRect)rect
{
contextRef = UIGraphicsGetCurrentContext();
[self parseFile];
}
-(void)parseFile{
//if certain condition draw e.g. circle at x/y
View gist:e3a8240a216985fffa95
let calendar = NSCalendar.currentCalendar()
let components = calendar.components(NSCalendarUnit.CalendarUnitDay , fromDate:NSDate(timeIntervalSince1970: 0) , toDate:timeToShow , options:0 )
Cannot invoke 'components' with an argument list of type '(NSCalendarUnit, fromDate: NSDate, toDate: NSDate, options: Int)'
View gist:f793d19c81756971bae1
override func reverseTransformedValue(value: AnyObject!) -> AnyObject {
let data = value as! NSData
var components:[CGFloat] = [CGFloat](count: 4, repeatedValue:0)
var length=sizeofValue(components)
data.getBytes(&components, length: length)
let color = UIColor(red: components[0],
green: components[1],
blue: components[2],
alpha: components[3])
View gist:754ee005e54464fde665
@interface ViewController ()
@property (nonatomic,strong) TestController *controller;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
View main.dart
void main() {
var myDouble = double.parse('123.45');
assert(myDouble is double);
print(myDouble);
}
View main.dart
import 'package:intl/intl.dart';
class GroupedData<T> {
const GroupedData(
{required this.startDate, this.endDate, required this.data});
final DateTime startDate;
final DateTime? endDate;
final List<T> data;
}
View main.dart
abstract class FooBar {}
// 1. What is this?
// 2. How would you use this abstract class?
// 3. How can you inherit from it?
// 4. How can you get the actual instance, when the app is running?
// 5. Do you know other ways of sharing code?
class STMResult {}