Search results for

calendar

1,869 results found

Post

Replies

Boosts

Views

Activity

Error on main view implementing List
Hello, I don't know why I'm getting the error Failed to produce diagnostic for expression, I have use the List before on a similar way and can't find the error. I'll appreciate some help Working with Xcode 12.5.1 If I Change the List to this it works: List(1 ..< 6) { mood in HStack { Text(Hola) .frame(width: 200, height: 50, alignment: .leading) } } MoodScreen.swift import SwiftUI struct MoodScreen: View { @State private var addMoodModal = false var body: some View { VStack { VStack { MoodView(addMoodModal: $addMoodModal) .sheet(isPresented: $addMoodModal, content: { AddNewMoodScreen(addMoodModal: $addMoodModal) }) MoodListView() Spacer() } } .navigationTitle(Mood summary) .embedInNavigationView() } } struct MoodScreen_Previews: PreviewProvider { static var previews: some View { MoodScreen() } } MoodListView.swift import SwiftUI struct MoodListView: View { @ObservedObject var moodsScreen = MoodsViewModel() var body: some View { //Error is shown here VStack{ List(moodsScreen.moodsVM) {mood in HStack { Text(
1
0
664
Sep ’21
Reply to UIImage.init - imageLiteralResourceName crashing during App review
So, I assume you use some code like this: func getCurrrentDayNumber() -> String { let currentDateTime = Date(); let formatter = DateFormatter(); formatter.timeStyle = .none; formatter.dateStyle = .long; let dateTimeString = formatter.string(from: currentDateTime); var dayNumber = dateTimeString.split(separator: ); dayNumber = dayNumber[1].split(separator: ,); return String(dayNumber[0]); } Frankly saying, this is a super bad implementation to get the day number (1...31). I do not know which languages your app would support, but your getCurrrentDayNumber() returns August when region is set to United Kingdom even when Language is set to en. I believe that would cause the error you described. Please try something like this: func getCurrrentDayNumber() -> String { let currentDateTime = Date() var gregorianCalendar = Calendar(identifier: .gregorian) gregorianCalendar.timeZone = TimeZone.current let dateComponents = gregorianCalendar.dateComponents([.day], from: currentDateTime) return String(dateCo
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
How to create US Central timezone in Swift?
The server I'm working with returns a date/time string that is always expressed in US central time. There is no timezone information in the string itself. In order to parse this string, I need to create a DateFormatter and then assign its timeZone property. I'm having trouble figuring out the right way to do this. I know that the correct string that means US central time is America/Chicago, but it appears that the TimeZone initializer is looking for an abbreviation, rather than a full string. I don't know what the correct abbreviation is. I don't want to use CST or CDT since those denote standard or daylight time. I need something that means whatever the current timzeone is in Chicago. In Java, as an example, the Timezone class accepts America/Chicago as an initializer and it works whether or not the calendar is on daylight savings time. Thanks, Frank
2
0
1.8k
Aug ’21
Apple arbitrarily deletes the newly created developer account, there is no complaint, what should we do?
Apple arbitrarily deletes the newly created developer account, there is no complaint, what should we do?Not long ago, a new developer account was created for $99; then a new project was created; the project code was written by myself, and was rejected several times during the period. The last time the App Store review member called me to confirm whether my problem was solved. I said that the previous problem has been solved, and then told me to wait for the result; I waited for about 4 days, that is, December 20th, 12:09; sent me the rejected information of the account mark deletion;Hello,Upon further review of the activity associated with your Apple Developer Program membership, we have determined that your membership, or a membership associated with your account, has been used for dishonest or fraudulent activity. Therefore, your Apple Developer Program account has been flagged for removal.If you would like to appeal this termination to the App Review Board, you must do so within 14 calendar days.
31
0
19k
Aug ’21
Add event to iCal API with link?
Hi, I'm a software developer. I have a web application where users receive event invitations via email. In the email, I would like to have an iCal Calendar icon that when a user clicks it, it opens up the Create Event page within their Calendar. And it would be populated with the data passed in the URL parameters like event start and end date, timezone, title, description, Link to the event, etc. I have already done this with Google Calendar and Outlook Calendar. For example, the Google API URL looks something like this: Add to my calendar Does apple have a link similar this? Or is the only way to create an .ics file and have the User download and import it into their Calendar?
1
0
2.5k
Aug ’21
DateComponents configuration for x months
I'm writing an app that needs to present repeating notifications on a schedule. The schedule will be every x months, where x is a number 1-72. So, it could be every 1 month, every 7 months, every 45 months, etc.. This is my first venture into user notifications, and I'm struggling with the DateComponents piece. I see the documentation says DateComponents.month = a month or count of months. I interpret that to mean that the value could be an Int to represent a specific month (like 1 = January) or an Int to represent the number of months used for repetition (ex: 2 = every 2 months). For my test, I wanted to manually create a user notification trigger that would repeat every 1 month on the first day of the month at 7:00am. var dateComponents = DateComponents() dateComponents.calendar = Calendar.current dateComponents.month = 1 dateComponents.day = 1 dateComponents.hour = 7 let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true) That didn't work as expected. It created the notific
4
0
1.4k
Aug ’21
Reply to Big Sur panic when connect/disconnect usb-c dock
Today I was working at the office and I got a new kernel panic while reconnecting my USB-C dock: panic(cpu 1 caller 0xfffffff00efe8d90): x86 CPU CATERR detected Debugger message: panic Memory ID: 0x6 OS release type: User OS version: 19P50284g macOS version: 20G95 Kernel version: Darwin Kernel Version 21.0.0: Sun Jun 20 18:32:24 PDT 2021; root:xnu-8011.0.0.121.4~1/RELEASE_ARM64_T8010 Kernel UUID: 46970279-CCEF-30AD-822F-1A1053068BC2 iBoot version: iBoot-7429.0.133.121.1 secure boot?: YES x86 EFI Boot State: 0x16 x86 System State: 0x0 x86 Power State: 0x0 x86 Shutdown Cause: 0xec x86 Previous Power Transitions: 0x10001000100 PCIeUp link state: 0x89473611 Paniclog version: 13 Kernel slide: 0x0000000006fa4000 Kernel text base: 0xfffffff00dfa8000 mach_absolute_time: 0x864ad301482 Epoch Time: sec usec Boot : 0x61155c50 0x000b0ffb Sleep : 0x611b8616 0x00045947 Wake : 0x611b8787 0x00089b09 Calendar: 0x611bd3e6 0x000d5c26 CORE 0: PC=0xfffffff00e8aa138, LR=0xfffffff00e7a685c, FP=0xffffffeb0ee63ee0 CORE 1 is t
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to DateComponents configuration for x months
I see the documentation says DateComponents.month = a month or count of months. Where exactly did you read this ? You may misinterpret it. AFAIU, this means that month may be the month value or a number of months to add to a date Day, week, weekday, month, and year numbers are generally 1-based, but there may be calendar-specific exceptions. Ordinal numbers, where they occur, are 1-based. Some calendars may have to map their basic unit concepts into the year/month/week/day/… nomenclature. The particular values of the unit are defined by each calendar and are not necessarily consistent with values for that unit in another calendar. Listing 4 shows how you can create a date components object that you can use to create the date where the year unit is 2004, the month unit is 5, and the day unit is 6 (in the Gregorian calendar this is May 6th, 2004). You can also use it to add 2004 year units, 5 month units, and 6 day units to an existing date. The value of weekday is u
Aug ’21
Reply to Running Background Tasks
If I may, I have similar situations that would like to ask. I want to be able to execute some codes from background task whenever there are changes in Eventstore (calendar/reminder). I need to update data in my app (and my widget) when this change happen. How can I do this? I can't figure out how to listen to notification from Eventstore in the background. Thank you very much, Boon
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to DateFormat
let dateFormatter = DateFormatter() dateFormatter.calendar = Calendar.current dateFormatter.dateFormat = dd.MM.yyyy Do not write code like this. The problem here is that you’re using the current calendar, which may not be Gregorian, and thus you may get results that are wildly wrong. See QA1480 NSDateFormatter and Internet Dates for a concrete example of how this can end badly. You have two choices here: If you’re working with a fixed-format date — for example, parsing a date that’s returned from a server — either pin the locale to en_US_POSIX (see QA1480) or use NSISO8601DateFormatter. If you’re working with a localised date — one that you display to the user — either set the dateStyle to one of the standard styles or call setLocalizedDateFormatFromTemplate(_:). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: General Tags:
Aug ’21
Reply to How to compare dates from two view controllers (Core Data and Swift)?
Code is not formatted in comments, making it hard ro read. 1. let model = Calendar(context: context) 2. print(model.dateSaved) 3. if model.dateSaved == dateFromFirstView { 4. print(dates are identical ,model.dateSaved, ,dateFromFirstView) 5. } else { 6. print(dates are not identical ,model.dateSaved, ,dateFromFirstView) 7. } 8. 9. @IBAction func datePickerChanged(_ sender: Any) { 10. let dateFormatter = DateFormatter() 11. dateFormatter.dateFormat = dd-MM-YYYY 12. dateFromFirstView = dateFormatter.string(from: datePicker.date) 13. } 14. 15. @IBAction func datePickerChanged(_ sender: Any) { 16. let dateFormatter = DateFormatter() 17. dateFormatter.dateFormat = dd-MM-YYYY 18. strDate = dateFormatter.string(from: datePicker.date) 19. print(strDate) 20. } So model is a variable for the Entity, dateSaved is an attribute of the entity and it is a string (as I use a date formatter that converts the date from a date picker into a string). dateFromFirstView is also a string. The thing is that I added a print
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21