Newest 'swift4.2' Questions - Stack Overflow

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.

0
votes
1answer
19 views

number of radio buttons in a static tableview cell in swift

I have been trying to add 3 radio buttons for gender selection in a static tableviewcell.But am not able to do that.Can any one help to do this. func setGenderCell(indexPath : IndexPath) -> ...
0
votes
0answers
20 views

how to apply the gradient color as bar tint color of NavigationBar in AppDelegate class in swift

I am trying to apply the gradient color as bar tint color of UINavigationBar in app delegate class.But,here I am able to apply vertically.If I try to apply horizontally it is not so clear.Can any one ...
0
votes
0answers
10 views

Passing data through controllers not working as expected

Can someone tell me why my code is not working as i expect? I want to pass value from ViewController to FVC controller. I think the problem is with page controller ("TEST"). Here is SS of my ...
0
votes
0answers
9 views

How can i refresh cache and send notification when json data is updated in swift 4.2

When i use this code for clerar chache and fetch json data from url; let configuration = URLSessionConfiguration.default configuration.urlCache = nil configuration.requestCachePolicy =...
0
votes
1answer
31 views

Problem converting array of images to video

So I am trying to convert a quite large array of images, of around 30 images to a video in this app I am working on. My code to do the conversion is based on this code that I saw on this question: ...
0
votes
0answers
27 views

Remove common value from two different array of dictionaries

