mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Based on recommendations in SE-0160, there are two migration workflows: - Conservative: Maintain @objc visibility that was inferred in Swift 3 by adding @objc to all declarations that were implicitily visible to the Objective-C runtime. This is invoked in the migrator by adding the -migrate-keep-objc-visibility flag. - Minimal: Only declarations that must be visible to Objective-C based on their uses (or in cases like dynamic vars) are migrated. rdar://problem/31876357
18 lines
282 B
Swift
18 lines
282 B
Swift
import Foundation
|
|
|
|
class MyClass : NSObject {
|
|
var property : NSObject? = nil
|
|
dynamic var dynamicProperty: Int { return 2 }
|
|
func foo() {}
|
|
func baz() {}
|
|
}
|
|
|
|
extension MyClass {
|
|
func bar() {}
|
|
}
|
|
|
|
class MySubClass : MyClass {
|
|
override func foo() {}
|
|
override func bar() {}
|
|
}
|