Automationscribe.com
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automation Scribe
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automationscribe.com
No Result
View All Result

The Step-by-Step Strategy of Including a New Function to My IOS App with Cursor

admin by admin
December 5, 2025
in Artificial Intelligence
0
The Step-by-Step Strategy of Including a New Function to My IOS App with Cursor
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


I vibe-coding to create web sites and IOS apps. I have already got two apps stay on the App Retailer.

My first app was Brush Tracker, which helps you observe your every day brushing habits, keep constant, and preserve your tooth clear by small motivational nudges. I additionally wrote an article on all the strategy of constructing the app and delivery it to the App Retailer.

Just lately, I made a decision so as to add a brand new function to Brush Tracker: a calendar-like grid that reveals the person’s month-to-month brushing consistency. On this article, I’ll stroll you thru how I carried out this function utilizing Cursor and some handbook changes I made.

Preliminary immediate

What I had in thoughts was just like the grids you see in habit-tracking apps or the contribution graph on GitHub.

I began with the Plan Mode of Cursor, which I’ve discovered extremely environment friendly when including a brand new function or making a giant change. You outline the function or clarify the duty and Cursor generates an in depth implementation plan.

Right here is the precise immediate I used within the Plan Mode to get began:

I need to add a calendar-like grid to trace days person full brushings. Make the grid with squares the place every sq. represents a day in a month. The preliminary state of the squares within the grid are black. Paint the sq. with inexperienced if the person completes all of the brushings, with gentle inexperienced if the person partially full the brushings. For instance, person units the every day brushings depend as 2. In the event that they full one brushing in a day, the sq. needs to be gentle inexperienced. In the event that they full two brushings in day, the sq. for that day needs to be inexperienced. The grid needs to be accessible by urgent a calendar icon on the highest left of the display.

Cursor requested me two inquiries to make clear some particulars earlier than finalizing the implementation plan. I actually preferred this step as a result of it’s reassuring to see Cursor search clarification as a substitute of creating assumptions by itself.

The 2 questions Cursor requested:

  • Ought to the calendar grid present solely the present month, or enable navigation between months?
  • Ought to we begin monitoring from at this time ahead, or additionally present previous days (which might be black)?

I instructed Cursor to permit navigation between months and to show the earlier days of the month in black. Then, Cursor created a markdown file outlining an in depth implementation plan.

The plan explains intimately how the function will probably be carried out and likewise features a checklist of actionable todo objects.

Cursor’s TODO objects:

  • Prolong BrushModel to trace historic every day brushing information with persistence
  • Create CalendarGridView part with month grid and color-coded squares
  • Add calendar icon button to high left of ContentView
  • Combine CalendarGridView with ContentView utilizing sheet presentation

Subsequent, I requested Cursor to implement the plan. It additionally permits for modifying the plan earlier than execution, however I wished to stay with Cursor’s unique define as-is.

The implementation labored on the very first attempt, and I used to be in a position to check the function instantly within the Xcode simulator. Nonetheless, the design was horrible:

Observe: All pictures used on this article embrace screenshots from my app, Brush Tracker.

Xcode simulator not contains date and time settings, so I modified the system date on my Mac to check how the grid colours up to date throughout totally different days.

I didn’t like this fashion in any respect. So I requested Cursor to revamp the grid utilizing the next immediate:

We have to change the design of the grid. What I take note of is one thing like Github contributions grid. Additionally, don’t present the day values within the squares representing days.

This immediate didn’t work as I’d hoped. The one change it made was eradicating the day numbers:

Subsequent, I shared a pattern picture of the grid fashion I need and requested Cursor to make the same design.

The brand new design was nearer to what I had in thoughts but it surely had structural points. The squares have been too small and didn’t scale nicely throughout the format:

So there are two essential issues with this design:

  1. Every month comprises 42 squares (not representing the times in any month).
  2. Squares are too small.

I requested Cursor to repair the primary downside with this immediate:

Within the present implementation, there are 42 squares in November and December. Squares within the grid symbolize days in a month so the variety of squares should be equal to the variety of days in that month.

The opposite downside was less complicated and I may resolve it by adjusting some parameter values. For example, the dimensions of the squares within the grid might be modified by the squareSize parameter:

struct DaySquare: View {
    let isToday: Bool
    let isCurrentMonth: Bool
    let brushCount: Int
    let brushesPerDay: Int
    
