Hi Howard.
Yes, this would make it compile, but it still would not solve the issues that
make it wrong in my mind:
1. I would have to make it a var, but it should not be mutable.
2. It’s not optional. Without it, the PDAudioPlayer class could not function.
Of course, this is just being stubbor
Hi Muthu.
Thanks for the suggestion.
I don’t want to do that because failure to create the AudioQueue should mean
failure to create the AudioPlayer itself.
-Kenny
> On Sep 25, 2017, at 6:33 PM, somu subscribe wrote:
>
> Hi Kenny,
>
> You could use a lazy var and initialise it with a closur
Hi Kenny,
You could use a lazy var and initialise it with a closure.
class PDAudioPlayer {
//Would be created lazily when first invoked
lazy var mQueue : AudioQueueRef = {
//create an audioQueue and return that instance
return audioQueue
}()
}
Thanks and regards,
Mu
Hi All.
I’m trying to implement the AudioQueue example from Apple in Swift, and keep it
as Swifty as I can. I’ve run into a problem where I have a let ivar for the
AudioQueue, but the only way to initialize that let ivar is to pass a block to
the function that creates the AudioQueue. I get the
Ah, seems i’m wrong in my conclusions, methods and properties in those
extensions are marked as public, which makes them accessible from outside of
Foundation module.
Sorry for confusing.
Best regards,
Ludwig
> 26 сент. 2017 г., в 1:36, Людвиг Вальда Васкес via swift-users
> написал(а):
>
>
I’m not sure. As far as i know only extension which declare a protocol
conformance for a type will have same visibility as type they implement it for.
But if you simply extend a type, this extension will be internal by default.
Best regards,
Ludwig
> 26 сент. 2017 г., в 1:28, Jordan Rose напис
That's not how extensions in Swift work. All of those functions are definitely
available.
Barbara, can you post your source somewhere? And can you check that your Docker
image is actually new enough, using `swift --version`? (The Swift project
doesn't publish an official Docker image, so unless
Interesting, those extensions aren't public for some reason which prevents
their usage from outside of Foundation module. I’m curious if that was
intentional due to unfinished work or something or they just forgot to export
them.
Best regards,
Ludwig
> 25 сент. 2017 г., в 16:40, Barbara Reicha
Hello all,
Considering the following code:
var n = 42
let ptr1 = UnsafeMutablePointer(&n)
let ptr2: UnsafeMutablePointer = UnsafeMutablePointer.init(&n)
let ptr3 = UnsafeMutablePointer.init(&n)
I get "Ambiguous use of init" for ptr3. There are no issues with ptr1
and ptr2. Is this a bug or am I
> On Sep 22, 2017, at 2:38 AM, Howard Lovatt via swift-users
> wrote:
>
> Hi,
>
> I was using a weak reference in a concurrent application and and the main
> thread wasn't seeing an update to a class's property made by another thread.
> If I replaced the weak reference with a closure, the p
Hi,
I am using swift in a docker container. Now I wanted to use NSRange, which
according to the page is already fully implemented for linux.
However when I try to use 'lowerBound' or 'upperBound' it gives me the
following error:
error: value of type 'NSRange' (aka '_NSRange') has no member 'lo
11 matches
Mail list logo