Posts

Post not yet marked as solved
4 Replies
0 Views
Removal of the conversion code has speed up things a little bit. The type of text is string,the assignation is useless.Will use the global variable.How can i hook to end of textchange?
Post not yet marked as solved
4 Replies
0 Views
Thanks for your response.The user can modify the text and based on that the drawn string should be modified.Can this be called when the editing of NSTextBox if finished? rather than for every character change?I will modify the drawtext based on your comments and get back.
Post not yet marked as solved
6 Replies
0 Views
Thanks for your reply.I have looked at local validation.Seems quite complex to implement as there are not much examples.If there are some SWIFT examples could you please point me in the right direction.Currently i have implemented Server validation.
Post not yet marked as solved
6 Replies
0 Views
Thanks for your response.I added a sandbox user, fetched a new receipt using SKReceiptRequest after signing in as the sandbox user from the App.I added validation code to get the receipt using the sandbox URL and i got the receipt as JSON.I have 2 questionsIf the user Copy the AppBundle along with the receipt to another machine,will the receipt validation work?Should i replace the Sandbox URL with the Production server URL when i submit the app to app store for approval?Please advice
Post not yet marked as solved
4 Replies
0 Views
Im using the following extention to resize an imageextension NSImage { func resizeImage(width: CGFloat, _ height: CGFloat) -> NSImage { let img = NSImage(size: CGSize(width:width, height:height)) img.lockFocus() let ctx = NSGraphicsContext.current ctx?.imageInterpolation = .high self.draw(in: NSMakeRect(0, 0, width, height), from: NSMakeRect(0, 0, size.width, size.height), operation: .copy, fraction: 1) img.unlockFocus() return img }When i resize the image to 500x500 Pixels and save it to disk like thisvar image = NSImage(contentsOf:x)! let imageURL=outdir+"/"+"***" image=image.resizeImage(width: CGFloat(rwidth), CGFloat(rheight)) saveimage(xdata: image, imageURL: imageURL, format: fileformat)The resulting image is around 1000x100 Pixels almost 2X the specified size,it seems to be occuring due to the Retina Screen resolution issue.How can i fix this problem? Please advice.
Post not yet marked as solved
5 Replies
0 Views
No.. i simply call this methodvar tempimage=orgimg tempimage=drawText(image: tempimage)
Post not yet marked as solved
5 Replies
0 Views
But upon checking with some images there is some resizing involved.eg: one with W:1514 and height:2000,The resulting image after drawing the text was much smaller.Around 364X480 .. Where is this resizing happening in the code.Were you able to reproduce it? Please advice.
Post not yet marked as solved
6 Replies
0 Views
Thanks for your reply,Im planning to store licensing data (encrypted) in a subfolder.The software will be licensed per Mac so.. i need to write data to a globally accessible location by all users without root rights.I will be writing this data from the OSX Application.On the other hand i guess it will be fine to ask for root access during activation.. but i dont know how to do and it seems it will be complex.Also I dont want to ask the user for the root password everytime he/she launches the application. Is this folder present in all version of OSX that supports SWIFT?
Post not yet marked as solved
6 Replies
0 Views
Thanks for your reply;What exactly does a sandboxed application mean? I get data from the system and write data to the system ie:make permanent changes to the disk..So i guess mine is not a sandboxed application.
Post not yet marked as solved
8 Replies
0 Views
Thanks for the update.I having problems with finding a common crypto as the decrypted string is nullvar y=responseString! let x:String = (y.aesDecrypt(key:"123456789012asdsadasd", iv: "iv-salt-string--"))!Both PHP and SWIFT produces the same encryption result.Dont know why this is happening.------------------------------------------------------------------------------------------------------------------------------------------------------------I think i will switch to HTTPS only.Please guide me on this oneIf i switch to HTTPS and use the following code.Will the data that is being send from the client- OSX App to the PHP Web Service via POST be Secure(Encrypted)?Is there a better way to do it? Please help!var request = var request = URLRequest(url: URL(string: "https://www.example.com/test.php")!) request.httpMethod = "POST" let akey:String = txt_key.stringValue; let email:String = txt_email.stringValue let VAL:String="test" var data="blah" let postString = data request.httpBody = postString.data(using: .utf8) let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { / print("error=\(error)") return } if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 { / print("statusCode should be 200, but is \(httpStatus.statusCode)") print("response = \(response)") } let responseString = String(data: data, encoding: .utf8) print(responseString) } task.resume()
Post marked as solved
13 Replies
0 Views
The close 'X' icon on top of the window.
Post marked as solved
13 Replies
0 Views
Plus when i add your Code with the Bool Return Type.No alert is shown,the app window just closes.
Post marked as solved
13 Replies
0 Views
Thanks.`activate(self)` calls a segue to show a view controller as a sheet.Once this is shown, the app closes (or goes to the dock);I don't need it to close.
Post marked as solved
13 Replies
0 Views
Your function does not work when i add Bool Return Type .This thing worksclass ViewController: NSViewController, NSWindowDelegate { / override func viewDidAppear() { self.view.window?.delegate = self } func windowShouldClose(_ sender: Any) { let alert = NSAlert() alert.messageText = "Some alert." alert.informativeText = "Do something before closing." alert.addButton(withTitle: "Quit") alert.addButton(withTitle: "Activate License") let modalResponse = alert.runModal() if (modalResponse == NSAlertFirstButtonReturn) { NSApplication.shared().terminate(self) } else if(modalResponse==NSAlertSecondButtonReturn) { activate(self) } } }But after activate(self) is called .. the application quits (the Dock Icon stays there).I want the application window to stay there when the user Chooses Activate option .. How can i achieve this?