[Solved] Im getting an error at cellForRowAt and im not sure why

cell.textLabel?.text can only show a String object, not other objects. It will be product.item or product.price or product.salesPrice or all in one line. (based on your requirement). Make sure the value of product is not nil. cell.textLabel?.text = “\(product.item) \(product.price) \(product.salesPrice)” The full code you can try this: class ViewController: UIViewController, UIAdaptivePresentationControllerDelegate { @IBOutlet weak … Read more

[Solved] Swift 4 Change Physics Gravity

CGVectorMake has been deprecated. Use the following syntax to initialise a CGVector: self.physicsWorld.gravity = CGVector(dx: 0, dy: 0) Or, since you want a vector with both components 0: self.physicsWorld.gravity = CGVector.zero solved Swift 4 Change Physics Gravity

[Solved] How can i convert this code to swift 4? [closed]

UILocalNotification is deprecated. Try this code: let gregCalrendar = Calendar(identifier: .gregorian) var dateComponent = gregCalrendar.dateComponents([.year, .month, .day, .hour, .minute], from: Date()) dateComponent.year = 2012 dateComponent.month = 9 dateComponent.day = 28 dateComponent.hour = 16 dateComponent.minute = 11 let dd = UIDatePicker() dd.setDate(gregCalrendar.date(from: dateComponent)!, animated: true) let content = UNMutableNotificationContent() content.title = “UMUT CAN ALPARSLAN” let trigger … Read more

[Solved] parsing Json in swift4

The error is very clear: …burzua_1.Status.(CodingKeys in _479ABD1AF7892C9F2FD23EC23214E088).status], debugDescription: “Expected to decode String but found a number instead.“ The value for key status is not in double quotes so it’s an Int class Status: Codable { let status: Int … Please don’t declare all properties carelessly as optional. For example status as well as all … Read more

[Solved] I’ve number of latitude and longitude in array. I want to display multiple markers in Google Map [closed]

First integrate Google Maps with the your app Google Maps iOS SDK Then try to add marker to the map Adding a Map with a Marker var marker = GMSMarker() marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20) marker.title = “Sydney” marker.snippet = “Australia” marker.map = mapView Finally use for loop to add multiple markers to the … Read more

[Solved] how to filter current array using another array

You can filter an array of Hotels to only keep hotels that contain a RoomPrice whose roomType property is present in an array of RoomFilter using two nested contains(where:) calls inside your filter, one searching Hotel.prices and the other one searching roomFilters to see if there is at least a single common element between the … Read more

[Solved] Can’t call a function in viewDidLoad [closed]

Your addMarker has an extra bracket. func addMarker(place:EClass) { guard let coordinates = place.location else { return } self.destination = coordinates // clear current marker marker.map = nil marker.position = coordinates marker.title = place.name marker.map = mapView mapView.selectedMarker = marker } 7 solved Can’t call a function in viewDidLoad [closed]

[Solved] How can I parse each items into it’s on uicollection view cell

Please check : OsuHomeController let cellId = “cellId” struct AnimeJsonStuff: Decodable { let data: [AnimeDataArray] } struct AnimeLinks: Codable { var selfStr : String? private enum CodingKeys : String, CodingKey { case selfStr = “self” } } struct AnimeAttributes: Codable { var createdAt : String? var slug : String? let synopsis: String? private enum CodingKeys … Read more

[Solved] How can I parse each items into it’s on uicollection view cell

Introduction Parsing items into individual UICollectionView cells can be a great way to organize and display data in an efficient and visually appealing way. This tutorial will provide step-by-step instructions on how to parse items into individual UICollectionView cells. We will cover topics such as setting up the UICollectionView, creating custom cells, and populating the … Read more

[Solved] Swift 4 pop to a view controller : navigation method [closed]

Make sure your controller is in the navigation stack and you can try this code. for controller in self.navigationController!.viewControllers as Array { if controller.isKind(of: SOListScreen .self) { self.navigationController!.popToViewController(controller, animated: true) break } } 1 solved Swift 4 pop to a view controller : navigation method [closed]

[Solved] How To multiple Euro values total arrays in ios Swift 5 Like [“£179.95”, “£199.95”, “£89.95”]

If you’re sure that the strings contained in your array always start with a £, you could do this: let sum = array.compactMap { Double($0.replacingOccurrences(of: “£”, with: “”)) } .reduce(0.0, { $0 + $1 }) Example: let array = [“£179.95”, “£199.95”, “£89.95”] let sum = array.compactMap { Double($0.replacingOccurrences(of: “£”, with: “”)) } .reduce(0.0, { $0 … Read more