1

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?

Community
  • 1
  • 1
Braver Chiang
  • 351
  • 2
  • 13

1 Answers1

0

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)
Lalit kumar
  • 1,797
  • 1
  • 8
  • 14
  • Here is what I've done before I ask the question:1)I new a project named jzy_weather2. 2)I use cocoapods install the – Braver Chiang Oct 24 '16 at 15:44
  • Here is what I've done before I ask the question:**(1)**I new a project named jzy_weather2. **(2)**I use cocoapods add MBProgressHUD to my project with the code in my question, this step is ok, which means I add MBProgressHUD to the project successfully **(3)**I create a bridge header file in my Project, I've write the `#import "MBProgressHUD.h"` to import the MBProgressHUD, **THEN the two errors occurs** – Braver Chiang Oct 24 '16 at 16:02