Could not load NIB in bundle using storyboard
The problem was caused by a SplitViewController with a TabBarController as a MasterViewController.
This cause a crash in iOs 8.3.
I replaced the TabBarController with buttons and now the app is working.
I hope this informations may help someone.
present() method throws 'Could not load NIB in bundle: 'NSBundle
You gave away the biggest hint for what's wrong when you said you are using a storyboard and not a XIB (previously known as a NIB) file.
Try replacing:
let evc = ExerciseViewController(nibName: "ExerciseViewController", bundle: nil)
with
let evc = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ExerciseViewController") as ExerciseViewController
Here is a tutorial that might help.
iOS - Could not load NIB in bundle
I think the problem may be that you're trying to add the WKWebView
to the view
when it hasn't been loaded yet.
IBInspectable
s are set very early in the process of loading the view. Try adding your WKWebView
in viewDidLoad
or viewWillAppear
.
import UIKit
import WebKit
@IBDesignable
class HTMLViewController: UIViewController {
@IBInspectable
var filePath: String! = ""
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let path = Bundle.main.path(forResource: filePath, ofType: "html", inDirectory: "content") {
do {
let contents = try String(contentsOfFile: path)
let webView = WKWebView(frame: self.view.bounds)
webView.loadHTMLString(contents, baseURL: nil)
self.view.addSubview(webView)
} catch {
print("error loading file")
}
}
}
}
Related Topics
Audiokit iOS Aksamplermetronome
How to Crop a Uiimage in Swift
iOS 7 Uitoolbar Overriding with Status Bar
Generate Rsa Public Key from Modulus and Exponent
Check If Username Already Exist'S:Swift, Firebase
Firebase Queryorderedbychild() Method Not Giving Sorted Data
Firebase API Is Not Sending Push Notifications When Using the API
Keep Bluetooth Sound When Initializing Avaudiosession
Calling a Method at Specific Time Every Day
Delete and Update Data in Core Data in iOS
Native Zlib Inflate/Deflate for Swift3 on iOS
Xcode iOS App Development Code Signing
Swift - the Data Couldn't Be Read Because It Isn't in the Correct Format
Firebase Pod Install - Pod 'Firebase/Database' - Required a Higher Minimum Deployment Target
Error Setting Text in Collection View Cell