Post

Replies

Boosts

Views

Activity

Reply to How to scroll UICollectionView cell automatically according to the time of day
Here my code for the Local Notification : let center = UNUserNotificationCenter.current()         let content = UNMutableNotificationContent()         content.title = NSString.localizedUserNotificationString(forKey: "New Notif", arguments: nil)         content.body = NSString.localizedUserNotificationString(forKey: "empty", arguments: nil)         content.badge = 1         var date = DateComponents()         date.hour = 8         date.minute = 00         date.timeZone = TimeZone.current         let trigger = UNCalendarNotificationTrigger(dateMatching: date, repeats: true)         let uuidString = UUID().uuidString         let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)         center.add(request) { (error) in             if error != nil {                 print("Error \(String(describing: error?.localizedDescription))")             } else {                 print("✅ ✅ ✅ Send !")             }         } `
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
Here my code for the Local Notification : let center = UNUserNotificationCenter.current()         let content = UNMutableNotificationContent()         content.title = NSString.localizedUserNotificationString(forKey: "New Notif", arguments: nil)         content.body = NSString.localizedUserNotificationString(forKey: "empty", arguments: nil)         content.badge = 1         var date = DateComponents()         date.hour = 8         date.minute = 00         date.timeZone = TimeZone.current         let trigger = UNCalendarNotificationTrigger(dateMatching: date, repeats: true)         let uuidString = UUID().uuidString         let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)         center.add(request) { (error) in             if error != nil {                 print("Error \(String(describing: error?.localizedDescription))")             } else {                 print("✅ ✅ ✅ Send !")             }         } `
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
excuse me. I meant, when the user launches the application, I want to have the cell that corresponds to the time of the next bus. Do you understand better like this?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21