SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Xamarin.iOS中引用第三方
Objective-C的Class Library
HappyMan
2015/02/03
目標
• 在Xamarin.iOS中使用第三方套件,透過在
Xcode中建立Objective-C Class Library
• 以AwesomeMenu套件為例
https://github.com/levey/AwesomeMenu
步驟
1. 在Xcode中建立Static Library
2. 匯入第三方套件檔案
3. 編譯此Static Library,使它能同時支援iOS
Device與iOS simulator硬體架構
4. 使用Objective Sharpie Tool產生轉換
Objective-C到C#的程式碼
5. 在Xamarin中建立iOS Binding Project
6. 在Xamarin中建立iOS APP專案,引用iOS
Binding Project
建立Static Library
• 在Xcode創建新專案,選擇iOS ->
Framework & Library -> Cocoa Touch
Static Library。在此命名為AwesomeMenu
專案結構
專案結構
• AwesomeMenu檔案群
專案中的目錄結構
• 在命令提示字元介面中以Xcodebuild編譯這
個專案
產生iOS Simulator用的檔案
• xcodebuild -sdk iphonesimulator -configuration
Debug
– Build settings from command line:
– SDKROOT = iphonesimulator8.1
– === BUILD TARGET AwesomeMenu OF PROJECT
AwesomeMenu WITH CONFIGURATION Debug ===
– Check dependencies
– Write auxiliary files
– …
– ** BUILD SUCCEEDED **
產生iOS Device用的檔案armv7
• xcodebuild -sdk iphoneos -arch armv7 -
configuration Debug
– Build settings from command line:
– ARCHS = armv7
– SDKROOT = iphoneos8.1
– === BUILD TARGET AwesomeMenu OF PROJECT
AwesomeMenu WITH CONFIGURATION Debug ===
– Check dependencies
– Write auxiliary files
– ** BUILD SUCCEEDED **
產生iOS Device用的檔案armv7s
• xcodebuild -sdk iphoneos -arch armv7s -
configuration Debug
– Build settings from command line:
– ARCHS = armv7s
– SDKROOT = iphoneos8.1
– === BUILD TARGET AwesomeMenu OF PROJECT
AwesomeMenu WITH CONFIGURATION Debug ===
– Check dependencies
– Write auxiliary files
– ** BUILD SUCCEEDED **
產生iOS Device用的檔案arm64
• xcodebuild -sdk iphoneos -arch arm64 -
configuration Debug
– Build settings from command line:
– ARCHS = arm64
– SDKROOT = iphoneos8.1
– === BUILD TARGET AwesomeMenu OF PROJECT
AwesomeMenu WITH CONFIGURATION Debug ===
– Check dependencies
– Write auxiliary files
– ** BUILD SUCCEEDED **
專案中的目錄結構
• AwesomeMenu -> build
• 我在名稱後綴加入arm7 arm7s arm64以利
分辨
Static Library
• 檔案來源:build -> Debug-iphoneos_arm*
• 重新命名:libAwesomeMenu.a
– libAwesomeMenu_arm64.a
– libAwesomeMenu_armv7s.a
– libAwesomeMenu_armv7.a
– libAwesomeMenu_simulator.a
• 轉放至專案資料夾:AwesomeMenu
合併為一
• 使用lipo指令將.a檔案包成單一檔案
• lipo -create -output AwesomeMenu.a
libAwesomeMenu-arm64.a
libAwesomeMenu-armv7s.a
libAwesomeMenu-armv7.a
libAwesomeMenu-simulator.a
• 於是產生AwesomeMenu.a
建立Xamarin.iOS Binding Project
• C# -> iOS -> Unified API -> iOS Binding Project
檔案結構(前)
加入Static Library
加入Static Library
加入Static Library
檔案結構(後)
ShareCode.linkwith.cs
• using System;
using ObjCRuntime;
[assembly: LinkWith (“AwesomeMenu.a”, LinkTarget.Arm64 |
LinkTarget.ArmV7s | LinkTarget.ArmV7 | LinkTarget.Simulator, SmartLink =
true, ForceLoad = true)]
使用Objective Sharpie
• Objective Sharpie is a command line tool
(provided by Xamarin) that can assist in
creating the definitions required to bind a
3rd party Objective-C library to C#.
• 下載並安裝
– http://files.xamarin.com/~abock/ObjectiveShar
pie/ObjectiveSharpie-1.1.1.pkg
查看Xcode SDK
• sharpie xcode -sdks
– macosx10.8
– macosx10.9
– iphoneos7.1
– iphonesimulator7.1
– macosx10.10
– iphoneos8.2
– iphonesimulator8.2
– iphoneos8.1
– iphonesimulator8.1
轉換*.h
• sharpie bind -output=AwesomeMenu -
namespace=AwesomeMenu -sdk=iphoneos8.2 *.h –unified
• Compiler configuration:
– -isysroot /Applications/Xcode-
Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/iPhoneOS.sdk -miphoneos-version-min=8.2 -resource-dir
/Library/Frameworks/ObjectiveSharpie.framework/Versions/1.1.1/clang-
resources -arch armv7 -ObjC
– Parsing...
– [ 0%] parsing /Users/jason/Xcode/AwesomeMenu/AwesomeMenu.h
– [ 50%] parsing /Users/jason/Xcode/AwesomeMenu/AwesomeMenuItem.h
– [100%] parsing complete
– Binding...
– [bind] generating AwesomeMenu.cs
– Submitting usage data to Xamarin...
– Submitted - thank you for helping to improve Objective Sharpie!
– Done.
生成AwesomeMenu.cs
• namespace AwesomeMenu {
// @interface AwesomeMenuItem : UIImageView
[BaseType (typeof (UIImageView))]
interface AwesomeMenuItem {
// -(id)initWithImage:(UIImage *)img highlightedImage:(UIImage *)himg
ContentImage:(UIImage *)cimg highlightedContentImage:(UIImage *)hcimg;
[Export
(“initWithImage:highlightedImage:ContentImage:highlightedContentImage:”)]
IntPtr Constructor (UIImage img, UIImage himg, UIImage cimg, UIImage
hcimg);
// @property (readonly, nonatomic, strong) UIImageView *
contentImageView;
[Export (“contentImageView”, ArgumentSemantic.Retain)]
UIImageView ContentImageView { get; }
// @property (nonatomic) CGPoint startPoint;
[Export (“startPoint”)]
CGPoint StartPoint { get; set; }
…後面還有
• 將它複製到ApiDefinition.cs
刪除轉換多餘的程式碼
• // @protocol AwesomeMenuItemDelegate <NSObject>
[Protocol, Model] [BaseType (typeof (NSObject))] interface
AwesomeMenuItemDelegate { }
• // @protocol AwesomeMenuDelegate <NSObject> [Protocol,
Model] [BaseType (typeof (NSObject))] interface
AwesomeMenuDelegate { }
ApiDefinition.cs
• using System;
using System.Drawing;
using ObjCRuntime;
using Foundation;
using UIKit;
using CoreGraphics;
namespace AwesomeMenu {
// @interface AwesomeMenuItem : UIImageView
[BaseType (typeof (UIImageView))]
interface AwesomeMenuItem {
…後面還有
編譯釋出
產生BindingProjectTest2.dll
• BindingAwesomeMenu ▸
BindingAwesomeMenu ▸ bin ▸ Release ▸
AwesomeMenu.dll
建立Xamarin.iOS Project
引用BindingAwesomeMenu產生的檔
• Project -> Edit References
引用BindingAwesomeMenu產生的檔
• Browse -> BindingAwesomeMenu ▸
BindingAwesomeMenu ▸ bin ▸ Release ▸
AwesomeMenu.dll
匯入第三方套件的圖片
AwesomeMenuProjectViewController.cs
• public override void ViewDidLoad ()
{
base.ViewDidLoad ();
UIImage storyMenuItemImage = UIImage.FromFile ("images/bg-menuitem.png");
UIImage storyMenuItemImagePressed = UIImage.FromFile ("images/bg-menuitem-highlighted.png");
UIImage starImage = UIImage.FromFile ("images/icon-star.png");
AwesomeMenu.AwesomeMenuItem starMenuItem1 = new AwesomeMenu.AwesomeMenuItem
(storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
AwesomeMenu.AwesomeMenuItem starMenuItem2 = new AwesomeMenu.AwesomeMenuItem
(storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
AwesomeMenu.AwesomeMenuItem starMenuItem3 = new AwesomeMenu.AwesomeMenuItem
(storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
AwesomeMenu.AwesomeMenuItem starMenuItem4 = new AwesomeMenu.AwesomeMenuItem
(storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
AwesomeMenu.AwesomeMenuItem starMenuItem5 = new AwesomeMenu.AwesomeMenuItem
(storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
AwesomeMenuProjectViewController.cs
• AwesomeMenu.AwesomeMenuItem[] menus = new AwesomeMenu.AwesomeMenuItem[] {
starMenuItem1,
starMenuItem2,
starMenuItem3,
starMenuItem4,
starMenuItem5
} ;
AwesomeMenu.AwesomeMenuItem startItem = new AwesomeMenu.AwesomeMenuItem
(UIImage.FromFile ("images/bg-addbutton.png"), UIImage.FromFile ("images/bg-addbutton-
highlighted.png"), UIImage.FromFile ("images/icon-plus.png"), UIImage.FromFile ("images/icon-plus-
highlighted.png") );
AwesomeMenu.AwesomeMenu menu = new AwesomeMenu.AwesomeMenu (View.Frame, startItem,
menus);
menu.MenuWholeAngle = (float)-Math.PI/2;
menu.FarRadius = 110.0f;
menu.EndRadius = 100.0f;
menu.NearRadius = 90.0f;
menu.AnimationDuration = 0.3f;
menu.StartPoint = new CoreGraphics.CGPoint (250.0f, 410.0f);
View.Add (menu);
}
編譯執行
• iOS Simulator (iPhone 6)
OK
• iOS Device (iPhone 6)
Failed!!
Xamarin bug…
後續
• 實作C#的Strong Delegate或Weak
Delegate
結論
• 使用Objective-C Library轉到C# Library角
色有三個專案,範例:
– ShareCode (Xcode)
– BindingProjectTest (Xamarin)
– BindingSample (Xamarin)
• https://github.com/happymanx/Binding-
Library-from-ObjC-to-CSharp.git
參考
• [Xamarin.iOS] 如何引用Objective-C寫的
Class Library
http://www.dotblogs.com.tw/toysboy21/archive/2013/08/27/115697.aspx
• Xamarin - Walkthrough: Binding an
Objective-C Library
http://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-
c/Walkthrough_Binding_objective-c_library/

Weitere ähnliche Inhalte

Was ist angesagt?

Apache LibCloud - Keeping up with the cloud market in 2016
Apache LibCloud - Keeping up with the cloud market in 2016Apache LibCloud - Keeping up with the cloud market in 2016
Apache LibCloud - Keeping up with the cloud market in 2016Anthony Shaw
 
docker-machine, docker-compose, docker-swarm 覚書
docker-machine, docker-compose, docker-swarm 覚書docker-machine, docker-compose, docker-swarm 覚書
docker-machine, docker-compose, docker-swarm 覚書じゅん なかざ
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerAmazon Web Services
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkAmazon Web Services
 
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기창훈 정
 
Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021TomStraub5
 
Zabbix for Hybrid Cloud Management
Zabbix for Hybrid Cloud ManagementZabbix for Hybrid Cloud Management
Zabbix for Hybrid Cloud ManagementDaisuke Ikeda
 
Introducing container as-a-service support to apache libcloud
Introducing container as-a-service support to apache libcloudIntroducing container as-a-service support to apache libcloud
Introducing container as-a-service support to apache libcloudAnthony Shaw
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWSManish Jain
 
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 AWSKRUG - AWS한국사용자모임
 
Working in the multi-cloud with libcloud
Working in the multi-cloud with libcloudWorking in the multi-cloud with libcloud
Working in the multi-cloud with libcloudGrig Gheorghiu
 
Multi source replication pdf
Multi source replication pdfMulti source replication pdf
Multi source replication pdfMysql User Camp
 
Libcloud and j clouds
Libcloud and j cloudsLibcloud and j clouds
Libcloud and j cloudsDaeMyung Kang
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraFormWesley Charles Blake
 

Was ist angesagt? (19)

Apache LibCloud - Keeping up with the cloud market in 2016
Apache LibCloud - Keeping up with the cloud market in 2016Apache LibCloud - Keeping up with the cloud market in 2016
Apache LibCloud - Keeping up with the cloud market in 2016
 
docker-machine, docker-compose, docker-swarm 覚書
docker-machine, docker-compose, docker-swarm 覚書docker-machine, docker-compose, docker-swarm 覚書
docker-machine, docker-compose, docker-swarm 覚書
 
Apache OpenWhiskで実現するプライベートFaaS環境 #tjdev
Apache OpenWhiskで実現するプライベートFaaS環境 #tjdevApache OpenWhiskで実現するプライベートFaaS環境 #tjdev
Apache OpenWhiskで実現するプライベートFaaS環境 #tjdev
 
Owin and Katana
Owin and KatanaOwin and Katana
Owin and Katana
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
 
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
 
Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021
 
Apache Libcloud
Apache LibcloudApache Libcloud
Apache Libcloud
 
Zabbix for Hybrid Cloud Management
Zabbix for Hybrid Cloud ManagementZabbix for Hybrid Cloud Management
Zabbix for Hybrid Cloud Management
 
Introducing container as-a-service support to apache libcloud
Introducing container as-a-service support to apache libcloudIntroducing container as-a-service support to apache libcloud
Introducing container as-a-service support to apache libcloud
 
Owin & katana
Owin & katanaOwin & katana
Owin & katana
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
 
Working in the multi-cloud with libcloud
Working in the multi-cloud with libcloudWorking in the multi-cloud with libcloud
Working in the multi-cloud with libcloud
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
 
Multi source replication pdf
Multi source replication pdfMulti source replication pdf
Multi source replication pdf
 
Libcloud and j clouds
Libcloud and j cloudsLibcloud and j clouds
Libcloud and j clouds
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 

Ähnlich wie Xamarin.iOS中引用第三方Objective-C的Class Library

(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx NotebookBIOVIA
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appiumAmbreen Khan
 
Developing Web Apps with Symfony2, Doctrine and MongoDB
Developing Web Apps with Symfony2, Doctrine and MongoDBDeveloping Web Apps with Symfony2, Doctrine and MongoDB
Developing Web Apps with Symfony2, Doctrine and MongoDBMongoDB
 
Mongo db bangalore 2012
Mongo db bangalore 2012Mongo db bangalore 2012
Mongo db bangalore 2012MongoDB
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorialRohit Jagtap
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Pei-Hsuan Hsieh
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationAndreas Kurtz
 
Nike pop up habitat
Nike pop up   habitatNike pop up   habitat
Nike pop up habitatChef
 
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...Amazon Web Services
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the BasicsUlrich Krause
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftWan Muzaffar Wan Hashim
 
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...Amazon Web Services
 
Continuous Deployment with Amazon Web Services
Continuous Deployment with Amazon Web ServicesContinuous Deployment with Amazon Web Services
Continuous Deployment with Amazon Web ServicesJulien SIMON
 
A tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSA tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSAmazon Web Services
 

Ähnlich wie Xamarin.iOS中引用第三方Objective-C的Class Library (20)

(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appium
 
Developing Web Apps with Symfony2, Doctrine and MongoDB
Developing Web Apps with Symfony2, Doctrine and MongoDBDeveloping Web Apps with Symfony2, Doctrine and MongoDB
Developing Web Apps with Symfony2, Doctrine and MongoDB
 
Mongo db bangalore 2012
Mongo db bangalore 2012Mongo db bangalore 2012
Mongo db bangalore 2012
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
Django Deployment
Django DeploymentDjango Deployment
Django Deployment
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
 
Nike pop up habitat
Nike pop up   habitatNike pop up   habitat
Nike pop up habitat
 
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in Swift
 
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
 
Continuous Deployment with Amazon Web Services
Continuous Deployment with Amazon Web ServicesContinuous Deployment with Amazon Web Services
Continuous Deployment with Amazon Web Services
 
A tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSA tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWS
 

Mehr von ShengWen Chiou

Mehr von ShengWen Chiou (20)

iOS Extension
iOS ExtensioniOS Extension
iOS Extension
 
FMDB 研究
FMDB 研究FMDB 研究
FMDB 研究
 
Realm 研究
Realm 研究Realm 研究
Realm 研究
 
Crashlytics 使用教學
Crashlytics 使用教學Crashlytics 使用教學
Crashlytics 使用教學
 
DBAccess 研究
DBAccess 研究DBAccess 研究
DBAccess 研究
 
iBeacon 相關應用
iBeacon 相關應用iBeacon 相關應用
iBeacon 相關應用
 
Xamarin 研究
Xamarin 研究Xamarin 研究
Xamarin 研究
 
What’s New In watch OS
What’s New In watch OSWhat’s New In watch OS
What’s New In watch OS
 
Apple Watch Feature
Apple Watch FeatureApple Watch Feature
Apple Watch Feature
 
Symbolicate Crash 使用教學
Symbolicate Crash 使用教學Symbolicate Crash 使用教學
Symbolicate Crash 使用教學
 
Apple Watch Specifications
Apple Watch SpecificationsApple Watch Specifications
Apple Watch Specifications
 
Apple Watch UI Elements
Apple Watch UI ElementsApple Watch UI Elements
Apple Watch UI Elements
 
Apple Watch Human Interface Guidelines
Apple Watch Human Interface GuidelinesApple Watch Human Interface Guidelines
Apple Watch Human Interface Guidelines
 
AppleDoc 使用教學
AppleDoc 使用教學AppleDoc 使用教學
AppleDoc 使用教學
 
Quickblox Study
Quickblox StudyQuickblox Study
Quickblox Study
 
Auto layout 介紹
Auto layout 介紹Auto layout 介紹
Auto layout 介紹
 
iOS Touch ID 介紹
iOS Touch ID 介紹iOS Touch ID 介紹
iOS Touch ID 介紹
 
iOS Keychain 介紹
iOS Keychain 介紹iOS Keychain 介紹
iOS Keychain 介紹
 
CocoaPods 使用教學
CocoaPods 使用教學CocoaPods 使用教學
CocoaPods 使用教學
 
Parental Gate 使用教學
Parental Gate 使用教學Parental Gate 使用教學
Parental Gate 使用教學
 

Kürzlich hochgeladen

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Kürzlich hochgeladen (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Xamarin.iOS中引用第三方Objective-C的Class Library

  • 2. 目標 • 在Xamarin.iOS中使用第三方套件,透過在 Xcode中建立Objective-C Class Library • 以AwesomeMenu套件為例 https://github.com/levey/AwesomeMenu
  • 3. 步驟 1. 在Xcode中建立Static Library 2. 匯入第三方套件檔案 3. 編譯此Static Library,使它能同時支援iOS Device與iOS simulator硬體架構 4. 使用Objective Sharpie Tool產生轉換 Objective-C到C#的程式碼 5. 在Xamarin中建立iOS Binding Project 6. 在Xamarin中建立iOS APP專案,引用iOS Binding Project
  • 4. 建立Static Library • 在Xcode創建新專案,選擇iOS -> Framework & Library -> Cocoa Touch Static Library。在此命名為AwesomeMenu
  • 8. 產生iOS Simulator用的檔案 • xcodebuild -sdk iphonesimulator -configuration Debug – Build settings from command line: – SDKROOT = iphonesimulator8.1 – === BUILD TARGET AwesomeMenu OF PROJECT AwesomeMenu WITH CONFIGURATION Debug === – Check dependencies – Write auxiliary files – … – ** BUILD SUCCEEDED **
  • 9. 產生iOS Device用的檔案armv7 • xcodebuild -sdk iphoneos -arch armv7 - configuration Debug – Build settings from command line: – ARCHS = armv7 – SDKROOT = iphoneos8.1 – === BUILD TARGET AwesomeMenu OF PROJECT AwesomeMenu WITH CONFIGURATION Debug === – Check dependencies – Write auxiliary files – ** BUILD SUCCEEDED **
  • 10. 產生iOS Device用的檔案armv7s • xcodebuild -sdk iphoneos -arch armv7s - configuration Debug – Build settings from command line: – ARCHS = armv7s – SDKROOT = iphoneos8.1 – === BUILD TARGET AwesomeMenu OF PROJECT AwesomeMenu WITH CONFIGURATION Debug === – Check dependencies – Write auxiliary files – ** BUILD SUCCEEDED **
  • 11. 產生iOS Device用的檔案arm64 • xcodebuild -sdk iphoneos -arch arm64 - configuration Debug – Build settings from command line: – ARCHS = arm64 – SDKROOT = iphoneos8.1 – === BUILD TARGET AwesomeMenu OF PROJECT AwesomeMenu WITH CONFIGURATION Debug === – Check dependencies – Write auxiliary files – ** BUILD SUCCEEDED **
  • 12. 專案中的目錄結構 • AwesomeMenu -> build • 我在名稱後綴加入arm7 arm7s arm64以利 分辨
  • 13. Static Library • 檔案來源:build -> Debug-iphoneos_arm* • 重新命名:libAwesomeMenu.a – libAwesomeMenu_arm64.a – libAwesomeMenu_armv7s.a – libAwesomeMenu_armv7.a – libAwesomeMenu_simulator.a • 轉放至專案資料夾:AwesomeMenu
  • 14. 合併為一 • 使用lipo指令將.a檔案包成單一檔案 • lipo -create -output AwesomeMenu.a libAwesomeMenu-arm64.a libAwesomeMenu-armv7s.a libAwesomeMenu-armv7.a libAwesomeMenu-simulator.a • 於是產生AwesomeMenu.a
  • 15. 建立Xamarin.iOS Binding Project • C# -> iOS -> Unified API -> iOS Binding Project
  • 21. ShareCode.linkwith.cs • using System; using ObjCRuntime; [assembly: LinkWith (“AwesomeMenu.a”, LinkTarget.Arm64 | LinkTarget.ArmV7s | LinkTarget.ArmV7 | LinkTarget.Simulator, SmartLink = true, ForceLoad = true)]
  • 22. 使用Objective Sharpie • Objective Sharpie is a command line tool (provided by Xamarin) that can assist in creating the definitions required to bind a 3rd party Objective-C library to C#. • 下載並安裝 – http://files.xamarin.com/~abock/ObjectiveShar pie/ObjectiveSharpie-1.1.1.pkg
  • 23. 查看Xcode SDK • sharpie xcode -sdks – macosx10.8 – macosx10.9 – iphoneos7.1 – iphonesimulator7.1 – macosx10.10 – iphoneos8.2 – iphonesimulator8.2 – iphoneos8.1 – iphonesimulator8.1
  • 24. 轉換*.h • sharpie bind -output=AwesomeMenu - namespace=AwesomeMenu -sdk=iphoneos8.2 *.h –unified • Compiler configuration: – -isysroot /Applications/Xcode- Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs /iPhoneOS.sdk -miphoneos-version-min=8.2 -resource-dir /Library/Frameworks/ObjectiveSharpie.framework/Versions/1.1.1/clang- resources -arch armv7 -ObjC – Parsing... – [ 0%] parsing /Users/jason/Xcode/AwesomeMenu/AwesomeMenu.h – [ 50%] parsing /Users/jason/Xcode/AwesomeMenu/AwesomeMenuItem.h – [100%] parsing complete – Binding... – [bind] generating AwesomeMenu.cs – Submitting usage data to Xamarin... – Submitted - thank you for helping to improve Objective Sharpie! – Done.
  • 25. 生成AwesomeMenu.cs • namespace AwesomeMenu { // @interface AwesomeMenuItem : UIImageView [BaseType (typeof (UIImageView))] interface AwesomeMenuItem { // -(id)initWithImage:(UIImage *)img highlightedImage:(UIImage *)himg ContentImage:(UIImage *)cimg highlightedContentImage:(UIImage *)hcimg; [Export (“initWithImage:highlightedImage:ContentImage:highlightedContentImage:”)] IntPtr Constructor (UIImage img, UIImage himg, UIImage cimg, UIImage hcimg); // @property (readonly, nonatomic, strong) UIImageView * contentImageView; [Export (“contentImageView”, ArgumentSemantic.Retain)] UIImageView ContentImageView { get; } // @property (nonatomic) CGPoint startPoint; [Export (“startPoint”)] CGPoint StartPoint { get; set; } …後面還有 • 將它複製到ApiDefinition.cs
  • 26. 刪除轉換多餘的程式碼 • // @protocol AwesomeMenuItemDelegate <NSObject> [Protocol, Model] [BaseType (typeof (NSObject))] interface AwesomeMenuItemDelegate { } • // @protocol AwesomeMenuDelegate <NSObject> [Protocol, Model] [BaseType (typeof (NSObject))] interface AwesomeMenuDelegate { }
  • 27. ApiDefinition.cs • using System; using System.Drawing; using ObjCRuntime; using Foundation; using UIKit; using CoreGraphics; namespace AwesomeMenu { // @interface AwesomeMenuItem : UIImageView [BaseType (typeof (UIImageView))] interface AwesomeMenuItem { …後面還有
  • 32. 引用BindingAwesomeMenu產生的檔 • Browse -> BindingAwesomeMenu ▸ BindingAwesomeMenu ▸ bin ▸ Release ▸ AwesomeMenu.dll
  • 34. AwesomeMenuProjectViewController.cs • public override void ViewDidLoad () { base.ViewDidLoad (); UIImage storyMenuItemImage = UIImage.FromFile ("images/bg-menuitem.png"); UIImage storyMenuItemImagePressed = UIImage.FromFile ("images/bg-menuitem-highlighted.png"); UIImage starImage = UIImage.FromFile ("images/icon-star.png"); AwesomeMenu.AwesomeMenuItem starMenuItem1 = new AwesomeMenu.AwesomeMenuItem (storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage); AwesomeMenu.AwesomeMenuItem starMenuItem2 = new AwesomeMenu.AwesomeMenuItem (storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage); AwesomeMenu.AwesomeMenuItem starMenuItem3 = new AwesomeMenu.AwesomeMenuItem (storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage); AwesomeMenu.AwesomeMenuItem starMenuItem4 = new AwesomeMenu.AwesomeMenuItem (storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage); AwesomeMenu.AwesomeMenuItem starMenuItem5 = new AwesomeMenu.AwesomeMenuItem (storyMenuItemImage, storyMenuItemImagePressed, starImage, starImage);
  • 35. AwesomeMenuProjectViewController.cs • AwesomeMenu.AwesomeMenuItem[] menus = new AwesomeMenu.AwesomeMenuItem[] { starMenuItem1, starMenuItem2, starMenuItem3, starMenuItem4, starMenuItem5 } ; AwesomeMenu.AwesomeMenuItem startItem = new AwesomeMenu.AwesomeMenuItem (UIImage.FromFile ("images/bg-addbutton.png"), UIImage.FromFile ("images/bg-addbutton- highlighted.png"), UIImage.FromFile ("images/icon-plus.png"), UIImage.FromFile ("images/icon-plus- highlighted.png") ); AwesomeMenu.AwesomeMenu menu = new AwesomeMenu.AwesomeMenu (View.Frame, startItem, menus); menu.MenuWholeAngle = (float)-Math.PI/2; menu.FarRadius = 110.0f; menu.EndRadius = 100.0f; menu.NearRadius = 90.0f; menu.AnimationDuration = 0.3f; menu.StartPoint = new CoreGraphics.CGPoint (250.0f, 410.0f); View.Add (menu); }
  • 36. 編譯執行 • iOS Simulator (iPhone 6) OK • iOS Device (iPhone 6) Failed!! Xamarin bug…
  • 38. 結論 • 使用Objective-C Library轉到C# Library角 色有三個專案,範例: – ShareCode (Xcode) – BindingProjectTest (Xamarin) – BindingSample (Xamarin) • https://github.com/happymanx/Binding- Library-from-ObjC-to-CSharp.git
  • 39. 參考 • [Xamarin.iOS] 如何引用Objective-C寫的 Class Library http://www.dotblogs.com.tw/toysboy21/archive/2013/08/27/115697.aspx • Xamarin - Walkthrough: Binding an Objective-C Library http://developer.xamarin.com/guides/ios/advanced_topics/binding_objective- c/Walkthrough_Binding_objective-c_library/

Hinweis der Redaktion

  1. ApiDefinition.cs - This file will contain the contracts that define how Objective-C API's will be wrapped in C#. StructsAndEnums.cs - This file will hold any structures or enumeration values that are required by the interfaces and delegates.
  2. LinkTarget.Arm64預設沒有產生,必須自己加上去!
  3. http://stackoverflow.com/questions/21002550/native-linking-errors-in-xamarin https://bugzilla.xamarin.com/show_bug.cgi?id=17199