[swift-users] 回复: How to use non-ASCII identifier string as'swift_name' attribute's parameter?

孙博弘 sunbohong at vip.qq.com
Thu Jul 21 04:54:09 CDT 2016


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
 MAIL:    sunbohong at gmail.com
 ---------------------------------------------


 




------------------ 原始邮件 ------------------
发件人: "Zhao Xin";<owenzx at gmail.com>;
发送时间: 2016年7月21日(星期四) 下午5:29
收件人: "孙博弘"<sunbohong at vip.qq.com>; 
抄送: "swift-users"<swift-users at 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 at 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 at gmail.com
 ---------------------------------------------


 

_______________________________________________
 swift-users mailing list
 swift-users at swift.org
 https://lists.swift.org/mailman/listinfo/swift-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160721/e5da9c71/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9247171B at 593E275C.C19B9057
Type: application/octet-stream
Size: 106282 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160721/e5da9c71/attachment-0001.obj>


More information about the swift-users mailing list