Skip to content

Instantly share code, notes, and snippets.

@paulw11
paulw11 / bt.swift
Last active December 24, 2018 01:21
//
// BTConnectionHandler.swift
// AdTableTest
//
// Created by Paul Wilkinson on 24/06/2016.
// Copyright © 2016 Paul Wilkinson. All rights reserved.
//
import Foundation
import CoreBluetooth
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
if let url = URL(string: "http://seemeclothing.xyz/service.php") {
@paulw11
paulw11 / getReceipt.swift
Last active June 29, 2022 06:16
iOS Receipt validator
if let receiptURL = NSBundle.mainBundle().appStoreReceiptURL {
print("Fetching local receipt")
if let receipt = NSData(contentsOfURL: receiptURL) {
print("fetched")
let b64 = receipt.base64EncodedStringWithOptions([]).stringByReplacingOccurrencesOfString("+", withString: "%2B")
self.validateReceipt(b64)
} else {
print("Could not retrieve app store receipt")
}
} else {
//
// ViewController.swift
// carouselTest
//
// Created by Paul Wilkinson on 28/09/2016.
// Copyright © 2016 Paul Wilkinson. All rights reserved.
//
import UIKit
import iCarousel
import Foundation
let date = NSDate()
var dateArrayCalendar = [String]()
let components = NSCalendar.currentCalendar().components([.Day , .Month , .Year], fromDate: date)
let year = components.year
let month = components.month
let dateFormatatter = NSDateFormatter()
let day = 1 // Output is [2,3,4]
// let day = 0 than o/p [1,2,3,4,5]
//
// ViewController.swift
// TwoTables
//
// Created by Paul Wilkinson on 6/2/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
import UIKit
//
// ViewController.m
// cvtest
//
// Created by Paul Wilkinson on 10/2/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
#import "ViewController.h"
//
// ViewController.swift
// MapView_GoogleMaps
//
// Created by Timothy Hull on 2/26/17.
// Copyright © 2017 Sponti. All rights reserved.
//
import UIKit
import GooglePlaces
//
// ViewController.swift
// timertestswift
//
// Created by Paul Wilkinson on 2/3/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
import UIKit
enum Sex {
case Male
case Female
case Other
}
enum Size:Int {
case ExtraSmall = 0
case Small = 1
case Medium = 2