Dan Nicholson
https://people.freedesktop.org/~dbn/pkg-config-guide.html
개요
| # Building FAT librares for XCode 10 | |
| set -e | |
| # If we're already inside this script then die | |
| if [ -n "$MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then | |
| exit 0 | |
| fi | |
| export MULTIPLATFORM_BUILD_IN_PROGRESS=1 |
Dan Nicholson
https://people.freedesktop.org/~dbn/pkg-config-guide.html
개요
| extension ViewController: GMSMapViewDelegate{ | |
| /* handles Info Window tap */ | |
| func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) { | |
| print("didTapInfoWindowOf") | |
| } | |
| /* handles Info Window long press */ | |
| func mapView(_ mapView: GMSMapView, didLongPressInfoWindowOf marker: GMSMarker) { | |
| print("didLongPressInfoWindowOf") | |
| } |
| public extension FileManager { | |
| /// This method calculates the accumulated size of a directory on the volume in bytes. | |
| /// | |
| /// As there's no simple way to get this information from the file system it has to crawl the entire hierarchy, | |
| /// accumulating the overall sum on the way. The resulting value is roughly equivalent with the amount of bytes | |
| /// that would become available on the volume if the directory would be deleted. | |
| /// | |
| /// - note: There are a couple of oddities that are not taken into account (like symbolic links, meta data of | |
| /// directories, hard links, ...). |
| func getSystemUUID() -> String? { | |
| let dev = IOServiceMatching("IOPlatformExpertDevice") | |
| let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev) | |
| let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey, kCFAllocatorDefault, 0) | |
| IOObjectRelease(platformExpert) | |
| let ser: CFTypeRef = serialNumberAsCFString.takeUnretainedValue() | |
| if let result = ser as? String { | |
| return result | |
| } | |
| return nil |
| string getIPAddress(){ | |
| string ipAddress="Unable to get IP Address"; | |
| struct ifaddrs *interfaces = NULL; | |
| struct ifaddrs *temp_addr = NULL; | |
| int success = 0; | |
| // retrieve the current interfaces - returns 0 on success | |
| success = getifaddrs(&interfaces); | |
| if (success == 0) { | |
| // Loop through linked list of interfaces | |
| temp_addr = interfaces; |
| #include <stdlib.h> | |
| #include <math.h> | |
| #include <AudioToolbox/AudioQueue.h> | |
| #include <CoreAudio/CoreAudioTypes.h> | |
| #include <CoreFoundation/CFRunLoop.h> | |
| #define NUM_CHANNELS 2 | |
| #define NUM_BUFFERS 3 |