WWDC 2007 2008 2009 2010 2011 2012 2013 2014 2015
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/Foundation.h> | |
| #import <CoreAudio/CoreAudio.h> | |
| #import "utilities.h" | |
| /* | |
| This example demonstrates how to create an aggregate device using Core Audio in Objective-C. | |
| It creates an aggregate device with two sub-devices, which are the default input and output devices. | |
| */ | |
| int main(int argc, const char * argv[]) { |
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
| // Similar to defer in Swift | |
| #define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix | |
| #define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix) | |
| #define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^ | |
| #pragma clang diagnostic push | |
| #pragma clang diagnostic ignored "-Wunused-function" | |
| static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) { | |
| (*block)(); | |
| } | |
| #pragma clang diagnostic pop |
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
| .onDrop(of: [.fileURL], isTargeted: nil) { providers in | |
| if let loadableProvider = providers.first(where: { $0.canLoadObject(ofClass: URL.self) }) { | |
| _ = loadableProvider.loadObject(ofClass: URL.self) { fileURL, _ in | |
| if let fileURL = fileURL, fileURL.pathExtension.lowercased() == "zip" { | |
| self.logger.info("Dropped \(fileURL.path)") | |
| DispatchQueue.main.async { | |
| importer.open(zipArchiveURL: fileURL) | |
| } | |
| } | |
| } |