nishal.thomas.g

Member

Last active 6 weeks ago

  1. 6 weeks ago
    Tue Jan 17 01:12:59 2017

    Please help translate following Java code into Swift 3:

    interface A {
    }
    
    class BiA implements A {
    }
    
    interface C {
        List<? extends A> getAs();
    }
    
    class D implements C {
        List<BiA> getAs();
    }

    The problem I'm facing is with protocol C. I don't know how to declare the protocol, I don't know how to represent "? extends A" in Swift. I'm happy to use built-in Swift arrays. All I want is to be able to use class BiA in D where the getAs() implements the protocol method from C. It's odd that such a simple construct is so hard to get an answer for, not in any Apple guides nor in any forums.

  2. Tue Jan 17 01:09:52 2017
    nishal.thomas.g joined the forum.