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
5 views

Navigate from userActivity handler to other view

I want to navigate to a view from a Siri suggestion. The problem is that I need the normal app flow. So first I load the normal view, which redirects and it that view I need to do an action. But how ...
-2
votes
0answers
7 views

Stop call or ringing while accept call in another device which is same login in different devices (Quickblox,Swift)

Currently, I'm doing a one calling project and I'm facing an issue in one scenario : Scenario: Let's say I have logged-in an App from two different Mobile devices. Just consider the App is Skype for ...
-1
votes
0answers
16 views

ImageView image not showing inside of collectionView properly

I have a collectionViewController and an imageView in an array. I grab the image data from firebase storage and then reload my collectionView. However, the image doesn't seem to get processed and just ...
-1
votes
1answer
29 views

Naming of filenames, classes and protocols?

When I use protocols with structural patterns such as MVP, or VIPER I usually add protocol and class conforming to the protocol in the same file. For example, in MVP for the View component: file: ...
0
votes
0answers
8 views

Problem trying to convert 2d touches to spritekit coordinates manually

I'm trying to convert 2d touches to sprite kit coordinates world space. I know there's some convenience methods such as "convert(_:from:)". but In my scenario i need to do it manually, I just don't ...
0
votes
0answers
9 views

Changing iOS app Display Name breaks @testable import

When I update the display name in this field all my tests fail as @testable import HomeApp needs to be updates to match. I was always under the impression Display Name simply appeared under your app ...
0
votes
0answers
7 views

Apple watch app wont build due to error “Failed to use existing instance 0 for app with bundle identifier: com.apple.Carousel”

I recently repaired my apple watch 3. Upgraded xcode to 11.1, and upgraded to macOS Catalina. When I try run an app on my apple watch, it will install, but before it finishes building, it fails with ...
0
votes
0answers
13 views

Why is my UIViewController not showing up in my popup card?

