This code fails to decode when running on iOS 18.0 or 18.1 beta device. But succeeds below iOS 18, such as iOS 17.5.
Xcode Version 16.0 (16A242d)
let base64String = "1ZwoNohdE8Nteis/IXl1rg=="
if let decodedData = Data(base64Encoded: base64String, options: .ignoreUnknownCharacters) {
if let decodedString = String(data: decodedData, encoding: .ascii) {
print("Decoded string: \(decodedString)")
} else {
print("Failed to decode string using ascii encoding")
}
} else {
print("Failed to decode Base64 string")
}
Post
Replies
Boosts
Views
Activity
Why Xcode12.3 takes up more than 18GB of RAM?
I don't want to show navigation stacknot work
if #available(iOS 14.0, *) {
navigationItem.backBarButtonItem?.menu = nil
}
not work either
class CustomBackBarButtonItem: UIBarButtonItem {
@available(iOS 14.0, *)
override var menu: UIMenu? {
get {
return nil
}
set { }
}
}
protocol SetNaviBackBarProtocol {
func setNavBackItem()
}
extension SetNaviBackBarProtocol where Self: UIViewController {
func setNavBackItem() {
self.navigationItem.backBarButtonItem = CustomerBackBarButtonItem(title: "", style: .plain, target: self, action: nil)
}
}
class BaseViewController: UIViewController, SetNaviBackBarProtocol {
.....
}
Our App was created in 2018 mid using Swift 4.2, and other 3rd party depended with cocoapods.
I add one Clip target, the project structure is different from that given by the download link under session. Run this target, here are the errors:
dyld: Library not loaded: @rpath/<3rd party name>.framework/<3rd party name>
Referenced from: /private/var/containers/Bundle/Application/xxxx/xxxx/Clip
Reason: image not found
dyld: launch, loading dependent libraries
DYLDLIBRARYPATH=/usr/lib/system/introspection
DYLDINSERTLIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
In WidgetExtension this @State remote image not refresh after downloaded
struct WebImageView: View {
public var imageUrl: String
private let placeHolderImage = UIImage(named: "almond-milk") ?? UIImage()
@State private var remoteImage: UIImage?
var body: some View {
Image(uiImage: remoteImage ?? placeHolderImage)
.resizable()
}
private func downloadWebImage() {
guard let url = URL(string: imageUrl) else {
return
}
URLSession.shared.dataTask(with: url) {[self] (data, response, error) in
if let data = data,
let image = UIImage(data: data) {
remoteImage = image
} else {
debugPrint("error: \(String(describing: error))")
}
}.resume()
}
}