Thanks.
Zhao Xin
On Tue, Jul 11, 2017 at 2:29 AM, Jordan Rose wrote:
>
>
> On Jul 7, 2017, at 22:50, Marco S Hyman via swift-users <
> swift-users@swift.org> wrote:
>
>
> On Jul 7, 2017, at 9:48 PM, Zhao Xin wrote:
>
> Thank you very much Marco. But
on Sun Jul 09 2017, Martin R wrote:
> The Comparable protocol requires that < and == impose a strict total
> order: exactly one of a==b, ab must hold for all values a and b
> of a conforming type.
>
> But it is also noted that a conforming type may contain a subset of
> „exceptional
> On Jul 7, 2017, at 22:50, Marco S Hyman via swift-users
> wrote:
>
>
>> On Jul 7, 2017, at 9:48 PM, Zhao Xin wrote:
>>
>> Thank you very much Marco. But What is “outside of an initializer” really
>> bothers me. **Both** `func
hey all,
just trying to figuring out a few workarounds for a problem I'm having. Im
having 2 errors both because of associatedtype.
*#1 can be found on the "Vertexable" protocol. This is a strange error
which should work but I'm guessing associatedtypes are causing trouble.
*
*//error: Type
Oops sorry, I intended to send that code to myself but autocompletion made
it go to swift-users ...
/Jens
On Mon, Jul 10, 2017 at 7:46 PM, Jens Persson via swift-users <
swift-users@swift.org> wrote:
> protocol VectorStorage {
> associatedtype A
> associatedtype B
> associatedtype C
> On 10 Jul 2017, at 22:35, Geordie J via swift-users
> wrote:
>
> Would “didSet" on a normal variable work for you?
willSet/didSet usually is a good solution (which I had forgotten about).
But in my case it seems not to help - see the corrected code below
> var
It should be willSet because in the example the job is executed before the new
value is set.
class SomeClass {
var status: Int {
willSet {
guard newValue != self.status { return }
// do something here
}
}
}
--
Adrian Zubarev
Sent with Airmail
Would "didSet" on a normal variable work for you?
var status: Int {
didSet { doSomething() }
}
Geordie
> Am 10.07.2017 um 17:34 schrieb Gerriet M. Denkmann via swift-users
> :
>
> This works (Xcode Version 8.3.2 (8E2002)):
>
> class SomeClass
> {
> private var
This works (Xcode Version 8.3.2 (8E2002)):
class SomeClass
{
private var privateStatus: Int
var status: Int
{
get{ return privateStatus }
set(new)
{
if new == privateStatus {return}