Query on bridgeable classes


(Nethra Ravindran) #1

Hi,

I see that some classes are bridgeable and some are not. It would be great
if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran


(Nethra Ravindran) #2

Hi everyone,

To be more precise, I would like to know why few classes are not
CFBridgeable.

Thank you.

- Nethra Ravindran

···

On Tue, Feb 21, 2017 at 2:20 PM, Nethra Ravindran < nethraravindran94@gmail.com> wrote:

Hi,

I see that some classes are bridgeable and some are not. It would be great
if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran


(Alex Blewitt) #3

Do you have a couple of examples that you're referring to?

Alex

···

On 21 Feb 2017, at 09:25, Nethra Ravindran via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hi everyone,

To be more precise, I would like to know why few classes are not CFBridgeable.

Thank you.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 2:20 PM, Nethra Ravindran <nethraravindran94@gmail.com <mailto:nethraravindran94@gmail.com>> wrote:
Hi,

I see that some classes are bridgeable and some are not. It would be great if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


(Nethra Ravindran) #4

For example NSURLComponents is not CFBridgeable.

- Nethra Ravindran

···

On Tue, Feb 21, 2017 at 3:01 PM, Alex Blewitt <alblue@apple.com> wrote:

Do you have a couple of examples that you're referring to?

Alex

On 21 Feb 2017, at 09:25, Nethra Ravindran via swift-corelibs-dev < > swift-corelibs-dev@swift.org> wrote:

Hi everyone,

To be more precise, I would like to know why few classes are not
CFBridgeable.

Thank you.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 2:20 PM, Nethra Ravindran < > nethraravindran94@gmail.com> wrote:

Hi,

I see that some classes are bridgeable and some are not. It would be
great if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


(Philippe Hausler) #5

The reasoning why is that some classes are designed as a has-a relationship instead of an is-a relationship. For example a NSRunLoop has a CFRunLoopRef but a NSString is a CFStringRef. This means that you cannot pass a NSRunLoop to a function that takes a CFRunLoopRef by design. Where-as any method that takes a CFStringRef can take a NSString.

The reasoning for this behavior is to match the behavior of the objective-c version of Foundation.

···

On Feb 21, 2017, at 10:20 AM, Nethra Ravindran via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

For example NSURLComponents is not CFBridgeable.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 3:01 PM, Alex Blewitt <alblue@apple.com <mailto:alblue@apple.com>> wrote:
Do you have a couple of examples that you're referring to?

Alex

On 21 Feb 2017, at 09:25, Nethra Ravindran via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

Hi everyone,

To be more precise, I would like to know why few classes are not CFBridgeable.

Thank you.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 2:20 PM, Nethra Ravindran <nethraravindran94@gmail.com <mailto:nethraravindran94@gmail.com>> wrote:
Hi,

I see that some classes are bridgeable and some are not. It would be great if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


(Nethra Ravindran) #6

Thanks Philippe!

- Nethra Ravindran

···

On Tue, Feb 21, 2017 at 10:44 PM, Philippe Hausler <phausler@apple.com> wrote:

The reasoning why is that some classes are designed as a has-a
relationship instead of an is-a relationship. For example a NSRunLoop has a
CFRunLoopRef but a NSString is a CFStringRef. This means that you cannot
pass a NSRunLoop to a function that takes a CFRunLoopRef by design.
Where-as any method that takes a CFStringRef can take a NSString.

The reasoning for this behavior is to match the behavior of the
objective-c version of Foundation.

On Feb 21, 2017, at 10:20 AM, Nethra Ravindran via swift-corelibs-dev < > swift-corelibs-dev@swift.org> wrote:

For example NSURLComponents is not CFBridgeable.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 3:01 PM, Alex Blewitt <alblue@apple.com> wrote:

Do you have a couple of examples that you're referring to?

Alex

On 21 Feb 2017, at 09:25, Nethra Ravindran via swift-corelibs-dev < >> swift-corelibs-dev@swift.org> wrote:

Hi everyone,

To be more precise, I would like to know why few classes are not
CFBridgeable.

Thank you.

- Nethra Ravindran

On Tue, Feb 21, 2017 at 2:20 PM, Nethra Ravindran < >> nethraravindran94@gmail.com> wrote:

Hi,

I see that some classes are bridgeable and some are not. It would be
great if someone can explain why few classes are not bridgeable.

Thank you!

- Nethra Ravindran

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev