2016-10-04 54 views
1

我正在嘗試將Linkedin SDK集成到我的Swift項目中。我正在使用this cocoapod,這是我得到的錯誤。嘗試將Linkedin SDK集成到我的Swift項目時出錯

使用未解決的標識符 'LinkedinSwiftHelper'

我podfile的:

use_frameworks!

目標「JobRewards」做 莢「LinkedinSwift」,「〜> 1.6.5」

這是我收到錯誤的行,我聲明後,這一權利我的視圖控制器的類聲明:

我的橋接報:

#ifndef ObjectiveCHeader_h 
#define ObjectiveCHeader_h 

#import <LinkedinSwift/LSHeader.h> // this will use both for POD and import framework. 


#endif /* ObjectiveCHeader_h */ 

我的info.plist源代碼:

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSExceptionDomains</key> 
    <dict> 
     <key>linkedin.com</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> 
      <true/> 
      <key>NSExceptionRequiresForwardSecrecy</key> 
      <false/> 
      <key>NSExceptionAllowsInsecureHTTPLoads</key> 
      <true/> 
     </dict> 
    </dict> 
</dict> 
<key>LIAppId</key> 
<string>4594413</string> 
<key>CFBundleURLTypes</key> 
<array> 
    <dict> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>li4594413</string> 
     </array> 
    </dict> 
</array> 
<key>CFBundleDevelopmentRegion</key> 
<string>en</string> 
<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>linkedin</string> 
    <string>linkedin-sdk2</string> 
    <string>linkedin-sdk</string> 
</array> 

在構建設置/ Objective-C的橋接報這是當前路徑:

/Users/myName/Desktop/PROJECTS/MyProject/MyProject/ObjectiveCHeader.h 

在此先感謝您的幫助,我一直在爲此掙扎2天。

回答

1

使用可可豆莢時,不應該需要橋接標頭。您是否在包含該視圖控制器的Swift文件中導入LinkedInSwift?對我來說,這個編譯沒有問題。

import UIKit 
import LinkedinSwift 

class ViewController: UIViewController { 

    let linkedinHelper = LinkedinSwiftHelper() 

} 
+0

這解決了它對我來說。非常感謝。 –

+0

沒問題。如果它是您使用它的唯一東西,您可能需要刪除該橋接標頭。 –

相關問題