Post

Replies

Boosts

Views

Activity

Reply to Building apps in Xcode
If you are serious, and are prepared to put in some time, then have a look at the Stanford cs193 course. Paul Hegarty's depth of knowledge is outstanding, and he has the ability to explain things clearly. A good mix of theory and hands-on demo work.
Jan ’22
Reply to SwiftUI Essential 2nd Tutorial Longitude Latitude CLLocationCoordinate2D - Preview Crashed
You have updated landmarkData.json, to reference an image called "bkkbn". CircleImage_Previews is trying to display this image. Does the image named "bkkbn" exist in your project? More important than that... ...you are using a latitude of 106.880838, which is invalid. Latitude must be between -90 (South Pole) and 90 (North Pole) You may have got your longitude and latitude mixed up?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Issues building HikeView.swift (from SwiftUI Tutorial)
Perhaps there is a problem with your Hike.swift? Could you share the code for that? Or maybe... When you were adding the files to your project, did you check: Copy items if needed Add to targets {Landmarks} Test: Select the file "HikeView.swift" In the file Inspector... ...make sure "Target Membership" shows a tick by "Landmarks"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to How to draw a line of shapes in swift
In SwiftUI... You can draw in a View, using a Path Path has methods (that you should find familiar) like: move(to:) addLine(to:) addCurve(to:control1:control2:) To get the rotation, you could then use the View modifier: rotationEffect(_:anchor:) You could draw this over another view using a ZStack, or by using the "overlay" View modifier
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to convert base64 string to image on SwiftUI
If I understand you correctly, you want to convert a base64 String to a SwiftUI Image. /// I don't have your base64-encoded String, so I'll make a dummy one... let sourceData = Data() let base64String = sourceData.base64EncodedString() /// Convert base64-encoded String to UIImage guard let stringData = Data(base64Encoded: base64String), let uiImage = UIImage(data: stringData) else { print("Error: couldn't create UIImage") return } /// Convert UIImage to SwiftUI Image let swiftUIImage = Image(uiImage: uiImage) Is that what you wanted to know?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22