Post

Replies

Boosts

Views

Activity

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 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 import pdf from url
It looks like a permissions issue. Try this: func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { guard let url = urls.first else { print("Error: no url") return } guard url.startAccessingSecurityScopedResource() else { print("Error: could not access content of url: \(url)") return } guard let dokument = PDFDocument(url: url) else { print("Error: could not create PDFDocument from url: \(url)") return } dokumnetpdf = dokument }
Jan ’22
Reply to import pdf from url
PDFDocument(url:) returns an Optional value... Try this: func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { guard let url = urls.first else {         print("Error: no url") return } guard let dokument = PDFDocument(url: url) else { print("Error: could not create PDFDocument from url: \(url)") return } dokumnetpdf = dokument }
Jan ’22
Reply to Pass a Timer through Controllers
I also wish for the user to be able to close the app and have the timer run in the background The timer will not run in the background, but here is a technique that you could use: Add a mechanism to detect when the app is entering the background, or foreground On backgrounding: If your timer is live... Convert it to a notification (calculate the fire date from the timer expiry) Cancel the timer If the timer expires while the app is backgrounded, the user will see the notification On foregrounding: Remove pending notifications Restart the timer, if it has not expired
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to iMac can’t recognize Logitech keyboard and mouse on login
Yes this seems to be a problem, where certain bluetooth devices are not recognized, before logging in. Which makes it difficult to login! I had a recent trauma with this, when booting in Recovery mode... I had to dig out an ancient wired mouse. I will be interested to see if anyone has a solution to this. iMac Pro MK Anywhere 2 mouse Wired keyboard (to get round this issue!)
Topic: App & System Services SubTopic: Hardware Tags:
Jan ’22
Reply to Can I use api `UIApplicationVolumeUpButtonDownNotification` for getting volume up/down button?
AVAudioSession has a property "outputVolume". You could look for changes to this, using Key-value observing... ...and use that to trigger your photo. That might go against rule 2.5.9, but since Apple's Camera app uses the volume buttons, I think it should be okay. (Note: this technique does not work in the Simulator, it needs a real device) Perhaps something like this: import AVFAudio class VolumeButtonObserver { let audioSession = AVAudioSession.sharedInstance() var outputVolumeObservation: NSKeyValueObservation? init() { observeVolumeButtons() } func observeVolumeButtons() { do { try audioSession.setActive(true) } catch {} outputVolumeObservation = audioSession.observe(\.outputVolume) { (audioSession, changes) in print("A volume button was pressed") /// Take action here... } } }
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:
Replies
Boosts
Views
Activity
Jan ’22
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.
Replies
Boosts
Views
Activity
Jan ’22
Reply to How do I access lyrics in MusicKit or Apple Music Catalog
Lyrics are not available, via MusicKit. While it might be possible to search on lyrics, you can not just download them (presumably due to copyright issues). The "catalog" is just the term Apple use to refer to the music that it makes available.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to import pdf from url
It looks like a permissions issue. Try this: func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { guard let url = urls.first else { print("Error: no url") return } guard url.startAccessingSecurityScopedResource() else { print("Error: could not access content of url: \(url)") return } guard let dokument = PDFDocument(url: url) else { print("Error: could not create PDFDocument from url: \(url)") return } dokumnetpdf = dokument }
Replies
Boosts
Views
Activity
Jan ’22
Reply to import pdf from url
PDFDocument(url:) returns an Optional value... Try this: func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { guard let url = urls.first else {         print("Error: no url") return } guard let dokument = PDFDocument(url: url) else { print("Error: could not create PDFDocument from url: \(url)") return } dokumnetpdf = dokument }
Replies
Boosts
Views
Activity
Jan ’22
Reply to Cannot convert value of type 'Int' to expected argument type 'string'
When you say... Text("Duration in Minutes: \(StepperValue)") ...you are converting StepperValue from Int to String. So change: URLQueryItem(name: "PollDuration", value: StepperValue) to: URLQueryItem(name: "PollDuration", value: "\(StepperValue)")
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to get data from [Float] correctly?
Try this: let vertexData: [Float] = [1, 2, 3] var data = Data() vertexData.withUnsafeBytes { data.append(contentsOf: $0) }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Am getting wrong index path.row from tableview
TableView will not necessarily create all your table rows at once. It will fill the screen... ...then on scrolling down, more table rows are created, as required. Have you tested this behavior? Tip: On the Forum, use "Paste and Match Style" with a code block, to avoid all the blank lines.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Tab Bar,Navigation bar and split view
Please supply more information. Which platform... macOS, iPadOS, iOS...? Also, why tag with wwdc... is this a language question (Swift, Objective-C), or an Xcode question?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Pass a Timer through Controllers
I also wish for the user to be able to close the app and have the timer run in the background The timer will not run in the background, but here is a technique that you could use: Add a mechanism to detect when the app is entering the background, or foreground On backgrounding: If your timer is live... Convert it to a notification (calculate the fire date from the timer expiry) Cancel the timer If the timer expires while the app is backgrounded, the user will see the notification On foregrounding: Remove pending notifications Restart the timer, if it has not expired
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to iMac can’t recognize Logitech keyboard and mouse on login
Yes this seems to be a problem, where certain bluetooth devices are not recognized, before logging in. Which makes it difficult to login! I had a recent trauma with this, when booting in Recovery mode... I had to dig out an ancient wired mouse. I will be interested to see if anyone has a solution to this. iMac Pro MK Anywhere 2 mouse Wired keyboard (to get round this issue!)
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Changing ViewControllers in ViewContainer Messing Up UIDatePicker
It's probably something to do with constraints, or you may be positioning/sizing something in viewDidLoad that needs to be done in viewWillAppear. You might like to share the relevant code from "controller"?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Can I use api `UIApplicationVolumeUpButtonDownNotification` for getting volume up/down button?
AVAudioSession has a property "outputVolume". You could look for changes to this, using Key-value observing... ...and use that to trigger your photo. That might go against rule 2.5.9, but since Apple's Camera app uses the volume buttons, I think it should be okay. (Note: this technique does not work in the Simulator, it needs a real device) Perhaps something like this: import AVFAudio class VolumeButtonObserver { let audioSession = AVAudioSession.sharedInstance() var outputVolumeObservation: NSKeyValueObservation? init() { observeVolumeButtons() } func observeVolumeButtons() { do { try audioSession.setActive(true) } catch {} outputVolumeObservation = audioSession.observe(\.outputVolume) { (audioSession, changes) in print("A volume button was pressed") /// Take action here... } } }
Replies
Boosts
Views
Activity
Jan ’22
Reply to AVAssetDownloadDelegate methods are not called when resumed
On restoring the task, do you need to re-assign it's delegate?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Where is the selection of primary category made?
On App Store Connect, this is in the General section, under "App Information" Then look for General Information > Category
Replies
Boosts
Views
Activity
Jan ’22