Post

Replies

Boosts

Views

Activity

Reply to OSLogStore can't access an app's extensions?
Please clarify "extensions" do you mean the extending of an already defined type or do you mean widgets, watch kit or some other Xcode app extension? If you're logging into a datastore on the disk you should not have a problem fetching from the entries but if you're using a logging level that just writes to memory then there is nothing to fetch. If the same data you're looking for is not visible in the mac console app when the phone is connected to the mac then that will also explain why the above code is not fetachable.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’22
Reply to swift instead javascript
You cannot replace Javascript in the browser with swift Take a look at the JavaScriptCore framework JSContext & JSVirtualMachine API that will allow you to run Javascript natively in a JSVirtualMachine bridging to Swift or Objective-C API calls. https://developer.apple.com/documentation/javascriptcore/jscontext For Webviews using WKWebit take a look at https://developer.apple.com/documentation/webkit/wkuserscript, https://developer.apple.com/documentation/webkit/wkusercontentcontroller
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to Does Swift 5.x offer any callback functions in AVAudioRecorder or must I use a callback timer?
it is nothing to do with the version of swift but the AVKit framework. Look into the AVAudioRecorder type or the documentation and you will find what you're looking for. Use a timer and a combination of the following methods. /* metering */     open var isMeteringEnabled: Bool /* turns level metering on or off. default is off. */     open func updateMeters() /* call to refresh meter values */     open func peakPower(forChannel channelNumber: Int) -> Float /* returns peak power in decibels for a given channel */     open func averagePower(forChannel channelNumber: Int) -> Float /* returns average power in decibels for a given channel */
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to SwiftUI TextView Coordinator bindings retain first object
class Doc: NSObject, ObservableObject, Identifiable {     @State private(set) var id: String     @State var name: String     @State var details: NSAttributedString     // Used to demonstrate correct bindings with TextField     var details2: String     init(name: String, details: NSAttributedString) {         self.id = UUID().uuidString         self.name = name         self.details = details         self.details2 = details.string     } } struct ContentView: View {     @State var selection: Doc?     var body: some View {         HStack {             List(docs) { doc in                 Text(doc.name).onTapGesture {                     selection = nil                     selection = doc                 }.background((selection == doc) ? Color.gray : Color.clear)             }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to How to avoid or stop receiving Push Notifications if the user clear cookies?
Once the user has opted out of Push Notification your sending scripts will get a list of device tokens no longer opted in which you will have to remove from your side as well on receipt of the error report. Cookies are not used. The user has full control of the APNS process. The server is well aware once implemented correctly. https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1
Dec ’21