简体   繁体   中英

swift 3 xcode 8 'MBProgressHUD.h' file not found failed to import bridging header '/myPath/myProj/myProj/myProj-Bridging-Header.h'

I'm using swift 3 xCode 8.My project's name is jzy_weather2.

when I try to import MBProgressHUD.h from the Pods, TWO error appears, one is MBProgressHUD.h file not found , the other is failed to import bridging header /myPath/myProj/myProj/myProj-Bridging-Header.h

This is the code in Podfile,Both Podfile's blocks below are OK when pod install

platform :ios, '10.0'
def myPods
  pod 'MBProgressHUD', '~> 1.0.0'
end

target 'jzy_weather2' do
  use_frameworks!
  myPods

  target 'jzy_weather2Tests' do
    inherit! :search_paths
  end

  target 'jzy_weather2UITests' do
    inherit! :search_paths
  end
end

and also try like this

platform :ios, '10.0'

def myPods
  pod 'MBProgressHUD', '~> 1.0.0'
end

target 'jzy_weather2' do
  use_frameworks!
  myPods
end

target 'jzy_weather2Tests' do
  myPods
end

target 'jzy_weather2UITests' do
  myPods
end

the is the code that written in jzy_weather2-Bridging-Header.h

#import "MBProgressHUD.h"

and I've also tried this syntax

#import <MBProgressHUD.h>

and I've read some solutions like there solutions in StackOverflow , I don't know whether I've MISS some right solutions in this link, because there're too many solutions in it.

This is my Project info , I think this is the right solution for some one, but My two errors still occurs

Is there anything wrong with my configuration or code? Or maybe in the xCode 8, I should write another kind of configuration?

Drag and Drop these file in the project

MBProgressHUD.h

MBProgressHUD.m

You can find this

https://github.com/jdg/MBProgressHUD

It will create bridging header in your app

Ex: jzy_weather -Bridging-Header.h

#import "MBProgressHUD.h"

Swift 3

let loadingMBProgress = MBProgressHUD.showAdded(to: self.view, animated: true)

loadingMBProgress.mode = MBProgressHUDMode.indeterminate

loadingMBProgress.label.text = "Loading"

For hide

MBProgressHUD.hide(for: self.view, animated: true)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM