Post not yet marked as solved
What is the recommended way to uninstall Xcode server? I've seen people online suggest simply removing /Library/Developer/XcodeServer. Should I do this and/or uninstall the "Xcode Server" user? Or is there a better way?
Post not yet marked as solved
I'm using AVAudioSession to get raw samples from a microphone and trying to display a waveform. Does anyone know what is the range of values to expect? I don't see anything in the documentation. From testing, I can see that it can go up to +/- 4.
The only reliable way I seem to be able to do this is to use AVAudioConverter() to convert the samples to Int16, then to normalized floats. But that seems rather inefficient.
Post not yet marked as solved
Hi all, I have a protocol that declares some required functions. I would like to develop a set of tests so that I can run them against 2 or more classes that conform to the protocol without having to re-write the tests for each implementation.
I attempted to create an XCTestCase base class hoping to inherit from it for each class conforming to the protocol. But it does not seem like it's possible to subclass XCTestCase in Swift?
For a more concrete example. Let's start with a protocol:
protocol Arithmetic {
	 func add(Int, Int) -> Int
	 func multiply(Int, Int) -> Int
	/// a whole lot more
}
class A: Arithmetic {
		// implement add(), multiply(), etc.
}
class B: Arithmetic {
		// implement add(), multiply(), etc.
}
I would like to create an XCTestCase for A and B that can verify the behavior of methods defined.
The same problem holds if Arithmetic was a base class. Perhaps I wish to test and ensure that subclass overrides still behave correctly.
Currently I don't see a way around this other than to:
Copy & Paste the test cases for each conforming class (or subclass)
Have one "master" test that has an array of the protocol (i.e. [Arithematic]) and loop over it for every single test case.
#1 is not ideal for obvious reasons.
#2 is also not ideal as it makes the tests and test results more difficult to understand. In addition, it makes it difficult to re-use the tests... e.g. if the protocol is in a framework and I expect 3rd parties to be able to create conforming classes... Ideally they should also be able to test conformance without having to re-write all the tests.
Any suggestions?