This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Father { | |
public func doSomething() { | |
print("Did the father thing") | |
} | |
} | |
class Child: Father { | |
@available (*, unavailable) | |
override func doSomething() { | |
print("did the child thing") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
class RegionTest { | |
var region: CGPath! | |
var points = [CGPoint]() | |
init?() { | |
guard let regionCoordinates = self.loadJson(filename:"pointlist"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Revisionable { | |
} | |
class RealType: Revisionable { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
#import <Network/Network.h> | |
@interface ViewController () | |
@property (strong,nonatomic) nw_path_monitor_t pathMonitor; | |
@end | |
@implementation ViewController | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BLEManager.swift | |
// BLEQuestion | |
// | |
// Created by Paul Wilkinson on 30/3/19. | |
// Copyright © 2019 Paul Wilkinson. All rights reserved. | |
// | |
import Foundation | |
import CoreBluetooth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mageView.leadingAnchor.constraint(equalToSystemSpacingAfter: contentView.leadingAnchor, multiplier: 1.0).isActive = true | |
imageView.widthAnchor.constraint(equalToConstant: 35.0).isActive = true | |
imageView.heightAnchor.constraint(equalToConstant: 35.0).isActive = true | |
textLabel.leadingAnchor.constraint(equalToSystemSpacingAfter: imageView.trailingAnchor, multiplier: 1.0).isActive = true | |
likeButton.leadingAnchor.constraint(equalToSystemSpacingAfter: textLabel.trailingAnchor, multiplier: 1.0).isActive = true | |
likeButton.widthAnchor.constraint(equalToConstant: 50.0).isActive = true | |
contentView.trailingAnchor.constraint(equalTo: likeButton.trailingAnchor, constant: -2.0).isActive = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func startUpdatingLocation() { | |
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest | |
self.locationManager.activityType = .fitness | |
self.locationManager.startUpdatingLocation() | |
} | |
extension ViewController: CLLocationManagerDelegate { | |
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { | |
if status == .authorizedWhenInUse { | |
self.startUpdatingLocation() |