Category "swift"

How to open your app's settings (inside the Settings app) with Swift (iOS 11)?

I would like to open my app's settings page inside the Settings app with Swift 4 in iOS 11. Just like the picture shows: The following codes doesn't work, it

How do I make an entity a physics entity in RealityKit?

I am not able to figure out how to make the "ball" entity a physics entity/body and apply a force to it. // I'm using UIKit for the user interface and RealityK

SwiftUI inputAccesoryView Implementation

I am trying to implement an inputAccessoryView on a TextField in SwiftUI. The goal is to have a "Done" Button appear above the Keyboard which when pressed gets

How to implement a left or right DragGesture() that trigger a switch case in SwiftUI?

I have created a DragGesture in a View that should select a @State(Bool) whether the user swipe left or right. The thing is that only swiping right is detecte

Translating Language programmatically

Just hopped into the world a multiLanguage settings in Xcode/Swift. After a good view on this tutorial I found it very easy to setting up multiple language usin

Swift 4+: Issues copying a String to Clipboard using NSPasteboard

I had this all working in Swift 3 and earlier but with Swift 4 no matter what variation I use this code will instead output text as a URL. If I put in "This is

Deserializing ARWorldMap in Unity that was serialized with NSKeyedArchiver in native iOS

I have developed an iOS/ARKit app that functions as a content editor for my AR game. It has a fair amount of interface that I don't want to port over to Unity,

UICollectionView error: cells must be retrieved by calling -: -dequeueReusableCellWithReuseIdentifier:forIndexPath:

In my project I have multiple types of UITableview cell each containing UICollectionview. Initially I loaded 2 tableViewcell in 2 sections of UITableview. At

Swift protocol properties with delegates

I am trying to setup a success/error view on a controller via protocol and extensions. What I want to achieve is that I want to get into the state where it is e

(SwiftUI) How to search using IGDB api, search in api

I need help I have app I'm using IGDB api and displaying games with no issue. I need ability to make user search and send the user text to api to display the ga

GeometryReader in SwiftUI ScrollView causes weird behaviour and random offset

Im trying to create a ScrollView that in turn contains a GeometryReader (Explicitly not the other way around). The GeometryReader should contain an (image) with

Read Data From Text Field in TableView Dynamic Cell in Swift

I want to read the text in the text fields in my dynamic cells in the table view. Each cell has two text fields and the user can add more cells. My question : H

UNUserNotificationCenter need to willPresent code

I have an app written in Swift that uses UNUserNotificationCenter and I have it presenting notifications when the app is in the foreground. What I want to do is

Multiple sheet(isPresented:) doesn't work in SwiftUI

I have this ContentView with two different modal views, so I'm using sheet(isPresented:) for both, but as it seems only the last one gets presented. How could I

SwiftUI - How to disable sidebar from collapsing?

Gif to understand easier Is there any way to disable collapsibility of SidebarListStyle NavigationViews?

How to disconnect VPN after app is terminated ios swift

Basically i am working on VPN app and i want to put restriction for free user in my app. Free user can connect to VPN with 1GB of limit like TunnelBear app. I h

How set UIButton size by it's title size?

I have UIButton, which title is dynamic changes. Button size should changes with title size and will be equal title size. How to do this programmatically in Sw

SwiftUI List Button with Disclosure Indicator

I have a SwiftUI view that consists of a list with some items. Some of these are links to other screens (so I use NavigationLink to do this) and others are acti

Create a static library with React dependency

I created a library that uses the native navigation controller to navigate through react and native screens. The library is written in Swift and contains some o

How to use "HEVC with Alpha channel" videos in SceneKit?

At WWDC 2019, Apple announced that it was now handling HEVC with Alpha in iOS, and state that it could be used in SceneKit. I've been trying for hours to make