Basically I need a view with a calendar that will show data attributes from the item. I've tried two different approaches both have their listed problems. There must be a better way to do something like this. Surely it's not ideal to create a new item every time a date is opened or constantly check if something is there, but I don't know any other way. Actual View: import SwiftUI import CoreData struct ContentView: View { @Environment(.managedObjectContext) var managedObjContext @Environment(.calendar) var calenda @Environment(.dismiss) var dismiss @FetchRequest(sortDescriptors: [], predicate: NSPredicate(format: timestamp == %@, Date.now as CVarArg)) var items: FetchedResults @State private var date = Date.now var body: some View { NavigationView{ VStack{ DatePicker(Calendar, selection: $date, in: Date.now...,displayedComponents: [.date]) .datePickerStyle(.graphical) .onAppear(perform: { if (items.isEmpty){ PersistenceController().addItem(date: date, context: managedObjContext) } }
Search results for
calendar
1,863 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
We were seeing something similar to this. The new calendar did persist sometimes, but other times our users would lose the calendar and all events entered in it. It was not easily/reliably reproducible.In the end, we decided to just direct users to the iOS Calendar app to create new calendars, but this is far from ideal.The fact that the iOS Calendar app can do it reliably, and we couldn't however does seem to imply that we're doing something wrong, because both probably use the same API to create the calendars (of course this is not certain because Apple's apps do have access to much more functionality).Did you come up with a solution?
Topic:
App & System Services
SubTopic:
General
Tags:
I need to be able to set calendar events to exact minutes like 6:23, as school classes and jewish holidays both begin and end at exact minutes. Currently when creating an event you only have the option to choose a time rounded to the nearest 5 minutes, is there a way to change that?
This is my solution. I didn't take into account any error catching, but I put the variables in for if it was needed.func checkCalendar() -> EKCalendar { var retCal: EKCalendar? let calendars = eventStore.calendarsForEntityType(EKEntityTypeEvent) as! [EKCalendar] // Grab every calendar the user has var exists: Bool = false for calendar in calendars { // Search all these calendars if calendar.title == Auto Schedule Cal { exists = true retCal = calendar } } var err : NSError? if !exists { let newCalendar = EKCalendar(forEntityType:EKEntityTypeEvent, eventStore:eventStore) newCalendar.title=Auto Schedule Cal newCalendar.source = eventStore.defaultCalendarForNewEvents.source eventStore.saveCalendar(newCalendar, commit:true, error:&err) retCal = newCalendar } return retCal! }This functions searches for a calendar named Auto Schedule Cal. If it doesn't find it, it creates one. It then returns the calender for use.Usage:(Given an EKEventStore title
Topic:
App & System Services
SubTopic:
General
Tags:
I'm using an URL Scheme like this:let interval = date.timeIntervalSinceReferenceDate let scheme = URL(string: calshow:(interval)) UIApplication.shared.open(url, options: [:], completionHandler: nil)This should open the system Calendar app on the determined date. However, when I first open the app, it starts on the correct date and then automatically changes back to the current date. Then, the next time I call this url it starts correctly and stays on the selected date.It looks like a bug, does anyone have a solution?
Hi,I am developing an app that updates data(recent photos, calendar events) to local DB when the app is in the background.I think my app could fall into the Background fetch category since it is in fact obtaining useful info in a periodic basis.Am I thinking correctly?
My iOS app get access to Calendars on iPhone and iPad (iOS 17) bey when running on Mac (designed for iPad) the app gets the .notDetermined authorizationStatus after a call to EKEventStore.authorizationStatus(for: .event). What should I do so that my App gain access to Calendars ?
When testing some code which parses an Iso8601 duration string and generates a TimeInterval, I came across some interesting behavior, which I take to be bug, but I may have missed some setup which would set things right. The short of it... Given the Iso8601 duration string, e.g., P10675199DT2H48M5.4775 which has been parsed into DateComponents, use Calendar.current.date(byAdding:to:) to get a future date. When futureDate.timeIntervalSince(currentDate) is calculated, the interval returned MAY be different from the result of a manual calculation - off by one hour, or incorrect fractional seconds. The inital test was run using a number-of-days value for ~30k yrs. However, using other, smaller values can produce errors as well. Copy/Paste the following code into a playground to check me. Anyone know what might be happenging?import Cocoa var str = Hello, playground // Given the Iso8601 duration string P10675199DT2H48M5.4775 (Yeah, made up for testing. Who really cares about a duration of ~30k yrs. Yikes!) let nano
Google calendar might take some time to sync the change. After doing this, try refreshing the phone calendar and then the Mac calendar. If after some time the change does not sync, please file a feedback request so we can investigate if this is a bug.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Something like thislet now = Date() let calendar = Calendar.current let year = calendar.component(.year, from: now) let month = calendar.component(.month, from: now) let day = calendar.component(.day, from: now) let beginDate = DateComponents(calendar: calendar, timeZone: .current, year: year, month: month, day: day, hour: 13, minute: 0) let endDate = DateComponents(calendar: calendar, year: year, month: month, day: day, hour: 15, minute: 0)
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Hi,One of my applications needs calendar synchronization. Events are added to the email ID from server end.There are two options for us.1. Synch Google Calendar with iPhone calendar2. Try to find get users apple ID (from settings - we assume as it is already synched with iPhone calendar) programatically using swift 3.0 and add events to that ID.Drawback of Google Calendar Sync:Users of this application is registered with our server with different email Id's other than Google. We need to cover all the users. At the same time we dont want user to do any manual action from their side in order to perform perform. Few manual actions which we discovered are: creating Google calendar account using existing email ID, once Google calendar account is created then add this accout to the Settings->Calendar->Accounts->Add Account->Other->Add CalDav Account-> (Giver server, Username, Password, description here).Thus we are thinking to fetch us
Doc states:https://developer.apple.com/documentation/foundation/calendar/2292848-shortweekdaysymbolsBy default, Calendars have no locale set. If you wish to receive a localized answer, be sure to set the locale property first - most likely to Locale.autoupdatingCurrent.I did the following: var calendar = Calendar(identifier: .gregorian) calendar.locale = NSLocale(localeIdentifier: fr_FR) as Locale print(calendar.shortWeekdaySymbols)To get[dim., lun., mar., mer., jeu., ven., sam.]
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
I am working on an app that lets a user look up a location on a map and then create an event in their calendar, adding the address/GPS data to the event. My question is, are we allowed to add address/GPS locations returned from MKLocalSearch to a users calendar? I am wondering because of Apple Maps usage agreement, which states: You must not access or use the Service in any manner that attempts to copy, extract, scrape or reutilize any portions of the data or content provided by the Service, including bulk downloads or feeds of map data or imagery, or the creation of any databases based upon results from the Service http://www.apple.com/legal/internet-services/maps/terms-en.html I asked a similar question to the Yelp team about their data (which has similar terms) and they said they only allow you to save the address to the calendar, not the GPS coordinates. I know Apple Maps uses Yelp data for some things, so I thought I would ask to check.
Fiscal Year 2016 Accounting Calendar September 27, 2015 to September 24, 2016In 'Payments and Financial Reports' click 'Create Reports'Click on the Date CalendarDown the bottom of the calendar view you will see 'View Fiscal Calendar'
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
When I add new Gmail account to my 2021 MBP with the M1 chip the Google calendar doesn't show up in the Calendar list. Works fine with the same OSX and Outlook version on an Intel Mac. Does anyone have a workaround?