Skip to content

Instantly share code, notes, and snippets.

View douglasjunior's full-sized avatar
:atom:
yarn start

Douglas Nassif Roma Junior douglasjunior

:atom:
yarn start
View GitHub Profile
//
// AsyncTask.swift
//
// Created by Douglas Nassif Roma Junior on 08/06/15.
// Copyright (c) 2015 Douglas Nassif Roma Junior. All rights reserved.
//
import Foundation
class AsyncTask<Params, Progress, Result> : NSObject {
@douglasjunior
douglasjunior / BluetoothWriter.swift
Created May 21, 2015 15:02
Exemplo de código Swift
import Foundation
import CoreBluetooth
class BluetoothWriter : NSObject {
private weak var peripheral: CBPeripheral!;
private weak var characteristic: CBCharacteristic!;
init(peripheral : CBPeripheral, characteristic:CBCharacteristic) {
self.peripheral = peripheral;
@douglasjunior
douglasjunior / BluetoothWriter.h
Last active August 29, 2015 14:21
Exemplo de código Objective-C
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
@interface BluetoothWriter : NSObject
-(id) initWithPeripheral:(CBPeripheral *) peripheral characteristic:(CBCharacteristic *)characteristic;
- (void) writeString:(NSString *) value;
- (void) writeData:(NSData *) value;
-(void) writeColorWithRed:(int)red withGreen:(int)green withBlue:(int)blue;