How to use non-ASCII identifier string as 'swift_name' attribute's parameter?


(孙博弘) #1

When i use follow enumeration in a mixed-language app.Xcode will show me there is a error ```Parameter of 'swift_name' attribute must be an ASCII identifier string```.So can we add support for it?

  @objc(Order)

  public enum 顺序: Int {

    @objc(Start)

    case 开头

    @objc(End)

    case 结尾

  }

And the demo which is come from

https://developer.apple.com/library/mac/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html will show the same error.

  @objc(Color)

  enum Цвет: Int {

      @objc(Red)

      case Красный

      @objc(Black)

      case Черный

  }

2E07F900@C679AA5D.52929057 (104 KB)

···

------------------
---------------------------------------------
孙博弘
  
TEL : 15932691211
MAIL: sunbohong@gmail.com
---------------------------------------------


(Zhao Xin) #2

I just created a new Swift 3.0 Cocoa project in Xcode 8 beta3. Put the code
in ViewController.swift, and created a new Objective-C file and let Xcode
create the bridge file. Then I ran the project, everything worked fine.

Can you create a sample project and shared it?

Zhaoxin

2E07F900@C679AA5D.52929057 (104 KB)

···

On Thu, Jul 21, 2016 at 5:13 PM, 孙博弘 via swift-users <swift-users@swift.org> wrote:

When i use follow enumeration in a mixed-language app.Xcode will show me
there is a error ```Parameter of 'swift_name' attribute must be an ASCII
identifier string```.So can we add support for it?

@objc(Order)

public enum 顺序: Int {

@objc(Start)

case 开头

@objc(End)

case 结尾

}

And the demo which is come from

https://developer.apple.com/library/mac/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html
will show the same error.

@objc(Color)

enum Цвет: Int {

   @objc(Red)

   case Красный

   @objc(Black)

   case Черный

}

------------------
---------------------------------------------
*孙博弘 *

*TEL : 15932691211 <15932691211>*
*MAIL: sunbohong@gmail.com <sunbohong@gmail.com>*
---------------------------------------------

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


(孙博弘) #3

I am usingXcode 7.3.1 Swift 2.2.

And the link I provided is 《Using Swift with Cocoa and Objective-C (Swift 2.2)》.

When i add #import "ProductModuleName-Swift.h" to Objective-C file.The error will appear.

2E07F900@C679AA5D.52929057 (104 KB)

···

------------------
---------------------------------------------
孙博弘
  
TEL : 15932691211
MAIL: sunbohong@gmail.com
---------------------------------------------

------------------ 原始邮件 ------------------
发件人: "Zhao Xin";<owenzx@gmail.com>;
发送时间: 2016年7月21日(星期四) 下午5:29
收件人: "孙博弘"<sunbohong@vip.qq.com>;
抄送: "swift-users"<swift-users@swift.org>;
主题: Re: [swift-users] How to use non-ASCII identifier string as'swift_name' attribute's parameter?

I just created a new Swift 3.0 Cocoa project in Xcode 8 beta3. Put the code in ViewController.swift, and created a new Objective-C file and let Xcode create the bridge file. Then I ran the project, everything worked fine.

Can you create a sample project and shared it?

Zhaoxin

On Thu, Jul 21, 2016 at 5:13 PM, 孙博弘 via swift-users <swift-users@swift.org> wrote:

When i use follow enumeration in a mixed-language app.Xcode will show me there is a error ```Parameter of 'swift_name' attribute must be an ASCII identifier string```.So can we add support for it?

  @objc(Order)

  public enum 顺序: Int {

    @objc(Start)

    case 开头

    @objc(End)

    case 结尾

  }

And the demo which is come from

https://developer.apple.com/library/mac/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html will show the same error.

  @objc(Color)

  enum Цвет: Int {

      @objc(Red)

      case Красный

      @objc(Black)

      case Черный

  }

------------------
---------------------------------------------
孙博弘
  
TEL : 15932691211
MAIL: sunbohong@gmail.com
---------------------------------------------

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


(Zhao Xin) #4

I got the same results as yours with Xcode 7.3.1. However, in Xcode 8
beta3, the errors become yellow alerts, which can pass the building. You
should file a bug on this.

Zhaoxin

2E07F900@C679AA5D.52929057 (104 KB)

···

On Thu, Jul 21, 2016 at 5:54 PM, 孙博弘 <sunbohong@vip.qq.com> wrote:

I am usingXcode 7.3.1 Swift 2.2.

And the link I provided is 《Using Swift with Cocoa and Objective-C (Swift
2.2)》.

When i add #import "ProductModuleName-Swift.h" to Objective-C file.The
error will appear.

------------------
---------------------------------------------
*孙博弘 *

*TEL : 15932691211 <15932691211>*
*MAIL: sunbohong@gmail.com <sunbohong@gmail.com>*
---------------------------------------------

------------------ 原始邮件 ------------------
*发件人:* "Zhao Xin";<owenzx@gmail.com>;
*发送时间:* 2016年7月21日(星期四) 下午5:29
*收件人:* "孙博弘"<sunbohong@vip.qq.com>;
*抄送:* "swift-users"<swift-users@swift.org>;
*主题:* Re: [swift-users] How to use non-ASCII identifier string
as'swift_name' attribute's parameter?

I just created a new Swift 3.0 Cocoa project in Xcode 8 beta3. Put the
code in ViewController.swift, and created a new Objective-C file and let
Xcode create the bridge file. Then I ran the project, everything worked
fine.

Can you create a sample project and shared it?

Zhaoxin

On Thu, Jul 21, 2016 at 5:13 PM, 孙博弘 via swift-users < > swift-users@swift.org> wrote:

When i use follow enumeration in a mixed-language app.Xcode will show me
there is a error ```Parameter of 'swift_name' attribute must be an ASCII
identifier string```.So can we add support for it?

@objc(Order)

public enum 顺序: Int {

@objc(Start)

case 开头

@objc(End)

case 结尾

}

And the demo which is come from

https://developer.apple.com/library/mac/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html
will show the same error.

@objc(Color)

enum Цвет: Int {

   @objc(Red)

   case Красный

   @objc(Black)

   case Черный

}

------------------
---------------------------------------------
*孙博弘 *

*TEL : 15932691211*
*MAIL: sunbohong@gmail.com <sunbohong@gmail.com>*
---------------------------------------------

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