Post

Replies

Boosts

Views

Activity

Has iOS 18 changed the threshold for decoding base64 into ASCII code?
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") }
7
0
641
Sep ’24
How to disable navigation stack menu when long press backBarItem?
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 { ..... }
1
0
1.1k
Nov ’20
What's the correct way to add Clip target in an existing old cocoapods project?
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
9
0
4.0k
Jul ’20
Widgetkit remote image?
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()     } }
1
0
1.8k
Jul ’20