    personal let squareSize: CGFloat = 8 // change this parameter

Right here is how the grid takes care of I modified the sq. measurement to 32:

The opposite downside that could possibly be solved by adjusting parameter values is the padding between rows.

Within the screenshot above, there appears to be no area between rows. This may be modified by growing padding between rows.

I additionally need to have 8 squares (i.e. days) in a row and alter the area between rows.

All of those might be finished within the following code snippet:

            // Calendar grid - smaller GitHub fashion
            LazyVGrid(columns: Array(repeating: GridItem(.versatile(), spacing: 0.2), depend: 8), spacing: 0) {
                ForEach(Array(calendarDays.enumerated()), id: .offset) { index, dayInfo in
                    DaySquare(
                        isToday: dayInfo.isToday,
                        isCurrentMonth: dayInfo.isCurrentMonth,
                        brushCount: dayInfo.brushCount,
                        brushesPerDay: mannequin.brushesPerDay,
                        measurement: 32
                    )
                    .padding(.backside, 3)
                }
            }
  • spacing controls the area between squares in a row
  • padding controls the area between rows
  • depend controls the variety of squares in a row

After taking part in round with these parameter values within the code snippet above, I received the next grid:

If the person completes all brushings in a day, she will get a brilliant inexperienced. In case of partial completion, the sq. for that day is coloured with pale inexperienced. The opposite days are proven in black and the present day is indicated with a white body.

After implementing the function to maintain observe of previous days, it appeared pure so as to add notifications for streaks. I requested Cursor to do that utilizing the next immediate:

Add notifications for when the person accomplished all brushings for 10, 20, and 30 days. Additionally, add a month notification for when the person completes all days in a month. Notifications needs to be encouraging and motivating.

The grid I created just isn’t one of the best design but it surely’s adequate to ship the message. When a person appears at this grid, she instantly will get an concept of her tooth brushing frequency.

With the assistance of Cursor and a few handbook tweaks, I used to be in a position to implement and ship this function in a number of hours. On the time of writing this text, this model remains to be in App Retailer overview. By the point you learn the article, it could be distributed. Right here is the App Retailer hyperlink to Brush Tracker if you happen to’d like to check out it or check out the app.

Thanks for studying! When you’ve got any suggestions in regards to the article or the app, I’d love to listen to your ideas.

Tags: addingAppCursorFeatureIOSprocessStepbyStep
Previous Post

Sensible implementation concerns to shut the AI worth hole

Next Post

Introducing bidirectional streaming for real-time inference on Amazon SageMaker AI

Next Post
Introducing bidirectional streaming for real-time inference on Amazon SageMaker AI

Introducing bidirectional streaming for real-time inference on Amazon SageMaker AI

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular News

  • Greatest practices for Amazon SageMaker HyperPod activity governance

    Greatest practices for Amazon SageMaker HyperPod activity governance

    405 shares
    Share 162 Tweet 101
  • Optimizing Mixtral 8x7B on Amazon SageMaker with AWS Inferentia2

    403 shares
    Share 161 Tweet 101
  • The Good-Sufficient Fact | In direction of Knowledge Science

    403 shares
    Share 161 Tweet 101
  • How Aviva constructed a scalable, safe, and dependable MLOps platform utilizing Amazon SageMaker

    402 shares
    Share 161 Tweet 101
  • The Journey from Jupyter to Programmer: A Fast-Begin Information

    402 shares
    Share 161 Tweet 101

About Us

Automation Scribe is your go-to site for easy-to-understand Artificial Intelligence (AI) articles. Discover insights on AI tools, AI Scribe, and more. Stay updated with the latest advancements in AI technology. Dive into the world of automation with simplified explanations and informative content. Visit us today!

Category

  • AI Scribe
  • AI Tools
  • Artificial Intelligence

Recent Posts

  • Spectral Neighborhood Detection in Scientific Data Graphs
  • How Harmonic Safety improved their data-leakage detection system with low-latency fine-tuned fashions utilizing Amazon SageMaker, Amazon Bedrock, and Amazon Nova Professional
  • 3 Delicate Methods Information Leakage Can Smash Your Fashions (and Methods to Forestall It)
  • Home
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

© 2024 automationscribe.com. All rights reserved.

No Result
View All Result
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us

© 2024 automationscribe.com. All rights reserved.