Skip to content

Instantly share code, notes, and snippets.

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 {}
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;
}
void main() {
var myDouble = double.parse('123.45');
assert(myDouble is double);
print(myDouble);
}
@interface ViewController ()
@property (nonatomic,strong) TestController *controller;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
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])
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)'
- (void)drawRect:(CGRect)rect
{
contextRef = UIGraphicsGetCurrentContext();
[self parseFile];
}
-(void)parseFile{
//if certain condition draw e.g. circle at x/y