Tag: Swift

Swift is a powerful and intuitive programming language developed by Apple for building applications for iOS, macOS, watchOS, and tvOS.

  • Swift: how to create a Singleton pattern

    Swift: how to create a Singleton pattern

    By

    in

    What is a Singleton? A singleton pattern guarantees that only one instance of a class is initialized and available from different points of an app. Some examples are already available in Apple’s frameworks: How to define a Singleton Often a static constant is used to adopt the Singleton pattern. To do that the reference to…

    Read more

  • Xcode fails to generate source files from intent definition files when using the Legacy Build System

    By

    in

    When running a Xcode build, I got the following error: The workaround for this problem is the following: First, add a Run Script phase before the Compile Sources phase of your target: Then, add all of the generated files from the output path specified in the command above to all required targets in your project.…

    Read more

  • Swift: Audioaufnahmen mit AVAudioRecorder

    Swift: Audioaufnahmen mit AVAudioRecorder

    By

    in

    In Swift lassen sich Audioaufnahmen sehr komfortabel und einfach über die Klasse AVAudioRecorder realisieren. Beim Initialisieren der Klasse lassen sich bereits Codec, Samplerate, Anzahl der Kanäle und einige andere wichtige Einstellungen festlegen. Hier ein einfaches Code-Beispiel:

    Read more