1

As per Apple documentation about internal access modifier:

 For framework targets, only declarations with the public or open 
 modifier appear in the generated header. 

Now I am writing a mixed framework having objective C & Swift. Within that i defined a swift class :

import Foundation

@objc(Utility)

internal class Utility:NSObject{

   internal func getMyName() -> String
   {
      return "Got the name!"
   }

}

But still i am able to see this in the auto-generated header of the framework :

SWIFT_CLASS_NAMED("Utility")
@interface Utility : NSObject
- (NSString * _Nonnull)getMyName;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

This is on Xcode 8.2.1, any idea why its not acting as per documentation statement.

Amit
  • 1,043
  • 1
  • 10
  • 32

1 Answers1

0

I referred to this post https://stackoverflow.com/a/37324966/1242077, and marked the check for "Allow app extension API only" due to which it was listing even the internal class & methods in auto generated header.

I went with this solution to keep the Class private: https://stackoverflow.com/a/33159964/1242077

Community
  • 1
  • 1
Amit
  • 1,043
  • 1
  • 10
  • 32