Category "swift"

How to access a Swift enum associated value outside of a switch statement

Consider: enum Line { case Horizontal(CGFloat) case Vertical(CGFloat) } let leftEdge = Line.Horizontal(0.0) let leftMaskRightEdge

Getting the result of input from one view to another SwiftUI [closed]

I have this view: struct CreateBoardView: View { @State public var BoardName: String = "" var body: some View { ZStack {

What is the "some" keyword in Swift(UI)?

The new SwiftUI tutorial has the following code: struct ContentView: View { var body: some View { Text("Hello World") } } The second line the

Could not find a valid GoogleService-Info.plist in your project

When I run my swift 3.2 code with Xcode 9 beta 4 this is the error I get: *** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp c

TextField in Table behavior

I'm trying to use the new SwiftUI Table with TextField's in each row. However, the behavior of the text field's is weird, for 3 reasons: Clicking on a text fiel

UNNotificationAttachment failing to attach image

So the following code is being used to attach an image from local storage url of an image. I check in Terminal to see if the image is stored and it does store t

Display window on OSX using Swift without XCode or NIB

Disclaimer: I'm attempting the following exercise because I think it will be instructive. I'm interested in how it might be done. So please don't be too hasty t

Display window on OSX using Swift without XCode or NIB

Disclaimer: I'm attempting the following exercise because I think it will be instructive. I'm interested in how it might be done. So please don't be too hasty t

SWIFT TASK CONTINUATION MISUSE: leaked its continuation - for delegate?

I'm trying to extend my class with async/await capabilities, but at run-time there is an error in the console: SWIFT TASK CONTINUATION MISUSE: query(_:) leaked

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