Category "swift"

Importing Project-Swift.h into a Objective-C class...file not found

I have a project that was started in Objective-C, and I am trying to import some Swift code into the same class files that I have previously written Objective-C

UIButton not respect Aspect Fill contentMode after resizing animation

I am use auto layout. Following is the initial state of the view. In the centre is a button contained in a view. The button has contentMode Aspect Fill, and t

CLLocationDegrees to String variable in Swift

Given that the code var latitude = userLocation.coordinate.latitude returns a CLLocationDegrees Object, how can I store the value in to a variable so that I

Change a rotation of AnchorEntity in RealityKit

I placed 3d object to ARViewController after 3 seconds of placing object, then I want to rotate object by 90 degrees: arView.scene.addAnchor(anchorEntity) Disp

SwiftUI dragging ScrollView flickers as the keyboard is dismissing

When I develop the feature that allows users drag ScrollView to dismiss keyboard in SwiftUI, I find that if you drag ScrollView as the keyboard is dismissing, t

How to move a model and generate its collision shape at the same time?

I have ModelEntity in SwiftUI and it moves. But the problem is: when adding generateCollisionShape method, it doesn't move anymore. I want a collision effect as

How to sum the numbers(Int16) of stored core data - Swift 3

I have stored the letters(String), numbers(Int16) and Date(Date) in the core data. And the filter(NSPredicate) succeeded in organizing only the necessary data.

SwiftUI customized text field in OSX

I am creating a edit view in SwiftUI for Mac OSX. A user can change his profile. At the moment I am using default Text() elements to view his current values/set

How to determine if one array contains all elements of another array in Swift?

I have 2 arrays: var list:Array<Int> = [1,2,3,4,5] var findList:Array<Int> = [1,3,5] I want to determine if list Array contains all findList elem

Swift - Remove " character from string

I have a string which is "Optional("5")". I need to remove the "" surrounding the 5. I have removed the 'Optional' by doing: text2 = text2.stringByReplacingO

RealityKit – Get a model entity from USDZ file

I haave a file (exists in main bundle with target membership checked) named matrix.usdz and need to load it with do { let path = Bundle.main.path(forResour

How to make exponents in the SwiftUI

I found the new method in SwiftUI to allow you to create an exponent. Here what I write code is based in SwiftUI on the Swift Playground. import SwiftUI impo

RealityKit app and lower iOS deployment target

I have an iOS app with deployment target iOS 10+, I need to add some features that depend only on RealityKit to appear with users whom their iOS version is 13+,

iOS: How to add Assets folder inside a Framework and how to access them in code?

I create an iOS app and added a framework to it. The generated framework doesn't have an assets folder like the generate Single View App. So I made an Assets fo

SceneKit Cocoa snapshot failed assertion

I am working on a Swift/Cocoa/Xcode application. This application contains a SceneKit View. The rendering API is set to Default (I think this is Metal). If I

Is it possible to create IndoorMaps like airports from Apple with IMDF?

Im quite confused about creating an IndoorMap for our company to display it on iPad's. Regarding to the new IndoorMaps-Program from Apple I thought I found the

In which cases ARSCNView.raycastQuery returns nil?

In my renderer delegate I create a raycast query from the center of the view to track estimated plane and display a 3D pointer that follows the raycast result.

Turn off or bypass SSL Certificate Verification in Swift iOS

I have my server certificates expired. I want to bypass or turn off certs verification from my swift iOS app so i can test app features. I need this just for

SwiftUI on macOS - handle single-click and double-click at the same time

Consider this view in SwiftUI: struct MyView: View { var body: some View { Rectangle() .fill(Color.blue) .frame(width: 200,

PubNubSwift Capture Receive Message

I'm working with PubNub. I have a standard WebRTC string being published with PubNub. self.pubnub.publish(channel: self.channels[0], message: ["type": "offer",