Search results for

calendar

1,863 results found

Post

Replies

Boosts

Views

Activity

Reply to .chartXScale not scaling domain of Chart as expected
[quote='795150022, AppleCare Staff, /thread/759244?answerId=795150022#795150022'] So just a few lines of code would be enough, I think it should fit in 20 lines or less. For data, you can inline an array of tuples as I described. No need for preview, extensions, structs etc. just a single Chart. [/quote] Apologies, I thought perhaps an example with a Preview would be beneficial for demonstration purposes. I'm happy to reduce the amount of code a bit. No more extra structs, previews or extensions! However, I can't really get it down to 20 lines if I am to simulate my issue. I need a month of measurements and I'm not sure I can even create the array of ~30 items (with plenty of Calendar.current operations) in 20 lines of code. I hope about 40 lines of code is okay! let cal: Calendar = .current struct ChartWithNilValues2: View { let start: Date = cal.date(from: cal.dateComponents([.year, .month], from: .now))! let end: Date init() { end = cal.date(byAdding: .month, value: 1, to: start)! } var body: some
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to .chartXScale not scaling domain of Chart as expected
[quote='794978022, AppleCare Staff, /thread/759244?answerId=794978022#794978022'] No need for an entire repo, just a minimal, but runnable example that exhibits the issue. [/quote] Alright! This should do: import SwiftUI import Charts struct ChartWithoutNilValues: View { let firstDayOfMonth: Date let firstDayOfNextMonth: Date let measurements: [PerformanceMeasurement] init() { firstDayOfMonth = Date.now.firstDayOfMonth()! firstDayOfNextMonth = Calendar.current.date(byAdding: .month, value: 1, to: firstDayOfMonth)! measurements = DataGenerator.generateMeasurements( interval: DateInterval(start: firstDayOfMonth, end: firstDayOfNextMonth), component: .day ) } var body: some View { Chart(measurements, id: .timestamp) { measurement in BarMark( x: .value( Timestamp, measurement.timestamp, unit: .weekOfYear, calendar: .current ), y: .value( Solar production, measurement.production?.total ?? 0 ) ) } .chartXAxis { AxisMarks(values: .stride(by: .weekOfYear)) { value in AxisValueLabel((value.index), centered: t
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
How to open Calendar app event's detail by its ID
Hey there, I'd like to ask for guidance on how to open the Apple Calendar app's event programmatically. I can already list events, but I'm struggling to open the calendar detail view (upon user interaction). I've tried many variants, such as using the x-apple-calevent URL scheme or calshow:, etc., but none of them worked. Here's the code I'm using: if let eventIdentifier = event.eventIdentifier as String?, let calendarId = event.calendarId as String? { if let url = URL(string: x-apple-calevent://(calendarId)/(eventIdentifier)) { NSWorkspace.shared.open(url) } } Once the action is triggered, it tells me that: There is no application set to open the URL x-apple-calevent://909114A0-6352-47DB-B70E-2770H7D5B6D3:7q50iih7fvbio3qipk5m7osjig@google.com Thanks a bunch! Tom
1
0
1.3k
Jul ’24
Reply to How to open Calendar app event's detail by its ID
To open the Apple Calendar app's event detail view programmatically, you can use the EventKit framework. In my investigation observed there isn't a direct URL scheme to open a specific event in the Calendar app. Instead, you can open the Calendar app and focus on the date of the event. let eventStore = EKEventStore() eventStore.requestAccess(to: .event) { (granted, error) in if granted { let event = eventStore.event(withIdentifier: your_event_identifier) if let event = event { DispatchQueue.main.async { let eventViewController = EKEventViewController() eventViewController.event = event eventViewController.allowsEditing = true eventViewController.allowsCalendarPreview = true if let viewController = UIApplication.shared.keyWindow?.rootViewController { let navigationController = UINavigationController(rootViewController: eventViewController) viewController.present(navigationController, animated: true, completion: nil) } } } else { print(not found) } } else { print(denied) } } Make sure
Topic: App & System Services SubTopic: General Tags:
Jul ’24
Reply to Non-tinted image in complications using WidgetKit
Here's the code. I have a basic widget bundle @main struct TestWidgetBundle: WidgetBundle { var body: some Widget { TestCounterWidget() } } And a simple timeline entry struct TestEntry: TimelineEntry { var date: Date } My timeline provider doesn't do much for now either. struct TestTimelineProvider: TimelineProvider { typealias Entry = TestEntry func placeholder(in context: Context) -> TestEntry { TestEntry(date: .now) } func getSnapshot(in context: Context, completion: @escaping (TestEntry) -> Void) { let entry = TestEntry(date: .now) completion(entry) } func getTimeline(in context: Context, completion: @escaping (Timeline) -> Void) { let calendar = Calendar.current let currentDate = Date() let entries = [TestEntry(date: .now)] let timeline = Timeline(entries: entries, policy: .after(currentDate)) completion(timeline) } } and finally the widget struct TestCounterWidget: Widget { let kind: String = TestCounterWidget var body: some WidgetConfiguration { StaticConfiguration(kind: kind, provide
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to dateFromString results in nil
[formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:NSCalendarIdentifierGregorian]]; This creates a locale with a calendar identifier. That makes no sense. If you’re using an NSDateFormatter with a fixed format, you must pin the locale to en_US_POSIX. See QA1480 NSDateFormatter and Internet Dates for the full backstory. Also, you’re parsing a date without a time component. That’s trickier than you might think. See Parsing Dates Without Times. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Programming Languages SubTopic: General Tags:
Jul ’24
Screen Time | How to enable/disable screen time for a game app by setting start and end times?
try center.startMonitoring(.daily, during: schedule) let schedule = DeviceActivitySchedule( intervalStart: DateComponents(calendar: Calendar.current ,hour: 20, minute: 0), intervalEnd: DateComponents(calendar: Calendar.current ,hour: 22, minute: 59), repeats: true, warningTime: nil ) extension DeviceActivityName { static let daily = Self(daily) }
1
0
431
Jul ’24
Refresh Calendars - not available without iCloud!?!?
Very frustrating... This is not specifically related to the beta, this is in the general Sierra 10.12.3 release as well, but it is not fixed in the beta either...I upgraded several users to Sierra only to find out that they could no longer refresh their subscribed calendars (webcal://) using the Refresh Calendars under the View menu, as it was greyed out. After getting so frustrated and wiping everything out with a clean install of Sierra, I see this is the case even on a brand new install, so it has nothing to do with the fact they were upgraded.It seems Refresh Calendars is not available to select UNLESS you have iCloud Calendars turned ON. Well, we don't want that, we don't use that, and I don't want to create iCloud accounts for all the users in the first place. This functionality worked fine in El Capitan, why was it broken in Sierra?The only way to refresh them is to quit and restart the app!?!? {SIGH}I am reporitng it here, and maybe will do the same in the General f
1
0
789
Mar ’17
What are some other actionable items I can do, so that I can get through "Guideline 4.3(a) - Design - Spam" app update rejection?
I have an app which is in the app store since 2022. It is an app with combined features of note taking, todo list and calendar. My most recent app update is rejected with the following message. Guideline 4.3(a) - Design - Spam We noticed your app shares a similar binary, metadata, and/or concept as apps submitted to the App Store by other developers, with only minor differences. Submitting similar or repackaged apps is a form of spam that creates clutter and makes it difficult for users to discover new apps. Next Steps Since we do not accept spam apps on the App Store, we encourage you to review your app concept and submit a unique app with distinct content and functionality. Resources Some factors that contribute to a spam rejection may include: Submitting an app with the same source code or assets as other apps already submitted to the App Store Creating and submitting multiple similar apps using a repackaged app template Purchasing an app template with problematic code from a third party Submittin
2
0
1.2k
Aug ’24
Reply to The DateFormatter is returning wrong date format 2024-04-23T7:52:49.352 AMZ, 2024-05-23T11:16:24.706 a.m.Z
Right. They have almost certainly overridden the default 12-/24-hour setting for their locale, which is one of the two most common causes of problems like this (they other being to choose a non-Gregorian calendar). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
Swift Charts animation woes using centered AxisValueLabel
Hi, I'm having some trouble when animating my chart with a custom AxisValueLabel. Specifically, as soon as I set its init parameter centered to true, the x axis' leftmost value of the previous dataset sticks around during the animation to the next dataset. Here's a GIF of a screen recording from a minimum reproducible example I built. Keep a close eye on the x axis of the third BarMark, and notice how the 0 from the first BarMark sticks around longer than necessary / intended. While it isn't visible in the GIF, the extra 0 eventually does disappear, but only after the transition if fully complete, making the animation feel distracting and amateur-ish, rather than smooth. This is my code for the x axis. If I turn centered to false, this problem immediately goes away. .chartXAxis { AxisMarks( preset: .aligned, values: .stride( by: .day, count: 1, calendar: .current ) ) { value in AxisValueLabel(centered: true) { Text((value.index)) } } } As you might be able to tell, my x axis is date based, and I'm wo
2
0
723
Jun ’24
Reply to App developerment costs
What is an App? An application, or app for short, is a software application made to carry out particular functions on computers, tablets, and smartphone platforms. Apps can be used for a variety of things, such as productivity and utility, social networking, and entertainment. Usually, people may download and install them with ease via app stores like Google Play or Apple's App Store. Applications can be web-based and accessed via web browsers, or native, designed for a particular operating system. By providing specialised features, they improve the functionality of gadgets and frequently increase efficiency and user experience. The increasing use of mobile technology has made applications essential to both daily life and commercial operations. What are Some Different Types of Apps? Apps are available in many different formats, each with a distinct purpose and user requirement in mind. They might be as basic as productivity-boosting gadgets or as sophisticated as social media platforms or entertainment servic
Jun ’24
Reply to How to set timeFormat of DatePicker in swift
[quote='789352022, BabyJ, /thread/756212?answerId=789352022#789352022, /profile/BabyJ'] So you're not using SwiftUI. You should probably place this post in the UIKit topic instead so it's less confusing. ‎ In UIKit above property isn't available I believe UIDatePicker has a locale property that you can assign a custom locale to. It will do the same as the SwiftUI solution. If this doesn't work, or you have already tried it, then you need to provide more context and the code you are using so we can understand what is going on. 0 comments [/quote] yes, but if i set custom locale us_POSIX locale for 12 hour and us_GB for 24 hour format. working fine in device use gregorian calendar else datePicker year not showing properly in month & year section like when i use japanese calendar year shows 6 instead of Reiwa 6
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’24
How to set timeFormat of DatePicker in swift
DatePicker always get timeFormat from device setting, but i need to show time in datePicker based on My app setting not device setting. any solution for this problem I tried to set locale us_POSIX locale for 12 hour and us_GB for 24 hour format this way is work in gregorian calendar , but in japanese calendar not showing year properly like (picker showing 6 instead of Reiwa 6 )
4
0
1k
Jun ’24