Posts

Post marked as solved
3 Replies
233 Views
We're developing HTTP server which server multiple hostnames, thus we need to presenting certificates according to requested names. It all should be handled on same listening port(443). What are options to analyze client's TLS requested ServerName Identifier(SNI) and present certificate accordingly ? So far we were successful when using single certificate but all this is done when before starting listener. let parameters = NWParameters(tls: tlsOptions, tcp: tcpOptions ) if let secIdentity = getSecIdentity(), let identity = sec_identity_create(secIdentity) { sec_protocol_options_set_min_tls_protocol_version(tlsOptions.securityProtocolOptions, .TLSv13) sec_protocol_options_set_local_identity(tlsOptions.securityProtocolOptions, identity) sec_protocol_options_append_tls_ciphersuite( tlsOptions.securityProtocolOptions, tls_ciphersuite_t(rawValue: UInt16(TLS_AES_128_GCM_SHA256))! ) } } let listener = try NWListener(using: parameters, on: 443)
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
9 Replies
2.2k Views
How do we pass launchd socket to NWListener or there is other ways to integrate ?If CFSocket to be deprecated, what are the alternatives for launchd daemons ?
Posted
by ElenaS.
Last updated
.
Post marked as solved
2 Replies
190 Views
My big project started throwing errors: Type 'ToggleStyle' has no member 'switch' Made new test project: struct ContentView: View { @State var isOn = false     var body: some View {         Text("Hello, world!")             .padding() Toggle(isOn: $isOn) { Text("IPv6") } .toggleStyle(.switch)     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } Throws the same error: Type 'ToggleStyle' has no member 'switch' what's wrong with this code ?
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
16 Replies
4.7k Views
As documentation states"Tokens are physical devices that can be built in to the system, located on attached hardware (like a smart card), or accessible through a network connection"We'd like to make token that would acquire TKTokenKeychainContents(certificates) through network(without smart card reader).What's would be the best approach for this ?What should we set for com.apple.ctk.token-type in Info.plist ?The only possible value i found is "smartcard".I have not found any documentation regarding other options.The only extension target that Xcode gives is "Smart Card Token Extension"
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
5 Replies
1.7k Views
I aim to create custom Encoder based on Codable API and itend to give a lot of funcionalityfor free by relying on default encode(to: ) implementation and not requiring to create custom implementation.It works as expected for structures, but with class instances which use inheritance i stumbledon behaviour which would encode only superclass keys.Here's the test function i'm testing:func testNestedClassWCodingKeys() { class L1: Codable { init() { L1_A_KEY="AAAA" L1_B_KEY=222 L1_D_KEY=4.4 } var L1_A_KEY: String var L1_B_KEY: Int var L1_C_KEY: Int = 2 var L1_D_KEY: Float } class L2:L1 { override init() { L2_A_KEY="L2222" L2_B_KEY=222333 L2_C_KEY=L3(L3_A_KEY: "L3333", L3_B_KEY: 333) super.init() } required init(from decoder: Decoder) throws { fatalError("init(from:) has not been implemented") try super.init(from: decoder) } var L2_A_KEY: String var L2_B_KEY: Int struct L3: Codable { var L3_A_KEY: String var L3_B_KEY: Int } var L2_C_KEY: L3 } let t = L2() debugPrint(t) let encoder = TDGBinaryEncoder() XCTAssertNoThrow( try encoder.encode(t)) }As you see we don't use any custom encode(to:) implementations.The first thing our encoder do when in encode()(line 44) is called is to respect Encodable encode(to: ) implementaion and call it.func encode(_ encodable: Encodable) throws { //respecting default and custom implementations debugPrint("request for encoding",encodable) try encodable.encode(to: self) }then as expected, default encode(to:) implementation tries to encode super keys for L1.here's the debug output:"line 38: creating keyed container" "line 74: encoding L1_A_KEY" "line 74: encoding L1_B_KEY" "line 74: encoding L1_C_KEY" "line 74: encoding L1_D_KEY"And then it stops...But we expected default encoding implementation to call nested keyed container on L2Could You please comment why it's not encoding L2 keys ?P.S. We can send whole project for investigation
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
System preferences -> Keyboard -> Text(tab) -> "Automatic by Language" settings does not work with 3rd party spelling dictionaries.I've put my Lithuanian language spelling dictionary into ~/Library/Spelling (lt_LT.aff, lt_LT.dic)Yes, i've done "Set Up..." which is last option language selection.Yes, i've only check-marked only those(two) languages that i'm interested(English, Lithuanian).Yes, i've dragged them to the top in following order:1) Lithuanian2) English(U.S. English)Please see screenshotYes, i switch keyboard layout in the document to a language layout i indend to use.I've chosen option Spelling and Grammar -> Check spelling -> While typing.And it fails. It underlines words in red.When i ask to present me with correct options, it presents with the list and in this list there are those exact words, presented in the same way 1:1, but somewhy when i type it things it's wrong.Please see screenshotWhy is that and how to correct this ?By the way everything works perfect if i deselect "Automatic by Language" and choose one language, thus everything is ok with spelling dictionaries.
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
14 Replies
3.0k Views
I feel like this part of OS has not received fair amount attention both from Apple and App developers in recent years.I've been into developing actions for Automator for few months and making it work is a pain(sandbox...).I think it's fair to ask Apple about what is the current state of macOS automation ?Signs or Automator going away:Apple eliminated Product Manager of Automation Technologies positionAutomator action template still using Objective C with no Swift option. Swift Automation action template available from ex apple employeePart of fundamentals of developing automator actions are lost and nowhere to be found on apple site(Automator Programming Guide), those include: AMAccepts identifiers, both standard and Apple definedCode samples: AutomatorHandsOn DMG, AutoSample DMG,Duplicate Finder Items DMGDeveloping custom data types(bundle)Stardard Xcode Automator UI elements have no documentation(AMPathPopUpButton, AMTokenField)Some automator classes have no documentation(AMWorkspace)No Automator sessions at WWDC since position was cancelledNot all Automator sandbox cases are documented. Standard AMWorkflowController class cannot run workflows in sandboxes environment.Apps featuring Automator action or scripting friendly are not promoted in AppStore in any way, so there's no easy way to find tools for automation. There are really great apps which have Automator actions bundled and scripting friendly: Panic's Transmit, Pixelmator, OmniOutliner but i believe there's more ?Anyone with me on this ?
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
0 Replies
567 Views
Among Xcode standard components there's AMPathPopUpButton and AMTokenField.We get error when we want to bind reference of them to our view controller. Error saying:Use of undeclared type 'AMPathPopUpButton'Use of undeclared type 'AMTokenField'Automator is importedIn which framework they are defined ?Could anyone provide hints or documentation how to use them ?
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
3 Replies
464 Views
Hi,there's a class AMWorkspace introduced in 10.13Does anyone know what it does ?Documentation on every method is empty./* AMWorkspace.h Copyright (C) 2006 Apple Inc. All rights reserved. Public header file. */ open class AMWorkspace : NSObject { open class var shared: AMWorkspace! { get } open func runWorkflow(atPath path: String!, withInput input: Any!) throws -> Any }
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
7 Replies
1.6k Views
Sandboxed my app containing actions and workflow management using AMWorkflowController.Encountered errorBundle: CFBundle 0x10130f910 </System/Library/Frameworks/Automator.framework> (not loaded), key: Sandboxed applications can not use Automator.framework to run workflows., value: , table: Localizable, localizationName: (null), result: Sandboxed applications can not use Automator.framework to run workflows.Workflow actions are bundled together with app.Does this mean i won't be able to run and submit app which runs workflow ?Any workarounds ?
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
7 Replies
1.9k Views
Currently we're debugging our custom built Automator Actions using os_log, but it's time consuming.Is it possible to debug custom action using Xcode ?As we see workflow is run on behalf of app's processs(not Automator).We tried to debug by attaching app's process, but unsuccessfully.Our mac app has AMWorkflowController bound to AMWorkflowViewand in it we're adding custom Automator actions located in app's Library Automator folder.
Posted
by ElenaS.
Last updated
.
Post marked as solved
16 Replies
2.7k Views
I'd like to observe @IBOutlet NSPopUpButton property using swift 4.But completion is never called.I've tried with other NSPopUpButton keypaths \.indexOfSelectedItem, \.numberOfItems, but result is the same.Local class properties observetion work.Any ideas what i'm missing ?class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet @objc dynamic weak var platformPopUpButton: NSPopUpButton! var observation: NSKeyValueObservation? func applicationDidFinishLaunching(_ aNotification: Notification) { observation = platformPopUpButton.observe(\NSPopUpButton.titleOfSelectedItem, options: [.new,.old]) { (popUpButton, changeType) in print("value changed \(popUpButton.titleOfSelectedItem)") } } } }
Posted
by ElenaS.
Last updated
.
Post not yet marked as solved
5 Replies
2.4k Views
After update from 10.14 beta 1 to beta 2 app started to return errorWe're trying to listen to port 53 using NWListener and according to netstat and lsof$ netstat -aLn Current listen queue sizes (qlen/incqlen/maxqlen) Listen Local Address 0/0/10 *.53 $netstat -p udp -n Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) udp4 0 0 *.53 *.* $lsof -i :53 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Privaguar 4875 administrator 10u IPv4 0xcc9a81e8ff81b149 0t0 UDP *:domain Privaguar 4875 administrator 11u IPv4 0xcc9a81e9060b9eb1 0t0 TCP *:domain (LISTEN) Both TCP and UDP listening on port is suceeding but when new UDP connection arrives"nw_listener_inbox_accept_udp bind failed [13: Permission denied]"error is returned.Strange, but TCP socket on port 53 still works.We believe this could be due to priveleged port being requested, because after changing UDP listening port from 53 to 1053 app worked again.If this is no longer possible what are the options for listening to priveleged ports in macOS sandboxed environment ?Are there any limitations regarding priveleged ports(<1024) for NWListener ?
Posted
by ElenaS.
Last updated
.