Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [swift]

Swift is a general-purpose, open-source programming language developed by Apple Inc. for their platforms and Linux. Use the tag only for questions about language features, or requiring code in Swift. Use the tags [ios], [macos], [watch-os], [tvos], [cocoa-touch], and [cocoa] for (language-agnostic) questions about the platforms or frameworks.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How to get entire snapshot of scrollview/tableview(Autolayout/SnapKit)

When I use Frame to layout subviews, I could get entire snapshot of scrollview. But when I use AutoLayout/SnapKit, the code below will not work. Why? extension UIScrollView { var cc_snapshot: ...
0
votes
0answers
6 views

How do I use the animation correctly in WKWebView?

I'm currently making WKWebView a hybrid app. So I'm working on a sidebar to make it Native. My problem is that I can't see the sidebar screen, and I see blink when the animation is running. ...
-3
votes
0answers
10 views

How can I download an epub from the server to the user's Iphone? [duplicate]

I would like to do the following Download an epub file stored on a server to the user's phone The file opens up automatically and the user chooses to save it in a specific folder. How can I do this ...
-1
votes
1answer
14 views

Table view automatic dimension forcing duplicate constraints

Getting automatic dimension working for UITableView.rowHeight requires a duplicate constraint in my UITableViewCell class. I'm creating a UITableView programmatically (SwiftUI, no storyboard) and ...
0
votes
1answer
10 views

Firebase Crashlytics reporting with custom keys

I wanted to send some custom keys for each crash, say a crash identifier to identify the user reported crash from crashlytics. I see the Crashlytics API provides a method setObjectValue(forkey:) to do ...
0
votes
0answers
10 views

viewWillTransition to size not being called when, in split-screen multitasking mode, the other app closes

I have a view controller that overrides viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) in order to adjust some widget sizes depending on the available ...
0
votes
0answers
10 views

iOS SpringBoard doesn't load Notification Service Extension

I'm sending a regular push notification and expect it to be updated by Notification Service Extension on iOS13. But this doesn't happen and I see the original notification only. Console logs contain: ...
0
votes
1answer
30 views

Swift - Change a UIImageView when an odd or even number is received as an answer to a multiplication product

As a user, I want to change the imageView to a funny photo, when the product results an odd number. When the product is even, change the imageView to an even “funnier” photo.
0
votes
1answer
23 views

Sharing data by memory reference between iOS app and framework

I'm developing an app which uses a singleton pattern to store single-session user state data. It uses a framework which requires access to the same data, but currently the framework only finds nil ...
0
votes
2answers
30 views

How to get dates for every Friday between two dates?

I currently use the following code to return an array of dates for every single day between two dates, including today's date and the last date itself. This works great. However, how would I go ...
0
votes
0answers
10 views

TypeMismatch error when instantiating view controller

When trying to instantiate a view controller from my storyboard with the instatiateViewController withIdentifier function, xcode throws this error: "ERR: typeMismatch(Swift.Array, Swift....
0
votes
0answers
8 views

Adding Task output to TextView as scrolling text

Following this example, I was able to add the console output of a task running FFmpeg from the main resource bundle to a textview. However, instead of adding each line of output after the last to ...
0
votes
0answers
22 views

Is it possible to retrieve an object list (which was created from a JSON file) from another class?

I am new in iOS programming and I have a question about getting a list built from another class. Let me explain : I am trying to build a basic bike app, that allows user to see all bikes location in a ...
0
votes
0answers
17 views

No images despite successful decoding of json data with SwiftUI

I have to pieces of code to decode json data (local and remote). Both work. I am also able to visualize my local data, however not the remote data. They are exactly the same. What is missing? Please ...
0
votes
1answer
23 views

How to access an anonymous parameter within a method?

