Questions tagged [swift4.2]
Use this tag only for questions directly related to changes in version 4.2 of Apple's Swift programming language. Use the tag [swift] for more general language questions, or the tags [ios], [cocoa], [apple-watch] etc. for questions about developing on Apple platforms.
667
questions
0
votes
0
answers
28
views
Passing tap action between views in swiftUI
I'm a beginner in swiftui and I'm trying to build attributed type text in swiftui. I was able to do so, now for the link instead of url I need to have a custom popup so I'm trying to pass the tap ...
0
votes
2
answers
46
views
Table view width base on number rows issue
I have a issue with height table view, for example if I have 3 rows in a table view and each row has 50 , table view will be 150 (I have a table view inside table view, the issue is in the second ...
1
vote
0
answers
16
views
Sending One Signal Tags when the application terminates in iOS
In our iOS e-commerce application, i have setup ONESIGNAL, and sending "cart_update".
I am sending "cart_update" to true in the situation where the user has atleast one item ...
0
votes
0
answers
15
views
Is the MacOS shared Network Folder even accessible in Swift 4.2?
I wanted to print out the server urls found under the MacOS's "Network" folder using Swift 4.2, but I can't figure out how to access that folder. For Example:
This is the folder I wanted to ...
0
votes
2
answers
34
views
TableViewController with duplicate items of list
I m building iOS application using swift 4.2 and I have a TableViewController that have a strange behaviour.
This is the code:
import UIKit
class StoreByCategoryViewController: UITableViewController{
...
1
vote
1
answer
37
views
Cannot convert call result type 'Set<String>' to expected type 'String' error
I am working on an old Swift 3 project and I'm getting this error after updating it to Swift 4.2. It seems to work fine in Swift 3. I had to declare let NSURLPboardType = NSPasteboard.PasteboardType(...
-2
votes
1
answer
95
views
Programmatically emptying UIStackView
I have a fairly simple code which, upon clicking a button, adds a randomly colored UIView to a UIStackView, and upon a different button click, removes a random UIView from the UIStackView.
Here's the ...
0
votes
1
answer
110
views
Why does custom NSView redraw when window is resized or moved (drag) to an secondary display (monitor)?
I recently started adding graphic charts to a MacOS application I wrote. The first chart is great and I added a second chart where I ran into a fundamental way the code operates that I did not/do not ...
0
votes
1
answer
31
views
SWIFT - String based Key-Value Array decoding?
I have a String based Key-Value Array inside of a String, and I want to decoded it and assign the value to an existing array in Swift 4.2. For example:
let array: [String:String] = []
let ...
0
votes
3
answers
133
views
How to get specfic data of row as dictionary by search in coredata
i had added this code for search via product_id in coredata but that returns all records i want to just get specific data from row that contain that product_id
let request = NSFetchRequest<...
0
votes
1
answer
95
views
how do i get the latitude and longitude from struct and show them on mapbox Swift
I'm getting data from API and I need an array of latitude and longitude to show all the locations on the map (I'm using Mapbox for the map)
func getdata(){
print("meter is \(mapMeter)")
...
0
votes
1
answer
306
views
Decoding Percent-Encoded String in Swift 4.2? [duplicate]
I'm trying to decode a percent-encoded string but can't figure out how to. For example:
let str = "Hello%20World"
// I want to decode 'str' to 'Hello World'
Does anyone know the best way ...
1
vote
0
answers
48
views
How to add multiple clickable markers that popUp image when click in Googlemap
I added mapView with @IBOutlet and the extension of GMSMapViewDelegate{}
below code able to parse the returned json result. The code will get the image url and Latlon.
Problems:
the markers are added ...
0
votes
2
answers
175
views
how to parse this complex nested Json
The Json is valid but I m getting nil with below code and struct for the returned json.
problem encountered:
at JSonDecoder.decode() : it returned this error msg:
keyNotFound(CodingKeys(stringValue: &...
3
votes
1
answer
435
views
SKCloudServiceController().requestUserToken Freezes on iOS 14.2
I am trying to run the following function from SKCloudServiceController but for some reason every time it runs, the app just freezes. I have tested my developer token and it does work. I am running ...
0
votes
1
answer
360
views
CocoaPods could not find compatible versions for pod “5.0.0-beta.1"
I want to use ‘Alamofire’, ‘~> 5.0.0-beta.1’via CocoaPods in my swift project.
I am getting the following error when after pod install in command line.
[!] CocoaPods could not find compatible ...
0
votes
0
answers
127
views
Application background refresh issue
I am working on one application which is developed in swift. When application kept in background then it automatically refresh after some interval and when application is going into the foreground ...
0
votes
0
answers
26
views
how to get Specific Value from firebase
I have to match this UID (userID) with the current userID for chat list kindly explain how to do
1
vote
0
answers
108
views
MultiPeer Connectivity not connecting swift 5
I'm developing a simple Tic Tac Toe game.
I'm trying to use MultipeerConnectivity for connecting two devices together, here's my code:
AppDelegate:
var mpcHandler = MPCHandler()
MPCHandler:
class ...
1
vote
0
answers
57
views
Migrate Swift 3 to Swift 4.2 and now I get nil on IBOutlet
I converted and corrected an IOS Xcode project from Swift3 to Swift4.2. It was a very hard time but now that get all building errors resolved I'm getting errors when testing the App ( Yeeeeah... )
...
1
vote
0
answers
733
views
Implement a horizontal Scroll View in UIKit?
I want to create this type of view (a ChipView) with horizontal scrolling list in Swift:
I want to create with scroll with applied filter display.
0
votes
0
answers
399
views
How To Prevent ERR_TIMEOUT From Epson TM-m30 Thermal Line Printer Timeout error in Printing Progress using SDK for iOS?
I also tried with latest SDK for iOS of Epson thermal Line printer for model TM-M30 still having same error screenshot attached here .
SDK link using in my iOS App as under;-
https://download.epson-...
0
votes
0
answers
507
views
Cannot send messages to AgoraRTM channel
I am developing the app the message "Hello" is sent when you enter the chat room by the following Swift4.2 code. And, I check whether the message was sent or not by checking the sample app ...
-1
votes
1
answer
37
views
Adding share extension to the existing project. So the already existing project pod starts getting errors
When we add a share extension to the existing project. So the already existing project pods start getting errors because your code is in Swift 4 and the extension is in Swift 5.
When I add a pod in ...
0
votes
1
answer
112
views
Duplicate objects in core data
I have a problem, my objects every time I save them are reflected in uitableview in a duplicate way, does anyone know how to solve it or if I have a problem in my code?
import UIKit
import ...
0
votes
1
answer
152
views
UITextField crash undo keyboard icon
Facing this error in iPad app. In textfield keyboard will appear. write any text like "qwertyuio" then copy and paste this text multiple times until limit reached out. Now, press undo from ...
0
votes
1
answer
910
views
VOIP notification is being missing or delay
How do I know that my device is blocked from receiving VoIP notifications?
The application stops receiving VoIP notifications after receiving for 3-4 times. I understand that from iOS 13 VoIP ...
-2
votes
2
answers
893
views
Why I am getting swift compiler error in Xcode 10.1
I can't build my application it is continuously failing to build.This is screenshot
0
votes
3
answers
452
views
How to get all data array after looping in swift?
I make struct to add data, here is my struct:
struct data {
var documentCode: String?
var attachmentSize: String?
var applicationType: String?
var fileExtension: String?
var file64:...
0
votes
2
answers
184
views
Issue in formatting Date in swift 4
I am having a Issue in formatting Date in swift 4
The time HH:mm:ss getting wrong data, when formatting the source code is provided below.
let dateFormatter : DateFormatter = DateFormatter()
...
0
votes
1
answer
95
views
How do I read a text-file's content from it's shared Dropbox link in Swift 4.2 (without downloading)?
I'm having a hard time figuring out how to output a simple text-file's content from it's shared Dropbox link (without downloading) through Swift 4.2.
For Example:
let url = URL(string: "https://...
0
votes
1
answer
66
views
JSONDecodable and required init
I've created a network manager that gets a JSON response and converts it in to a Swift object,
protocol HTTPResponse: Codable {
}
class UserResponse: HTTPResponse {
var name: String?
}
...
0
votes
2
answers
458
views
Tableview cell border not occupying full width in swift
I'm trying to add a border on all sides to my table view cell, I was able to add the border but facing an issue where the border on the right side is not occupying the full width of the cell as in the ...
0
votes
3
answers
1k
views
How to get current date from current timezone from a time server in Swift?
I am working on application where i want to get current date as per the users current timezone. even after user changes date from their device setting menu.
To get the current timezone i have used
let ...
0
votes
1
answer
544
views
Unable to authenticate using MSAL for iOS Swift4.2
I'm not able to execute MSAL SDK. I'm getting below mentioned issue...I've gone through many StackOverflow questions but still unable to resolve this issue.
Issue :
qwerty[66144:4049892] -canOpenURL: ...
2
votes
0
answers
444
views
MSAL - Facing issues while authenticating token in iOS using Swift 4.2
I'm unable to resolve this issue. Please help me.
I'm trying to implement this, still unable to get success. Though I tried multiple Stack-Overflow solutions as well as referred below urls...
https://...
0
votes
0
answers
30
views
UI Not Updating During Reset for Simple Swift 4.2 Game
I'm new to iOS and Swift development, and I'm looking for help with a practice application.
It's a super simple game where you move a slider to "guess" a target/random number, and you are ...
2
votes
0
answers
42
views
Share Directory and its content
I have below striation of directory in documents
Folder- A -> Folder1 -> (Contain image1.png,image2.png)
Folder2 -> (Contain image1.png,image2.png)
Folder3 -> (...
0
votes
1
answer
29
views
How to Read Data From a children array of a JSON in iOS
here is my json
let myjson = """
{
"name": "md",
"student": "cse",
"project":[{
"id": "1",
"...
0
votes
0
answers
555
views
How to open your app with specific link in swift?
I'm working on an application that record video and provide an option to share that video on other apps like facebook , Instagram. so far it is working good with the posting of video but I want to ...
0
votes
1
answer
499
views
How do I share a video to instagram feed using Swift 4.2 and Xcode 11.3?
I have installed instagram on my iPhone and have logged in as well.
I am using following code in Swift
let fetchOptions = PHFetchOptions()
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "...
0
votes
0
answers
52
views
I got "BE" appended text after year in date picker. I searched for it but I didn't get any success
I am getting "BE" as postfix in year(in a date picker). This issue is not for all devices. Issue appears only in one of my client's device and he is using iOS 13.5.1(latest)
My code for ...
0
votes
2
answers
59
views
How to invoke a function in another ViewController?
How can I invoke a function/method in another firstViewController swift file while the control/state is in secondViewController.
In Second ViewController when a button is pressed the ...
0
votes
1
answer
34
views
Problems Enumerated Deque<Double>()
I use "attaswift/Deque" library. I have a double Deque;
var pointsZ = Deque<Double>()
I want to use;
for (index,value) in pointsZ.enumerated(){
...
}
I got error "For-in loop requires ...
-1
votes
1
answer
102
views
Directions from one location to another in swift using MapView
MapView Image with 2 TextfieldsHow to draw directions/route from one location to another entered in UITextfield using MapView in swift?
The user should enter one location in source textfield and one ...
0
votes
2
answers
644
views
Show JSON as TableView Section and TableView row in Swift 4.2 without Decodable?
I have below JSON response array with key "events"
{
"events": [
{
"name": "event foo",
"date": "2020-05-22",
"time": "7:00",
"am_or_pm": "PM",
"day": "Saturday",
"description": "test "...
1
vote
0
answers
72
views
Alamofire and Digest-Auth
I am trying to implement in my Apps Digest-auth but i am struggling, or is not working properly.
I have setup my request as you describe in your AuthenticationTestCase and looks like the following ...
7
votes
1
answer
728
views
TextField in SwiftUI loses focus when I enter a character
I have a problem when I enter a character within a TextField (Within ExerciseSetView), I have to re-click the text box to make it so I can enter another character. If I remove the bindings from the ...
-4
votes
1
answer
31
views
Conway sequence in swift [closed]
Can anyone help me out with this sequece.
I have tried multiple times but not getting solution. Some of the solution looks like as follows
1
11
21
1211
11121
But i need following solution. I want to ...
1
vote
1
answer
295
views
If Button clicked - do animation to image Swift Playgrounds
My goal is simple. When a button is clicked, the button should fade out and so should another image on the screen. I am using Swift Playgrounds. I have already got the button to fade out when clicked ...