I have 2 array of dictionary: serverContactsDict = [["name": “Miya”,”number": “4178547852”], [“name": “Simon”,”number": “2458741458”], ["name": “Pio”,”...
0
votes
1answer
16 views

How to do proper search as filter not working

I used: var userArray:NSMutableArray = NSMutableArray() view did load : searchTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: UIControl.Event.editingChanged) Then: ...
-1
votes
1answer
33 views

I don't use custom navbar with AKSideMenu in swift

I want to use my custom navbar, I do all the settings on the board, but when I run my application comes first as I do when I go to different pages, the standard navbar comes in standard settings. I ...
1
vote
2answers
44 views

Type 'string' has no member 'playback'

While trying to build a xylophone in xcode 10.1, using swift 4.2 on iOS12, i used a button to play a .wav file and entered the following code but the following error shows up: "type 'String' has no ...
0
votes
1answer
19 views

Custom InfoWindow for google maps - Unable to set y position

I am working in Google maps for my project. I need to show image with title in InfoWindow. For that I have create new XIB. Now everything works fine except y position of the InfoWindow. I cannot set ...
0
votes
0answers
5 views

In this init method is the value of the frame always set to CGRect(0,0,0,0)?

I am having trouble understanding the following init. Will the value of the frame always be set to CGRect(0,0,0,0)? init(layout: Layout, frame: CGRect = CGRect.zero) { self.frame = frame self....
0
votes
1answer
23 views

how to create a custom view using xib

I have created a custom view which can be reuse at number of places,I have assigned this classname to the sub view of view controller.Here I am completely using XIB's.while running this app it's ...
3
votes
1answer
24 views

Produce an array of dictionaries from two arrays in Swift

I have two dictionaries: name = ["A","B","C","D","E"] number = ["1","2","3","4","5"] How can I produce the following, using built-in functions? [ {name : "A", number: "1"}, {name : "B", ...
1
vote
2answers
71 views

Avoid Equatable and Hashable boilerplate, Swift 4.2

On project we are using classes for model's layer and because of that I have to write code like this: // MARK: - Hashable extension Player: Hashable { static func == (lhs: Player, rhs: Player) -&...
-1
votes
2answers
45 views

Create JSON Array with Swift 4.2

I can't fetch json data from URL I tried Alamofire, Swiftyjson and JSONDecoder but i didn't get any data This is my json url result; { "Firmalar": { "Firma": [ { "SicilNo": "382"...
-3
votes
0answers
49 views

Scrolling is not working correctly after I've upgraded to iOS 13 with Xcode beta 11

Funny behavior while scrolling the feeds on the table view, collection view and the scroll view is not working correctly after I've updated to the iOS 13 with Xcode 11 beta. It's not working in full ...
0
votes
2answers
54 views

change the contrast and brightness of image using slider

I am trying to change the contrast and brightness of an image using the slider, and I have created a slider programatically. When I am trying to vary the contrast by the slider, am getting an error ...
0
votes
1answer
40 views

How to fix ''Expected ';' after top level declarator“ and ”Unknown type name 'class'?

I use cocoa to import TUIKit which is a imSDK demo written in objective-c by Tencent into my blank swift app. I get the error: Expected ';' after top level declarator and Unknown type name 'class'; ...
0
votes
0answers
32 views

IOS swift 4 - Receive firebase silent push notification When app is Closed

I've implemented Firebase silent push notification with content_available = true. When the app is killed or not running in the background I don't get the silent push. When the app is in background or ...
0
votes
1answer
37 views

How can implement live stripe apple pay in swift? Stripe test key is working fine but not live, how can I fix it?

I'm using stripe apple pay for payment. I have integrated stripe apple pay and it is working fine with test stripe key. But when I use live stripe key it shows an error: Apple pay not completed "...
0
votes
1answer
24 views

Trying to Save and Fetch data using Firebase but receiving this Error

I ma trying to save data on firebase and then Fetching data from that data base but seeing this Error.I have tried many links but not found any help? Thanks Advance... import UIKit import GoogleMaps ...
0
votes
2answers
38 views

Convert decrypted string into JSON object

After decrypting my response from API i am getting a string "name:DM100, profile:[1,2,4,5]". How can i convert this to a json object where name is string and profile is an array i have tried using ...
0
votes
1answer
29 views

Swift Universal Framework not working in other app project

I created Swift Universal Framework and added external library via pod , but when i used universal framework in other app project, It gives diffrent - diffrent error while compile the project like-: "...
0
votes
0answers
6 views

UIDropSession kUTTypeMessage get sender and recipient info?

I am using Drag/Drop between the mail app and my app using the following: class DropFileTypes: NSObject, NSItemProviderReading { let fileData: Data? let extensionName: String? required init(data: ...
0
votes
0answers
10 views

MultiTouch UIView same time

I have two UIView-s, I want to add multi touch, I want to call a method when this two UIView-s is touched at same time, I have simple project for now and have not written any code. I dont know from ...
0
votes
1answer
31 views

Swipe Actions are not working on Section header

I am using swift 4.2 and xcode 10.1. I am working on a project and Created some fancy expand/Collapsable UITableView. Everything is working just fine and awesome. Then there comes some need of ...
1
vote
1answer
37 views

How to fix error: memory read failed for 0x0

I have clicked login button and the message throw in notification center and a country picker opened and when I click on button in country picker log in view Controller must be opened but it throws an ...
0
votes
1answer
18 views

Why my app crashes when loading a MapKit View in disconnected from computer iPhone?

I have a UIViewController with a MapKit View inside of it, the app runs perfectly in simulator and physical device connected to my mac, but when I try to run the app with the device disconnected, it ...
0
votes
0answers
26 views

Custom UIview with UIBezierPath like ice cream cone

I am making a location marker that is dynamic imageView inside it and the background has gradient color I tried to make Circle with UIbezierpath and thought of adding the traingle view to it but all ...
0
votes
0answers
12 views

How to use search bar input to find word in multiple languages

i'm new to swift programming. How can I make a search bar that works in two different language? I'm not sure how to do this. Should i use a dictionary to pair these letters or is there better solution?...
0
votes
0answers
27 views

Updating custom attributes

I have created a user pool in AWS cognito which contains a series of custom attributes. All attributes are set with read/write access. I would like to update some of the custom attributes after the ...
1
vote
1answer
57 views

Method collectionView (didSelectItemAt…) doesn't Work at iTunesConnect; However, It does Work on Debug

I've updated my Xcode to the latest version, currently it's 10.2.1(10E1001) and migrated my project from Swift 4 to Swift 5. It made me some troubles, but finally I've built my project and it works ...
1
vote
1answer
45 views

How to present another view controller under tab bar on button press inside a tab bar controller view?

I have 4 tabs and in the home tab, I have a button to goto profile view controller. When I use segue, The view changes completely and it's presented over tab bar. So it gets hidden. I want to ...
-1
votes
1answer
64 views

Method cannot be marked @objc because the type of the parameter 3 cannot be represented in Objective-C

How can I fix this? anyone can help me? thanks! I'm using Xcode 10.1, swift 4.2 @objc func searchVenues(_ coordinate: CLLocationCoordinate2D,radius: Float = 10000.0, completion: @escaping (Result<...
-1
votes
0answers
46 views

How to sort total structure data based on one property value in swift [duplicate]

I have below structure, I want sort date along with value but they must belong to same data I don't want to change indexes just I need sort date along with value. Structure { var date : String? ...
-3
votes
1answer
29 views

How to get the Push notification received message in the logs

I am getting the push notification to the device. But how to get the message to be printed in the logs? What is the method to be used in order to get the received message to be printed or to be used ...
2
votes
2answers
52 views

is there a shortcut to know, when I'm running my app, which view controller am I in?

I'm working on an application that already exists, and I want to run the app and know in the output which view controller am I in, without going to every class and viewController and printing its name....
0
votes
0answers
10 views

Event Tracking method in Google analytics what is the usage of Label and value?

I am integrating Google analytics to Application. let build = (GAIDictionaryBuilder.createEvent(withCategory: leadId, action: actionType, label: "IOS", value: nil).build() as NSDictionary) as! [...
2
votes
2answers
67 views

Auto scroll UICollectionView when i scroll UITableview

I have a horizontal CollectionView on top and TableView under it I want as I scroll TableView my CollectionView should scroll and animate along with to some level I have achieved with scrollItemTo ...
1
vote
0answers
23 views

Multi-part form/data is not working with nested json i

I am trying to send an image with some parameters but few parameters are in nested JSON. I always received error as "NSDebugDescription" : "Invalid value around character 0." I tried few solutions ...
0
votes
0answers
14 views

swift 4.2, How to access inited viewController from other class

Here. I'm having difficult to access my inited viewController that added on fly by programmatically through delegate. Delegate defined in my FileDelegate.swift as: protocol FileDelegate: class {...
0
votes
1answer
50 views

swift deinit method not calling

In UIViewController deinit method not calling in ios swift4.2 I have tried below code for navigate to next viewController after navigation in popToViewcontroller deinit method not calling. let ...
1
vote
1answer
43 views

handle cases of Enums in Swift

How can we handle the same case with different inputs from the response in Enum's enum MyNotificationType: String, Codable { case practice = "push" case practice = "...
0
votes
0answers
19 views

Show five at a time in UITableView / UICollectionView

I've a tableView where I'm able to show 5 cell at a time. My requirement is showing previous or next 5 when scroll up or down depending on User's action. I did some code but fail to achieve the ...
0
votes
1answer
62 views

How to get accurate CGpoint for drawing UIBezierpath on sceneview from touchesMoved method?

UIBezierpath displays somewhere else on real world make collection of CGPoint from below code override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { guard let ...
0
votes
0answers
12 views

drawHierarchy is leaving space on top of image while changing a uiview to uiimage how can i fix?

i am creating UIImage from UIView. when i call function redrawHierarchy i got the image but y position of image is not as required. extension UIView{ func snapshot1(of rect: CGRect? = nil,...
1
vote
1answer
408 views

How to fix this error “ Could not find module 'CzsBleSdk' for architecture 'x86_64'; found: arm64, arm ”

I'm working with bluetooth in an old project which was written in swift3 and i'm working on converting it in swift4 and I had this error "Could not find module 'CzsBleSdk' for architecture 'x86_64'; ...
0
votes
0answers
25 views

Is there any way to popup a view with long text when tapping a button on each collectionview cell?

I have a UICollectiobView and when tapping on the cell it brings me to another UIViewController with appropriate data. But also as in this record I want to tap to a button on each cell which will ...
-3
votes
1answer
44 views

`Result of operator '<' is unused` when in reality it's used

I'm wondering if this is a bug in XCode or if I'm doing something wrong: I have this class which implements Comparable: class Span: Comparable { var start: Int var end: Int // Some ...
3
votes
2answers
56 views

How to validate a name(John D'Largy) in iOS Swift4.2?

i tried all possibilities in stack-overflow (link1, link2) answers no use for me. I am using following Regex to validate a first name. In online case (OnlineRegex) it is working fine but when i ...