I wanted to create a pop up for one of my UIViewController and found this repo on GitHub. It is working fine with my InfoViewController which only has 4 UILabels (I think this might be the problem ...
0
votes
1answer
22 views

Is loading data in viewDidLoad too late to display it in a UIViewController?

Where do you usually load data when using a UIViewController? When I say "loading data" I mean: API calls to fetch it and its manipulation. Do you load it in the view controller initializer, or load ...
0
votes
0answers
12 views

UIHostingController should expand to fit contents

I have a custom UIViewControllerRepresentable (layout-related code shown below). This tries to replicate the native SwiftUI ScrollView, except it scrolls from the bottom except the top. View ...
-2
votes
1answer
28 views

Does this Timer leak?

Does this timer object leak when pushing and dismissing the view controller or any other circumstance? class ViewController { private var timer:Timer? ... override func viewDidLoad() { super....
0
votes
0answers
12 views

iOS 13 - UISplitViewController resize bug

I have a weird bug with UISplitViewController on iOS 13 (it works fine on iOS 12). I created a simple project to reproduce this bug. This app looks as follow, nothing fancy: I subclassed ...
0
votes
0answers
5 views

imageProvider not displaying image in Graphic Complication Watch OS5

I'm adding Infograph Complications to my Apple Watch app, but I cannot get the images to appear in the GraphicImage family of complications I've successfully created the complications - their data (...
-2
votes
2answers
35 views

Proper filenames in iOS project

I've been told during a job assignment review, that I used weird filenames in my iOS project. I've added a picture of my project tree. Could you explain me what's weird about these names or if there ...
1
vote
2answers
25 views

How to have a date variable update year in counter

I am working on a function to print the time until Christmas. I have accomplished this however the function will only calculate the difference between the current date and Christmas of the current ...
0
votes
0answers
9 views

How should I add custom view over mobile vlc kit in iOS

i want to show some custom control over vlc player,but when i am trying to do so,my control hides when actual video start running in player player = VLCMediaPlayer() player.media = VLCMedia(url: ...
-1
votes
0answers
21 views

Filtering an array using a computed variable [on hold]

My datasource has a private variable _data containing an array with all data and a computed variable data which is returning such array filtered by a string filter. private var _data:[Data] var data:...
0
votes
0answers
11 views

How to add a move back to user location button in swiftUI?

I am quite new to Swift and SwiftUI, and I want to add a user tracking button on top of the mapview, so user's current location can be back in the center of the screen when tapped. I have already have ...
-4
votes
2answers
44 views

Remove escape “\” character in Swift 5

I'm trying to upload xml file with Alamofire 5 multipartFormData. For the data part it has to be String. I tried replacingOccurrences(of: "\"", with: "") but it remove all the String inside my xml. If ...
0
votes
0answers
15 views

how do I add dynamic input field in swift 4?

I want to create a completely dynamic form based on an array from the local database. I have defined the function of each element. I would like to print it on the screen by comparing it to the data ...
-2
votes
2answers
30 views

Parse Json with unknown variables

I'm trying to parse a Json with unknown keys. The Json looks like this: {[ "stats": { "total": { "dagegen gestimmt": 196, "nicht beteiligt": 41, "dafür gestimmt": 435, "...
-4
votes
1answer
36 views

How to make a custom design button in Swift IOS app

I want to ask you, is there any way to make a swift button has the design like this when clicked, and this when not. I want to give me some proposal or anything to do it.
1
vote
0answers
17 views

How should I group wrapped UIKit components to improve accessibility support?

I have difficulties understanding what is the right way to make a custom UIView accessible on iOS. As a case study, here is a custom UIControl subclass wrapping a UILabel and a UITextField subviews, ...
-2
votes
0answers
16 views

doughnut/pei chart in swift like attached image

Hi I have to draw doughnut/pei chart like attached image. below chart there is table view and on selection of cell, pei chart will get spin & point to selected index. like personal capital ...
0
votes
1answer
13 views

How do I get alphabetic tableView sections from an object

This question has previously been posted, like Alphabetical sections in table table view in swift, but I can't really wrap my head around it when I try to implement it into my own code. I have the ...
1
vote
0answers
16 views

Best practices for save and change tokens firestore and iOS devices swift

How can I safely save users tokens (FCM Token and IOs devices) then save them to firestore and later change if the user changed the device? Use UserDefaults or something...
0
votes
0answers
32 views

100 of subviews need to be added on run time in uitableviewcell

I need to add dynamic subviews on the basis of data returned from web-service. some time i need to add 100 of subviews inside the cell which has a horizontal scrolling. My tableview getting stuck ...
0
votes
1answer
20 views

How to set title of navigation item after open another view controller using with present modally - Swift

I have two view controllers in my application. Root view controller has some components and one of them is a button. That button provides to open another view controller using with present function. ...
0
votes
1answer
31 views

Why do I get “exc bad access” when trying to display city and state name in a UILabel in Swift?

Im not sure what Im doing wrong. I have this code below where I’m trying to display the city and state name in a UILabel. Xcode keeps crashing when it gets to the line if let city = selectedPin!....
0
votes
0answers
19 views

Custom fonts not showing Xcode 11 mac os catalina

I have a problem loading custom fonts in the drop down menu to select fonts in storyboard, I have poppins font and MarvinVisionsBig. I have already added them as target membership, bundle resources ...
0
votes
1answer
18 views

date of app purchase date in Swift, start or end date

I use the feature of purchase for weekly and monthly application. Each time the user opens the app, check his or her purchase, if he/she have purchased, how can get both the subscription start and end ...
-1
votes
0answers
35 views

Style UITableView cell while dragging

I am trying to implement dragging from one table to another, and it works fine, but I cannot find a way to achieve certain things related to the UI of the draggable cell. I want to: Disable cell ...
0
votes
0answers
13 views

How to ask for CMMotionActivityManager permissions

I have a functionality on my App that needs to track the user's activity. After reading the Core Motion documentation I discovered that CMMotionActivityManager handles this for me. For now I have the ...
0
votes
0answers
9 views

Unable to schedule a task from within a UNNotificationServiceExtension - Error: BGTaskSchedulerErrorDomain error 1

As the title states, i am currently unable to schedule a task from within a UNNotificationServiceExtension. I would like to schedule the task when the following function is called and thus a push is ...
1
vote
0answers
26 views

Slide Up animation not working (unknown code)

I am unable to get the Date Time View to slide up as it currently just pops up when activated. I have it so that after time it disappears but need the animation for it to show for it to slide up into ...
0
votes
0answers
20 views

YPDrawSignatureView - TableView cell duplicates

I have used YPDrawSignatureView on TableView cell, when scrolling tableview, cells are duplicate signatures, anyone knows how can solve it. my cellForRow func: func tableView(_ tableView: ...
-3
votes
0answers
13 views

How to compiling linphone 4.1 ios?

we made VOIP app using linphone latest framework. All the things working properly but g729 codec not display. For that, we tried to build manually but not get any proper solution. we tried following ...
0
votes
0answers
15 views

iOS App Crashing in VisionKit framework iOS 13

I am using VisionKit framework for document capture introduced in iOS 13. It's wonderfull framework for capturing document. But in this framework at one point there are two buttons on navigation bar (...
-1
votes
1answer
24 views

padding hStack in the top of any screen

I want to put hstack which contains two Texts in the top of any device screen. the problem is when I use padding that I have to decide fixed size of padding.
-1
votes
0answers
7 views

ARKit: Export ARFaceGeometry/blendShapes into obj file

I have an original face .obj file from Apple's ARKit tutorial. Can I capture blendShapes, apply it to that obj and export it to another obj file?
0
votes
0answers
12 views

Swift: GPUImage3 OverlayBlend with OpacityAdjustment doesn't behave like expected

I try to add some noise overlay to an image with the following: var picture = PictureInput(image:UIImage(named:"IMG_3331.jpg")!) var blendImage = PictureInput(image:UIImage(named:"Noise.jpg")!) let ...
-1
votes
3answers
47 views

How to use same pods for iOS and tvOS?

I want to use same pod for iOS and tvOS. For that i have write code in pod file like this, def shared_pods pod 'Moya', '~> 9.0' #Alamofire wrapper pod 'AlamofireNetworkActivityLogger', '~&...
0
votes
0answers
17 views

How to avoid Memory Leaks due to AFNetworking in swift

Im using AFNetworking in my project. When I try to find the memory leaks using instruments, its showing AFNetworking as reasons for memory leak. I'm creating a model class and within that class I'm ...
-2
votes
0answers
41 views

How to replace typing word with suggested word?

How to replace a word in textfield like suggested word from server let say I'm typing when i got suggestion i need to replace that word from tableview didSelect, just like suggestions.
-2
votes
0answers
45 views

Get time intervals between time in Swift [duplicate]

I'm receiving two times in a string from API response. Now i want to make time intervals between them of 15 mins. For example time1 is 12:00 and time2 is 01:00 , the result should be an array of ["12:...
0
votes
1answer
31 views

My issue is that I am unable to make any network request in ios 13 and xcode 11

I have created an app for my client about Forex. My app was running well in IOS 12 but when i install my app on IOS 13 simulator it doesn't make any network request. Alamofire.request(URL_USER_LOGIN,...
0
votes
0answers
14 views

Want to upload a sqlite.db file to a swift container using pyhton swiftclient and always get a utf-8 error

i am trying to upload a sqlite.db(binary file) to a swift container using swiftclient in my python code. import swiftclient swift_conn.put_object File "/usr/lib/python3.7/codecs.py", line 322, in ...
0
votes
0answers
12 views

Edited entities of xcdatamodeld but get Crash - Core Data in swift

I renamed some Entities of name.xcdatamodeld and delete other Entities and then I deleted app from simulator and restarted it but when I run the app get me bellow crash: PortalApp[4672:94749] [error] ...
0
votes
1answer
26 views

How to make network calls from Siri Intent Extension?

I am trying to integrate Siri from my app. Actually my requirement is do some UDP call with my server but as it was not happening I tried with simple network call with URLSession and URLRequest. For ...
-1
votes
0answers
18 views

Play multiple sounds at the same time on buttons on Tableviewcells swift 4.2

I have a tableview and a button on each cell in TableViewCell. When I click the button the sound plays when i click the next button i.e button at index2 the first sound stops and the next sound plays ...