dagostini / bbportal Goto Github PK
View Code? Open in Web Editor NEWA library that will enable you to pass data between your extensions and applications.
License: MIT License
A library that will enable you to pass data between your extensions and applications.
License: MIT License
I am trying to pass some data between my apps. So I added BBPortal as mentioned in the tutorial and this README.md. First it was not working then I added a breakpoint at
public func send(data: Any, onCompleted: ((NSError?) -> ())? = nil) {
It seems like the method inside it
portalQueue!.addOperation {
[weak self] in
var error: NSError?
self?.coordinator?.coordinate(writingItemAt: url, options: .forReplacing, error: &error, byAccessor: { (url) in
let dictToSave: [String: Any?] = [DictKey.sender.rawValue: self?.objectID,
DictKey.payload.rawValue: data]
let dictData = NSKeyedArchiver.archivedData(withRootObject: dictToSave)
try? dictData.write(to: url)
onCompleted?(nil)
})
if let error = error {
onCompleted?(error)
}
}
is never getting executed. What is wrong in this?
When I installed BBPortal from local on macOS, I got these warnings
.../Pods/BBPortal/BBPortal/Classes/BBPortal.swift:68:52: 'archivedData(withRootObject:)' was deprecated in macOS 10.14: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
.../Pods/BBPortal/BBPortal/Classes/BBPortal.swift:90:42: 'unarchiveObject(withFile:)' was deprecated in macOS 10.14: Use +unarchivedObjectOfClass:fromData:error: instead
Is this working with macOS?
Cocoapods tells me that it won't install. I'm not entirely sure how to convince it otherwise (first time I'm actually using cocoapods :D)
Fetch the data on initial load.
"Overlapping accesses to 'error', but modification requires exclusive access; consider copying to a local variable"
Seems related to passing error to onCompleted
when error might not be initialized yet? Seems related to these compiler changes:
var error: NSError?
self?.coordinator?.coordinate(writingItemAt: url, options: .forReplacing, error: &error, byAccessor: { (url) in
let dictToSave: [String: Any?] = [DictKey.sender.rawValue: self?.objectID,
DictKey.payload.rawValue: data]
let dictData = NSKeyedArchiver.archivedData(withRootObject: dictToSave)
try? dictData.write(to: url)
onCompleted?(error)
})
(Super interesting and cool library btw!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.