Post

Replies

Boosts

Views

Activity

Reply to Fetch Core Data Issue
It is still very difficult to understand your code, partly because naming of var is not explicit enough. What is prefArr ? How is it populated (if an array). When you save: you create a new instance saveFav then, I don't understand what you are doing in the loop. Is it just for displaying saveFav ? I do not see in save where you reference a newly created fav So the first questions: where and how do you create a new favorite how do you use it in save
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Does iOS work in airplane-mode?
AFAIU, no, it is not turned off, as it is receiver only. But maps are not updated, because you request the map area to a server, then need to transmit the request and thus use emitter. Is it the thread you were looking for ? https://discussions.apple.com/thread/8048257
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to App that sells drinks and has drinking games
There would also be a leaderboard and if you drank a certain amount of drinks you would get a discount on the next one. My understanding is that the app would incite to drinking. And app will likely be rejected under 1.4.3 and may be 1.4.5 as well. I would also like to know if there is a support number that I can use to contact an App Store employee/reviewer so that he/she can clarify these questions before having to submit the app for review. No there is not. And no way to have upfront information on the review beyond the guidelines. You have to submit and wait for the review.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to UINavigationbar back button is missing
If you are running your app only on iOS 14.1 What do you mean ? You do not get the problem on other versions of iOS ? Did you change the content direction as well ? navigationController.view.semanticContentAttribute = .forceRightToLeft self.navigationController?.navigationBar.semanticContentAttribute = .forceRightToLeft May read this: https://stackoverflow.com/questions/68019133/move-the-navigation-item-title-to-the-right-side-of-your-navigation-bar-in-swift
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
You could use local notification. To illustrate: bus 1 leaves at 8:00 bus 2 leaves at 8:30 bus 3 leaves at 9:00 It is 7:45 bus 1 shows at top of scrollView you post a notification to trigger at 8:00 (when bus 1 has departed) It is 8:00 the action of notification will scrollToItem 2 : the next bus in the timetable after 8:00 and post a new notification to fire at 8:30 It is 8:30 the action of notification will scrollToItem 3 : the next bus in the timetable after 8:30 etc… See: https://stackoverflow.com/questions/52009454/how-do-i-send-local-notifications-at-a-specific-time-in-swift
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How do I swap views in a single window?
I've run into that learning block where the next thing I want to do seems to demand I know ten other things which all demand each other. That's the usual problem when you start in a new area of iOS. So many thinks intertwined to master. That's why I usually start with a simple design, just to make it work (my initial proposal). Then progressively evolve it to really do as expected. Now to your questions: What, if any, special VC or container I need for the detail view (on the split). When you create a splitViewController, in Interface builder, it creates automatically 4 VC for you. In older versions of Xcode it also created the classes templates. Now, look for some tutorial, such as for instance h t t p s : / / w w w.raywenderlich.com/4613809-uisplitviewcontroller-tutorial-getting-started What I need to do to make a button change the view. Which button ? The one in the list on the left panel ? If so, that's a basic mechanism, look at tutorial How to attach a segue to the view change. I don't understand. You want to have a segue which would be triggered when ? Which view do you mean ? 3 I'm assuming needs to programmatic (i.e., not interface builder) It depends where do you segue from and to.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Adding hints, instructions, help to IOS App
Problem with iOS is that you have no hover capability as with MacOS. I have no link to tutorial on this, but a few ideas to propose. Help user start Usually, on the first view, user has to select some action (in general, tapping a button). You could flash this button after a few seconds if user has not tapped anything, to attract its attention. Provide a help button on each page, with a short message, possibly spoken to avoid fastidious reading.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’21
Reply to Fetch Core Data Issue
The reason I have a loop is because I want to define all the objects in my array called prefArr as saveFav when the save button is pressed and I try to save them to the context. OK, but you create a single instance. Why don't you create in the loop ? Code could become like this:  @IBAction func save(_ sender: UIBarButtonItem) {     // -->> NOT HERE var saveFav = CurrentPlayers(context: context)     // Assign values to the entity's properties     for o in prefArr { var saveFav = CurrentPlayers(context: context) // <<-- Create a new instance each time here      saveFav.yahooName = o.yahooName      saveFav.team = o.team      saveFav.position = o.position      saveFav.photoUrl = o.photoUrl      // To save the new entity to the persistent store, call save on the context       do { // <<-- Save each        try context.save()        fetchSave() // Not sure it is needed      print("This is my saved object: \(saveFav)")       } catch {        print(error)      }     }   }
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Is SwiftUI usable?
This is just a personal opinion. But I'm not comfortable to develop app (Mac or iOS) with SwiftUI. Because of maturity and because of what I perceive as a lack of flexibility. It is really impressive on demo projects, but not on full scale large app. In addition, I find that programming the UI in code is a major step backward… Once again, just a personal opinion.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Fetch Core Data Issue
It is still very difficult to understand your code, partly because naming of var is not explicit enough. What is prefArr ? How is it populated (if an array). When you save: you create a new instance saveFav then, I don't understand what you are doing in the loop. Is it just for displaying saveFav ? I do not see in save where you reference a newly created fav So the first questions: where and how do you create a new favorite how do you use it in save
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to FileHandle class has a lot of deprecated methods. What do I use instead?
At the end of FileHandle documentation page, you have the list of instance methods that you can use: func close() func offset() -> UInt64 func read(upToCount: Int) -> Data? func readToEnd() -> Data? func seek(toOffset: UInt64) func seekToEnd() -> UInt64 func synchronize() func truncate(atOffset: UInt64) func write(contentsOf: T)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Binary operator '/' cannot be applied to two '() -> [Double]' operands
Show code please.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to [ios 15] The position of the address bar of Safari for iPhone in landscape
Rationale is usually the limited screen real estate. In SE, is it a Floating bar ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Does iOS work in airplane-mode?
AFAIU, no, it is not turned off, as it is receiver only. But maps are not updated, because you request the map area to a server, then need to transmit the request and thus use emitter. Is it the thread you were looking for ? https://discussions.apple.com/thread/8048257
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to App that sells drinks and has drinking games
There would also be a leaderboard and if you drank a certain amount of drinks you would get a discount on the next one. My understanding is that the app would incite to drinking. And app will likely be rejected under 1.4.3 and may be 1.4.5 as well. I would also like to know if there is a support number that I can use to contact an App Store employee/reviewer so that he/she can clarify these questions before having to submit the app for review. No there is not. And no way to have upfront information on the review beyond the guidelines. You have to submit and wait for the review.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to UINavigationbar back button is missing
If you are running your app only on iOS 14.1 What do you mean ? You do not get the problem on other versions of iOS ? Did you change the content direction as well ? navigationController.view.semanticContentAttribute = .forceRightToLeft self.navigationController?.navigationBar.semanticContentAttribute = .forceRightToLeft May read this: https://stackoverflow.com/questions/68019133/move-the-navigation-item-title-to-the-right-side-of-your-navigation-bar-in-swift
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to nil value from dictionary when the application runs on MacOS 11.3 or higher
Could you NSLog to see exactly what you have for valueLabel and desiredLabel?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
You could use local notification. To illustrate: bus 1 leaves at 8:00 bus 2 leaves at 8:30 bus 3 leaves at 9:00 It is 7:45 bus 1 shows at top of scrollView you post a notification to trigger at 8:00 (when bus 1 has departed) It is 8:00 the action of notification will scrollToItem 2 : the next bus in the timetable after 8:00 and post a new notification to fire at 8:30 It is 8:30 the action of notification will scrollToItem 3 : the next bus in the timetable after 8:30 etc… See: https://stackoverflow.com/questions/52009454/how-do-i-send-local-notifications-at-a-specific-time-in-swift
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Weak references
I hope this may help a little: h t t p s : / / w w w.hackingwithswift.com/articles/179/capture-lists-in-swift-whats-the-difference-between-weak-strong-and-unowned-references
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How do I swap views in a single window?
I've run into that learning block where the next thing I want to do seems to demand I know ten other things which all demand each other. That's the usual problem when you start in a new area of iOS. So many thinks intertwined to master. That's why I usually start with a simple design, just to make it work (my initial proposal). Then progressively evolve it to really do as expected. Now to your questions: What, if any, special VC or container I need for the detail view (on the split). When you create a splitViewController, in Interface builder, it creates automatically 4 VC for you. In older versions of Xcode it also created the classes templates. Now, look for some tutorial, such as for instance h t t p s : / / w w w.raywenderlich.com/4613809-uisplitviewcontroller-tutorial-getting-started What I need to do to make a button change the view. Which button ? The one in the list on the left panel ? If so, that's a basic mechanism, look at tutorial How to attach a segue to the view change. I don't understand. You want to have a segue which would be triggered when ? Which view do you mean ? 3 I'm assuming needs to programmatic (i.e., not interface builder) It depends where do you segue from and to.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Adding hints, instructions, help to IOS App
Problem with iOS is that you have no hover capability as with MacOS. I have no link to tutorial on this, but a few ideas to propose. Help user start Usually, on the first view, user has to select some action (in general, tapping a button). You could flash this button after a few seconds if user has not tapped anything, to attract its attention. Provide a help button on each page, with a short message, possibly spoken to avoid fastidious reading.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Fetch Core Data Issue
The reason I have a loop is because I want to define all the objects in my array called prefArr as saveFav when the save button is pressed and I try to save them to the context. OK, but you create a single instance. Why don't you create in the loop ? Code could become like this:  @IBAction func save(_ sender: UIBarButtonItem) {     // -->> NOT HERE var saveFav = CurrentPlayers(context: context)     // Assign values to the entity's properties     for o in prefArr { var saveFav = CurrentPlayers(context: context) // <<-- Create a new instance each time here      saveFav.yahooName = o.yahooName      saveFav.team = o.team      saveFav.position = o.position      saveFav.photoUrl = o.photoUrl      // To save the new entity to the persistent store, call save on the context       do { // <<-- Save each        try context.save()        fetchSave() // Not sure it is needed      print("This is my saved object: \(saveFav)")       } catch {        print(error)      }     }   }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to PDFKit unable to load PDF
Why did you comment out:              //pdfView = PDFKitRepresentedView(pdfData)
Replies
Boosts
Views
Activity
Aug ’21
Reply to Is SwiftUI usable?
This is just a personal opinion. But I'm not comfortable to develop app (Mac or iOS) with SwiftUI. Because of maturity and because of what I perceive as a lack of flexibility. It is really impressive on demo projects, but not on full scale large app. In addition, I find that programming the UI in code is a major step backward… Once again, just a personal opinion.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21