Skip to content

Instantly share code, notes, and snippets.

@paulw11
paulw11 / networkexample
Last active August 29, 2015 14:01
Example CFStream send
-(void) networkExample
{
uint8_t buf[5];
buf[0]=0xe0;
buf[1]=0x4f;
buf[2]=0xd0;
buf[3]=0x20;
buf[4]=0xea;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>size</key>
<string>26</string>
<key>name</key>
<string>5</string>
<key>ph</key>
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, DeliDay) {
DeliDaySunday=0,
DeliDayMonday=1,
DeliDayTuesday=2,
DeliDayWednesday=3,
DeliDayThursday=4,
import UIKit
import CoreBluetooth
class ViewController: UIViewController,CBPeripheralManagerDelegate {
var bluetoothManager : CBPeripheralManager?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.keyboardHeight.constant = height;
[self.view setNeedsUpdateConstraints];
[UIView animateWithDuration:animationDuration animations:^{
[self.view layoutIfNeeded];
}];
#import "QuoteTableViewCell.h"
@implementation QuoteTableViewCell
- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
self.contentView.frame = self.bounds;
func typeAsString() -> String {
var retVal:String
println("Checking")
switch self.brickType {
case .None:
retVal="None"
case .Green:
retVal="Green"
case .Yellow:
retVal="Yellow"
//
// FadingLabel.h
// TextCrossFade
//
// Created by Paul Wilkinson on 30/09/2015.
// Copyright © 2015 Paul Wilkinson. All rights reserved.
//
#import <UIKit/UIKit.h>
class myClass {
func somethingElse(sender:AnyObject) {
print(sender)
}
func something() {
let myBlock = {
self.somethingElse(self)
import Foundation
var dateComponents = NSDateComponents()
dateComponents.day = 19
dateComponents.month = 12
dateComponents.year = 2015
let birthDate = NSCalendar(identifier: NSCalendarIdentifierGregorian)!.dateFromComponents(dateComponents)!