Skip to content

Instantly share code, notes, and snippets.

import Foundation
import UIKit
class RegionTest {
var region: CGPath!
var points = [CGPoint]()
init?() {
guard let regionCoordinates = self.loadJson(filename:"pointlist"),
func doSetup(){
service = CBMutableService(type: CBUUID(string: "00001000-0000-1000-8000-00805F9B34FB"), primary: true)
characteristic = CBMutableCharacteristic(type: CBUUID(string: "00001001-0000-1000-8000-00805F9B34FB"), properties: [CBCharacteristicProperties.read, CBCharacteristicProperties.write, CBCharacteristicProperties.notify], value: nil, permissions: [CBAttributePermissions.readable, CBAttributePermissions.writeable])
service?.characteristics = [characteristic!]
peripheralManager?.add(service!)
}
func startAdvertising {
peripheralManager?.startAdvertising([CBAdvertisementDataLocalNameKey: UIDevice.current.name, CBAdvertisementDataServiceUUIDsKey: [CBUUID(string: "00001000-0000-1000-8000-00805F9B34FB")]])
NSLog("Started advertising")
class Father {
public func doSomething() {
print("Did the father thing")
}
}
class Child: Father {
@available (*, unavailable)
override func doSomething() {
print("did the child thing")
if let url = URL(string: "https://www.agoda.com/pages/agoda/default/DestinationSearchResult.aspx?pcs=1&cid=1807795&hl=en&city=16594") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
@paulw11
paulw11 / Info.plist
Last active January 29, 2018 23:50
HKTest
<?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">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
extension Dictionary where Key == String {
func isNullOrEmpty(key: String) -> Bool {
guard let value = self[key] else {
return true
}
if value as? NSNull == NSNull() {
return true
//
// CircularTimerView.swift
// ProgressView
//
// Created by Paul Wilkinson on 26/11/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
import UIKit
@paulw11
paulw11 / GroupClassModel.h
Last active October 12, 2017 22:20
GroupClassModel
//
// GroupClassModel.h
// GCM
//
// Created by Paul Wilkinson on 13/10/17.
#import <Foundation/Foundation.h>
@interface GroupClassModel: NSObject
@property (strong, nonatomic) NSString *id;
//
// PhoneCallObserver.swift
//
// Created by Paul Wilkinson on 27/9/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
import UIKit
import CallKit
//
// main.swift
// SearchTest
//
// Created by Paul Wilkinson on 22/8/17.
// Copyright © 2017 Paul Wilkinson. All rights reserved.
//
import Foundation