Post

Replies

Boosts

Views

Activity

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 A question about use 'lowerThan' when I learning 'precedencegroup'
From your code, I do not see that ePrecedence is in a different module than dPrecedence. See the doc example: // module Swift precedencegroup Additive { higherThan: Range } precedencegroup Multiplicative { higherThan: Additive } // module A precedencegroup Equivalence { higherThan: Comparative lowerThan: Additive // possible, because Additive lies in another module } infix operator ~ : Equivalence 1 + 2 ~ 3 // same as (1 + 2) ~ 3, because Additive > Equivalence 1 * 2 ~ 3 // same as (1 * 2) ~ 3, because Multiplicative > Additive > Equivalence 1 < 2 ~ 3 // same as 1 < (2 ~ 3), because Equivalence > Comparative 1 += 2 ~ 3 // same as 1 += (2 ~ 3), because Equivalence > Comparative > Assignment 1 ... 2 ~ 3 // error, because Range and Equivalence are unrelated Note: names of groups should better start as UpperCase, like Dprecedence or DPrecedence.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21