Post

Replies

Boosts

Views

Activity

Reply to Couldn't parse json file as array
Thanks for showing the details. So, it's Building Lists and Navigation, Section 2 Create the Row View, Step 4, OK? You may need to go back to Section 1 Create a Landmark Model and check if your Landmark.swift is correct: import Foundation import SwiftUI import CoreLocation struct Landmark: Hashable, Codable { var id: Int var name: String var park: String var state: String var description: String private var imageName: String var image: Image { Image(imageName) } private var coordinates: Coordinates var locationCoordinate: CLLocationCoordinate2D { CLLocationCoordinate2D( latitude: coordinates.latitude, longitude: coordinates.longitude) } struct Coordinates: Hashable, Codable { var latitude: Double var longitude: Double //<- } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to How to rotate this photo from imagePickerController 90 degrees?
What is resizedImageWithContentMode:bounds:interpolationQuality:? As far as I know, UIImage does not have such a method. I guess it is not properly handling imageOrientation. You may need to update the implementation of the method or modify the orientation by yourself. You say sets it to a UIImage property, but your imagePickerController:didFinishPickingMediaWithInfo: sets the image into a UIImageView, not to a UIImage property, that prevents writing more detailed answer.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to How to implement isUserInteractionEnabled
If you mean var isUserInteractionEnabled: Bool { get set } as the provided code, it is not something to use, but to understand what it is. It explains that isUserInteractionEnabled is a read-write property of type Bool. To use isUserInteractionEnabled, you may need to write something like this: import UIKit class ViewController: UIViewController { @IBOutlet var imageView: UIImageView! //... override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. imageView.isUserInteractionEnabled = true //... } //... } You should better show your code when you ask something, that explains how experienced you are and helps getting better answers which will fit for your code. And to make a good communication in the forums, you should better reply to answers or comments to your posts.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to How do you form shapes in Xcode? Swift Playgrounds book.
Unfortunately, many of the components used in the Shapes book are Swift Playgrounds only or the Shapes book only. You can freely expand or modify the Shapes book and create a circle and set in a scene in the book as described in other parts of the book. But you need to do things in a different way in a UIKit app in Xcode. You may need to find a good tutorial of SpriteKit.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21