class ViewController: UIViewController {
var delegate: SessionHelper?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let request = URLRequest(url: URL(string: "https://www.google.com/")!)
let session = URLSession(configuration: .ephemeral, delegate: delegate, delegateQueue: nil)
session.dataTask(with: request) { data, response, error in
if let error = error {
print(error.localizedDescription)
} else {
// handle success request body
if let _ = data {
print("success data got.")
}
}
}.resume()
}
}
protocol SessionHelper: URLSessionDelegate {}
extension SessionHelper {
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
print("challenge")
}
}
//class SessionHelper: NSObject, URLSessionDelegate {
// func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
//
// print("challenge")
//
// }
//}
Post
Replies
Boosts
Views
Activity
I am alerting this message in appdelegate . But I didn't change any code for Firebase Crashlytics. Will it relate to this?
Because every time when i clicking to cell, i am calling apiCall and getting new information. And Each of cell's has a textfield, when i writing on textfield all cell's some values changing (textfieldValue * apiCall_Value)
All lang files are placed like this: RuntimeLocalizade -> en.lpoj -> languages.strings
and When I setts Bundle Name is RuntimeLocalizable.bundle - weren't created any file only created-RuntimeLocalizable.bundle
but, i changes Bundle Name to RuntimeLocalizable - all of lang files were created like this
in RuntimeLocalizable en.lproj -> languages.strings
tr.lproj -> languages.strings
it returned - nil
Claude31, I'm getting language data from server and writing to lproj directories, all files (en.lproj, tr.lproj...) successfully writing but when i writing this line of code, i can't see any changes, and i getting error message for second line: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
let bundlePath = Bundle.main.path(forResource: "en", ofType: "lproj")
let bundle = Bundle(path: bundlePath!)!
return NSLocalizedString("entertainment_header", tableName: "", bundle: bundle, value: "", comment: "")
When i setting bundle name like this:
static let bundleName = "RuntimeLocalizable"
en.lproj ar.lproj ... is creating
but now static let bundleName = "RuntimeLocalizable.bundle"
lang files aren't created. RuntimeLocalizable.bundle file is creating
i can't see any changes on textlabel's value. error message is en.lproj... path is null (because, files wasn't created)