Category "swift"

SwiftUI's keyboardShortcut is not working if Button has a buttonStyle

My code: Button(action: { AudioServicesPlaySystemSound(1026) isActive.toggle() }){

How would I program the interface from the shortcuts gallery?

I'd really like to program an interface similar to the shortcuts gallery as shown below: (source: i.ibb.co) So I'm thinking this would be a table view with cust

Using Decodable in Swift 4 with Inheritance

Should the use of class inheritance break the Decodability of class. For example, the following code class Server : Codable { var id : Int? } class Deve

Find Duplicate Elements In Array Using Swift

How to find Duplicate Elements in Array? I have array of phone numbers so in the phone numbers i should start searching from the right side to the left side and

How to compress of reduce the size of an image before uploading to Parse as PFFile? (Swift)

I was trying to upload an image file to Parse after taking photo directly on phone. But it throws an exception: Terminating app due to uncaught exception '

How to load animations made in Blender to ARKit?

I made a 3D object in Blender and made some custom animation to it. However, I manage to load the object to the scene, but not the animation. This is what it

Click through custom NSWindow

I have custom NSWindow with custom NSView set as its contentView. The window gets initialized with: [window setOpaque:NO]; [window setBackgroundColor: [NSColo

How can I encode a string to Base64 in Swift?

I want to convert a string to Base64. I found answers in several places, but it does not work anymore in Swift. I am using Xcode 6.2. I believe the answer might

Grouped UITableView with Shadow and Corner Radius?

I was wondering how one might go about creating a grouped UITableView with sections that have a drop shadow and rounded corners. Also, the section header is sel

Why am I getting an expected expression for my else if lines in SWIFT Xcode? (Basic)

I am completely new to coding and have been learning through sources such as skillshare and Udemy. In one of the projects, I was asked to create a simple app wh

Implicitly animating SCNNode's transition from one ARImageAnchor to another

I’m trying to make my AR experience more user friendly. I have this SCNnode (objectNodeToPlace) that I want to place over the node created/update by the r

Downloading and Processing .xls (Excel) files in Swift

I want to build an Iphone app that can download an Excel file and show the content in a table. I think i managed to download the file but the data i get looks

How to make UIImageView animation wait for dynamicAnimator behavior to finish to start animating

I'm working on an animation for an app, where a shoe box falls from the top of the screen and lands on a pedestal, then the box opens. I was wondering if there

Is there any way to swipe to delete/ Add actions into cell in UITableview Diffable datasource?

I am trying to add swipe actions into my tableview. when I used simple tableview datasource method it worked fine (trailingSwipeActionsConfigurationForRowAt). b

How can I set the Dragging Image in SwiftUI on macOS

I am trying to change the preview image for drag and drop from the default for a GridView which seems to include all the visible items in the grid. As I underst

Getting the difference between two Dates (months/days/hours/minutes/seconds) in Swift

I am trying to get the difference between the current date as NSDate() and a date from a PHP time(); call for example: NSDate(timeIntervalSinceReferenceDate: 14

How can I debounce a method call?

I'm trying to use a UISearchView to query google places. In doing so, on text change calls for my UISearchBar, I'm making a request to google places. The proble

Keychain access control from the app with different names

I am using keychain in my macOS app to store jwt tokens (access and refresh)(kSecClassGenericPassword) and I have figure out that I can't manage existed data vi

Keychain access control from the app with different names

I am using keychain in my macOS app to store jwt tokens (access and refresh)(kSecClassGenericPassword) and I have figure out that I can't manage existed data vi

failed: permission_denied when setValue: or removeValue: in Firebase Database | Swift 4

I have seen lots of answers in stackoverflow but none is working for me! This is my code: import UIKit import Firebase class ViewController: UIViewController