I'm new to developing with SwiftUI and I created a Pomodoro app for macOS that runs in the menu bar. I added 4 animations and when the user selects the snow animation, it starts snowing on the screen. But the app uses 20%-30% of the CPU and has high energy consumption. I can't reduce it and I couldn't find a solution.
// snow animation
import SwiftUI
struct SnowflakeView: View {
@State private var flakeYPosition: CGFloat = -100
@State private var isAnimating = false
private let flakeSize: CGFloat = CGFloat.random(in: 10...30)
private let flakeColor: Color = Color(
red: Double.random(in: 0.8...1),
green: Double.random(in: 0.9...1),
blue: Double.random(in: 1...1),
opacity: Double.random(in: 0.6...0.8)
)
private let animationDuration: Double = Double.random(in: 1...3)
private let flakeXPosition: CGFloat = CGFloat.random(in: 0...310)
var body: some View {
Text("❄️")
.font(.system(size: flakeSize))
.foregroundColor(flakeColor)
.position(x: flakeXPosition, y: flakeYPosition)
.onAppear {
if !isAnimating {
withAnimation(Animation.linear(duration: animationDuration).repeatForever(autoreverses: false)) {
flakeYPosition = 280 + 50
}
isAnimating = true
}
}
}
}
I also have how I run the animation below.
ZStack {
ForEach(0..<10, id: \.self) { index in
if selectedAnimal == "Snow" {
SnowflakeView()
} else if selectedAnimal == "Rain" {
RainDropAnimation()
}else if selectedAnimal == "Leaf"{
LeafFallAnimation()
}else if selectedAnimal == "Confetti"{
ConfettiAnimation()
}
}
}
Create elegant and intuitive apps that integrate seamlessly with Apple platforms.
Post
Replies
Boosts
Views
Activity
This question came up, a customer wants to add payment, with gesture, to their app. This gesture is a swipe, from bottom to top (like when minimizing applications). The question immediately arose, will the application pass the review with such UI/UX ? Will there be any problems ? I'm not talking about problems when the user can minimize the application when paying, or pay (accidentally) when minimizing. I want to know if there will be any problems from Apple's rules when releasing the app ? I haven't found the exact information yet
I developed a watchOS app to capture gyro data, save it in real-time as a CSV file, and send it to an iOS app. However, when I start writing with the watch on, the screen dims, and it stops working. It only resumes operation when I tap the screen again.
Is there a way to let it run in the background and transmit files in real-time, even when the screen is off?
Error:App is ambiguous for type lookup in this context
code in UnqueHolidayApp
import SwiftUI
import RealmSwift
@main
struct UniqueHolidayApp: App {
init() {
migrateRealmIfNeeded()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
private func migrateRealmIfNeeded() {
let config = Realm.Configuration(
schemaVersion: 1,
migrationBlock: { migration, oldSchemaVersion in
if oldSchemaVersion < 1 {
// Realm will handle changes automatically for simple additions/removals
}
}
)
Realm.Configuration.defaultConfiguration = config
}
}
Hello everyone,
I just want to offer you image modifications that seem useful to get out of a version that has not evolved since the iPhone 3GS/4.
The addition of options without redesign after a few years creates a "kind of tidy mess".
I arrive from android having not had an iPhone since the 3GS, I am shocked to find the same interface as at the time. (I'm not criticizing, it's an observation).
And I'm surprised by the lack of some essential options such as the right back, the missing numeric line in the keyboard, or the missing Touch ID (I don't want to record my face).
So since I have been offering improvements to android and these applications, as well as play store applications, for years, and I love doing it, I naturally started thinking about Apple improvements.
I let you take part in these different ideas (in French, Google translation can translate the images if you wish).
Thank you all for your constructive opinions.
Best to you.
https://goopics.net/a/4r0fqeqw
I have an iOS App which looks great on iPhone, portrait only, which makes a lot of use of UITableViews.
On iPad those tables look stretched out in Landscape.
On MacOS with Apple Silicon the app can be resized to any size and the table views look very stretched. There are views in the App which users want to resize so limiting app size not an option.
I've been modifying the app's table views to limit their width and centre them using constraints.
This isn't easy, it's a lot of work as UITableViewController doesn't allow for constraining the table width. Or does it?
So I've changed them to UIViewControllers with UITableView imbedded in the root UIView with constraints. Looks really nice.
Now I've just run into the limitation that static tables, which I have a number of, aren't allowed to be embedded. So how can I limit the width of them?
I really don't want to add a lot of dynamic code.
Please tell me there's an simpler, more elegant method to what really makes a much more aesthetically pleasing UI on iOS App running on iPad and MacOS?
TIA!
The dividing lines of List Section overlap, which is uncomfortable to look at.
Look at the line under "Incomplete"
Hello Apple Developer Community,
I am encountering an issue with app icon rendering after updating an app on devices running iOS 18 or newer. Below are the details:
Issue Summary:
When updating an app from a previous version (with separate light and dark mode icons) to the latest version (where both modes use the same icon), the icon changes are not reflected consistently across all system menus.
Steps to Reproduce:
Set the device mode to Dark Mode.
Install the previous app version (with different icons for light and dark modes).
Update the app to the latest version (where both modes use the same icon).
Change the device mode to Light Mode.
Switch back to Dark Mode.
Expected Behavior:
The app icon should remain consistent across all system menus (Home Screen, Spotlight search, etc.) when switching between Light and Dark Modes.
Observed Behavior:
The app icon displays correctly on the Home Screen but inconsistencies appear in other menus, such as Spotlight search or when toggling between modes.
For instance, in Dark Mode, the icon may revert to the previous black-colored logo or display incorrectly compared to the updated design.
Additional Notes:
The asset catalog is configured correctly, with identical icons set for both light and dark modes in the latest app version.
Incrementing the build number was implemented during the update.
A manual device restart resolves the issue on some devices, but not consistently.
Questions for the Community:
Has anyone else experienced similar app icon caching or rendering issues in iOS 18 or later?
Are there known workarounds or specific configurations to ensure consistent icon rendering across all system menus?
Could this be related to iOS 18's icon caching or appearance handling mechanisms?
Your insights and suggestions would be greatly appreciated. Thank you for your time!
Hello,
I'm currently developing an emergency and security app for a client.
This app is designed to notify organisations and its users of emergency situations.
Our client has asked whether it’s possible to programmatically trigger the SOS Emergency feature on iOS.
Could you let me know if this functionality is available?
Many thanks!
Alex
Hi,
I am a new SwiftUI app developer and developing my first application. In the process of designing not very GUI rich app, I noticed my app crashed whenever I switched orientation (testing on multiple iPhone devices).
After going through all kind of logs and errors, performance enhancements nothing worked.
Then I started rolling back all GUI related features 1 by 1 and tested (I am sure there are better approaches, but excuse me I am novice in app development :) ).
Even though it's time consuming, I could pin point the cause of the fatal error and app crash, it's due to multiple .shadow modifiers I used on NavigationLink inside a ForEach look (to be precise I used it like following,
.shadow(radius: 15)
.shadow(radius: 20)
.shadow(radius: 20)
.shadow(radius: 20)
.shadow(radius: 20)
Note, there are only 7 items in List and it uses the Hero View (like app store's Today section) for child views.
Once I got rid of shadow modifies or used only 1 app works fine and doesn't crash.
Lesson learnt...
P.S.
It's so ironic that so performance tuned devices couldn't handle this basic GUI stuff.
Is there a way to revert back to the old designs? The new designs in iOS 18 are so bad and hard to use. I can’t imagine anyone actively tested this for user feedback before releasing.
This is my first day with IOS 18.1.1 and so far it’s smooth. my only problem is how chaotic the photos app has become during the update. For one, i dont like how to access any of the organization it’s at the way bottom and even after customizing and reorganizing there’s no way to to move that section to the top. i also dont like how all my photos are just out on front street when the app is launched, it makes everything hard to look at and hard to find. please fix this and make browsing photos enjoyable again.
i was update my iPhone 15 pro max on IOS 18.2 beta versio. I am fasing the issu. When i am playing Pubg Game, the notification always Come down and game stop. And when i try to On “Guided Access” the Guided access also not workin. Plzzz fix it. And i have another issue with iPhone when i open any app or any documents its very difficult to Go Back. i have to use left hand to go back or always Use Both hands. If it’s possible the “Go Back” option is available on both left and right side. right hander also easily use iPhone on One hand. give us a option “Go Back” option on Right also. Its very easy for us. Thank u soo much🩷🩷
Hello everyone,
I have recently published my app on the App Store and am planning to implement ads. I have a couple of questions regarding Apple's App Tracking Transparency (ATT) framework and best practices for integrating ads.
ATT Dialog and Showing Ads: If a user selects "Ask App Not to Track" on the ATT dialog, am I still allowed to show ads in my app? I understand that ATT restricts tracking for personalized ads, but does this mean I cannot show any ads at all, or is it just the personalized (targeted) ads that are restricted?
Best Practices for Implementing Native Ads: I want to integrate native ads into my app. Could you share any best practices or guidelines for integrating native ads in a way that provides a good user experience and complies with Apple's policies? I’m especially interested in how to implement them in a non-intrusive way and what ad networks are best for this type of integration.
Thanks for your help!
Hi everyone,
I’m facing an issue with my app submission, and I’m hoping to get some advice or suggestions on how to move forward.
Here’s the situation:
App Description: I created an app that provides mods for the game Gorilla Tag. It was initially rejected due to a violation of the Spam Policy.
Resubmission: After making improvements to address the issues, I resubmitted a new version for review.
Current Status: The app has now been stuck in the "In Review" status for a long time with no feedback or updates from Apple.
I’m not sure how to proceed, so I would greatly appreciate some guidance on the following:
Should I remove the app from my App Store Connect account entirely and start fresh? Would this help get the review process moving again?
Should I consider a complete redesign of the app’s UI or any other significant changes to improve its chances of being approved?
What specific changes or fixes should I implement to ensure my app meets the App Store guidelines and gets approved?
Also, I’m wondering if there are any other potential solutions or steps I can take to expedite the review process.
Thanks in advance for any suggestions or advice!
Emoji keyboard are way too big after updating to IOS 18.1 so anoying to use emojis now. I really don't like using emojis anymore. I really hope they are going to fix this quickly. I use my phone for work and pleasure. I don't needing my heart to be bigger or different colors to every reaction. Please bring back the smaller emoji keyboard or add a setting to switch it back. This is really annoying.
I need this app solution
It is outrageous that Apple continue to fail to implement the Fullscreen API web standard for web apps on iPhone only, which is so important to accessibility and web app functionality.
The only possible reason for this block is commercial: to promote iOS apps instead of browser based web apps.
To quote a client from a major agency just now - a typical enquiry :
We value accessibility greatly, and we noticed that the embedded player is missing a full screen button on iPhone.
Everything else works perfectly fine, including a full screen button that appears on the mobile webpage on android devices.
Is there any way we can include a button to enable full screen view for our viewers in your player that are going to watch it on iOS devices?
To which, as usual, we have to reply:
Apple unfortunately block fullscreen mode from being used with all web applications on iPhone.
Apple will allow this to be displayed fullscreen on MacBooks and iPads, but currently not on on iPhone - so we have to hide the fullscreen button there.
So fullscreen works on all devices and browsers apart from on iPhone.
As you've seen with Android, all other devices and browsers follow the universal 'Fullscreen API' web standard to allow full screen.
You're probably familiar with seeing the fullscreen button on normal linear videos on iPhone.
These use Apple's native video player, which doesn't let buttons and scripts be used on top of it - just a single video, not an interactive web application.
Our player looks like a video player but it is actually a web app combining multiple different video clips connected together by code and styling.
They block it on iPhones for reasons known only to them, but the assumption is that it is to incentivise people to make iOS apps instead of web apps.
The web development community is hopeful that Apple will change this unfortunate restriction soon, but we have been waiting a long time in vain.
We have to send this to a lot of people. It's a very bad look for Apple.
In less than a month it will be 2025. We have been waiting years for this.
The web standard documentation showing universal support on other devices and browsers is here:
https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
This is not acceptable. It is time for Apple to stop blocking this important accessibility web standard for commercial reasons - only on iPhone. To whoever is in charge of these decisions in the Safari/Webkit team: Please just enable Fullscreen API for web apps on iPhone as soon as possible.
I recently got feedback for my app under Guideline 4.2 - Design - Minimum Functionality, and I’m a bit confused. Apple mentioned that the app isn’t “app-like” enough and doesn’t provide sufficient entertainment value or utility.
However, I genuinely think my app is unique compared to others on the market. Most similar apps only offer basic features like scorekeeping and saving the game. My app goes beyond that by tracking detailed statistics based on the types of scores achieved during the game. At the end, there’s even a Player Ratings section, which enhances competition and makes the experience more fun for players.
Additionally, in today’s gaming scene, many groups play the traditional 101 game with a reward and penalty system. My app uniquely incorporates a reward system, something no other app in the market currently offers.
I believe my app has the potential to stand out and meet the needs of a wide audience. Has anyone faced similar feedback? Or does anyone have suggestions on how I could better address this issue?
Thanks in advance! 😊
Hi all,
Very new to this. Just getting into swift data, and am frustrated with the canvas not working with modelContainers in SwiftData. My understanding is that they work if inMemory = true, but not in the default case where data is persistent after an app is quit.
Can anyone tell me if it is possible to conditionally create the modelContainer type based on a flag... If Bool:Canvas then inMemory = True, Else False... Then using this flag for all data models so my list views populate on the canvas, without having to run the simulator each time... I would assume you could also pre-populate the inMemory option if it is empty also...
Or is there a simple and obvious solution that I am oblivious to.
If it is possible, is it worth the time, hassle, and any possible issues?