How can I access the str label inside the function body? If it's impossible then why the compiler doesn't throw an error ? class Test { func methodA(str _: String) { } func methodB() { ...
0
votes
0answers
11 views

How to fix collapsing list when adding navigationBarItems to Picker

I'm trying to include a "+" or "New User" button in a SwiftUI Picker list of current users to allow user to Add a new user to the list. When I add .navigationBarItems, the list of current users ...
0
votes
1answer
14 views

The spec did not pass validation, CocoaPod Generation Lint Error

I am building an CocoaPods with making Touch Framework. The name of it is Elias for just trying and I am starting with a simple tutorial but I've not forwarding my process because of bunch of lint ...
0
votes
1answer
19 views

Moving SKSpriteNode with touch, speeds up at half screen point

I'm working on a 2-d Platformer style game. I'm very new to IOS and Swift development. I'm attempting to use a button (a different node) to move my character across the screen from left to right. It ...
0
votes
0answers
22 views

rootViewController not showing (Xcode 11 and iOS 13)

I am trying to set a rootViewController in iOS 13.0 and Xcode 11.0 but first time root is setting properly from SceneDelegate class but after that I am trying to set a root and nothing is happen. let ...
0
votes
0answers
6 views

Get url for PDF files from NSItemProvider in share extension

I have a share extension that is looking for attachments from NSItemProvider, which I'm using to grab the url (e.g. of any website that a user visits on Safari) once the user taps on my app's share ...
0
votes
0answers
5 views

0__abort_with_payload i transfered my project to another mac and now i'm presented with this error

0__abort_with_payload i copied my project to another mac and now i'm presented with this error i'm also presented with "6_dyld_start", it downloads the app to my Iphone but, launches a white screen my ...
0
votes
0answers
10 views

Understanding the warning: This class 'SwiftUI.AccessibilityNode' is not a known serializable element

I put together a simple project to build upon understand using classes and structs in swift. I recieve the following warning when running this code on the simulator: ContentView.swift import ...
0
votes
0answers
15 views

Unable to simultaneously satisfy constraints when UIToolbarContentView is present

I have a custom button on top of a datepicker view. When the datepicker is active I get the "Unable to simultaneously satisfy constraints." The error has popped up After I updated to Xcode 11, This ...
-1
votes
2answers
39 views

Issue switching app to Dark Mode when device is in dark mode | Swift iOS 13

When dark mode is already enabled on the device and I open my app all of the color sets that specify dark mode are not being applied: But when having the app already open and switching to Dark Mode ...
-1
votes
0answers
11 views

Remove app from options to make a call from contact details [on hold]

Is it possible to programmatically remove the app (like Viber or telegram on pic) that is using CallKit and voip from the options to call in contact details? Or how to prevent the app being added to ...
0
votes
1answer
20 views

How to create Toggle binding from array of objects?

There are several useful questions on this topic, but all I've found either use deprecated syntax from earlier betas (e.g., BindableObject) or do not require a binding be passed (e.g., to a Toggle). ...
0
votes
1answer
38 views

My delegate function is not being called in Swift

I have a main view titled NoteTakerViewController. I have a weatherGetterController class with a protocol that returns 5 days of weather with a protocol function called getMyWeather. However the ...
0
votes
0answers
23 views

How to make a draggable ViewController?

I'm wondering how to implement a draggable viewcontroller where the user can drag it with the finger from the bottom of the screen to the top and the viewcontroller will follow the finger. I have the ...
0
votes
1answer
16 views

Adding Google Maps to a View in Swift

I have the following dilemma. I created a 2 view in my project ( GMContainer and GMHolder). I want GMHolder inside all his view to display the Google Maps map. Unfortunate I am just able to add a ...
0
votes
0answers
9 views

Replacement for the Edit Menu (Cut, Copy, Paste) + UITableView API (iOS 13 deprecations)

iOS 13 deprecated those methods: tableView(_:shouldShowMenuForRowAtIndexPath:) tableView(_:canPerformAction:forRowAtIndexPath:withSender:) tableView(_:performAction:forRowAtIndexPath:withSender:...
1
vote
1answer
16 views

Error with GoogleSignIn with the error code extra argument

I'm a newbie in development and I want to do an app for my classroom, with a Google Drive and Google calendar access, after reading on the Internet what I should do, I debuted to make the GoogleSignIn ...
-1
votes
0answers
20 views

Losing SQLite Data in tables - Swift 5, Xcode 11.1

In AppDelegate I call functions in struct to create SQLite Database and three tables needed for my application. Using functions in structs, I insert, update, delete records in these three tables ...
0
votes
0answers
15 views

Would apple push - push notifications in this kind of situation?

Say we have a cell phone with persistent connection (talking 5G LTEEEE here), but it's also connected to WiFi. Unfortunately, that WiFi either has non-persistent or the firewall has the necessary ...
0
votes
0answers
18 views

Choosing the right sandboxing exception

I bumped up against sandboxing last night for the first time since I started learning Swift/Xcode. I was getting an "Operation not permitted" error when trying to run ffmpeg in a process. (ffmpeg has ...
0
votes
0answers
29 views

What the difference between metal 2 and metal 1? [on hold]

What is the difference between metal 2 and metal 1? Especially about shaders, does the code of shaders the same between metal 2 and metal 1?
0
votes
3answers
20 views

ViewController not performing segue as expected

After installing Xcode 11, I started to face this issue. I am trying to segue from LandingViewController to LoginViewController on button click event. The view controller doesn't load in full screen ...
0
votes
0answers
21 views

Comparing Realm Results and finding the object in a List

I need to loop through the objects in the Realm file and see if it is also listed in the List. When I look at the file with the Realm Browser, it is there, but the following code always renders false....
-1
votes
0answers
7 views

Cannot let my Xcode 11 Audio project simulate the project an Error occurs

Ok I've been using the Code with Chris audio thing pretty well and I finally got the Code to work and run it in the simulator but it keeps giving me this error/Users/Maxwell/Desktop/Screen Shot 2019-...
2
votes
1answer
27 views

Swift, How to call a function that's in an extension in my GameScene?

I'm making a 2D platformer game on Swift, and I want the screen to shake when the player gets hit with a weapon. I've tried a few different solutions, like making just the background sprite shake, but ...
0
votes
0answers
13 views

How to Disable Reload CollectionView's animation When Hiding NavBar

I'm getting a strange reload animation when hiding my navBar when I swipe. I'm recreating Twitter's search screen and that required me to nest a collectionView within another collectionView. Since, ...
0
votes
1answer
26 views

The difference between create Mac OS app project and iOS app project with Xcode in swiftUI?

I want to use swiftUI to develop an application running on both iOS and Mac OS. After MAC 10.15, I can run iPad app directly on Mac. So, what's the difference between creating a Mac OS project and an ...
0
votes
1answer
14 views

UIElements becomes inactive when RootViewController is set from SceneDelegate in iOS 13.1

I am currently experiencing these issues in Xamarin.iOS update to iOS 13.1. When I set the LoginController manually as the initial ViewController from Main.Storyboard everything works fine, but when I ...
0
votes
2answers
25 views

How to select tab bar item without selecting it

I am using swift and I have a problem with the tab bar. I want to select a tab bar item, but without open it, what I mean: I want to change its color like it is selected but without the selection is ...
1
vote
1answer
33 views

Change cornerRadius of the modal view controller

My goal is to increase corner radius of the modally presented controller to 25. As you can see in the picture it has rounded corners by default but I need them to have greater radius. I've tried ...
0
votes
0answers
17 views

How to dismiss a React Native RCTRootView back to a Native ViewController

I'm creating an app to integrate react-native with an existing Swift app. I've looked into similar issues: React-Native: Dismiss/Exit React-Native View back to Native How can I go back to native ...
0
votes
0answers
31 views

Use of undeclared type Xcode 11

Use of undeclared type import UIKit import AudioToolbox // import AVFoundation import GameKit import StoreKit import CoreData import UnityAds import CloudKit var tasks: [MoneyCoredata] = [] I don't ...
0
votes
1answer
38 views

Swift - add custom color from Storyboard programmatically

I have a custom made color in Storyboard. Is there a way to access it via code? Couldn't find anything on that topic. I know there is a way to code custom-colors in Swift like this: view....
0
votes
1answer
17 views

View pdf documents

I have a table with the names of pdf documents. Previously, there were 3 documents and each one has its own ViewController. How can I make it so that with hundreds of documents, I would select one ...
0
votes
0answers
14 views

How to download epub (or any file) to the users iPhone?

I have the following code that shows an ebook to the user in IOS. The code uses an ebook reader to show the code. Is there a way to download the ebook to the user's IPhone and allow the user to save ...
0
votes
0answers
14 views

How to handle custom errors with Moya and Swift?

I'm using swift and Moya in my project. in one of the api requests I get this response from server(JSON): {"subtype":"GeneralResponseDto","status":401,"error":"13","message":"some message"} I want ...