I am trying to recreate the apple calendar in swiftui but I have issues creating scroll layout.
So I want to have:
When I scroll horizontally the hours on the side have to stay fixed but the header with the day number day String and the full day events have to scroll
When I scroll vertically the hours on the side have to move but the header don't
For the moment I have :
HStack(alignment: .top, spacing:0) {
// The hours on the side
LateralHours(height: geometry.size.height * 24/10) . offset(y: -offset)
ScrollViewReader { proxy in
ScrollView (.horizontal, showsIndicators: false) {
VStack {
// The day number and the full day events
Header(width: width)
ScrollView {
LazyHStack (spacing: 0) {
ForEach($loadedDays, id: \.self) { day in
// The day grid with the events
DayContentView(
cellHeight: geometry.size.height / 10,
width: width,
selectedEvent: $selectedEvent,
day: day,
store: $store,
modifiedEvent: $modifiedEvent
)
}
}
.frame(height: 24*geometry.size.height / 10)
// This code block is used to track the position of the scrollview position
.background( GeometryReader {
Color.clear.preference(key: ScrollOffsetPreferenceKey.self,
value: -$0.frame(in: .named("scroll")).origin.y)
})
.onPreferenceChange(ScrollOffsetPreferenceKey.self) { value in
offset = value
}
}
.coordinateSpace(name: "scroll")
}
}
.scrollTargetBehavior(.viewAligned)
.defaultScrollAnchor(.leading)
}
.scrollPosition(id: $position)
.frame(alignment: .topLeading)
}
So the hours on the side are in none of the scrollViews they are only modified through the .offset with the vertical scrollView position. My problem is that the .offset seems to be kind of slow and my app is slowed down is there a better modifed than .offset or do you know a more efficient way to do this ?
Create elegant and intuitive apps that integrate seamlessly with Apple platforms.
Post
Replies
Boosts
Views
Activity
Hello! I am making an app in SwiftUI and find it hard to make good-looking UIs with SwiftUI when using the List. When having a big navigation bar, the list appears misaligned with the title.
This is a preview within Xcode. Don't know if that changes anything 🤷. Below is the code. I should note I am using Xcode 16 beta 3.
//
// SwiftUIView.swift
//
import SwiftUI
struct SwiftUIView: View {
struct D {
var id: Int
var name: String
var identifier: String
}
let items: [(Int, D)] = [
(0, D(id: 0, name: "Test One", identifier: "one.example.test")),
(1, D(id: 1, name: "Test One", identifier: "two.example.test")),
(2, D(id: 2, name: "Test One", identifier: "three.example.test")),
(3, D(id: 3, name: "Test One", identifier: "four.example.test"))
]
var body: some View {
NavigationStack {
List(items, id: \.1.id) { idx, d in
VStack(alignment: .leading) {
Text(d.name)
.bold()
Text(d.identifier)
}
}
.navigationTitle("Hello Title")
}
}
}
#Preview {
SwiftUIView()
}
Hello,
I’m an aspiring full stack dev and I’m just wondering how the heck you get good UI AND UX. I’m currently moodboarding and seeing how things look in FigJam and then taking that and coding in Swift. I am struggling and my sanity is hanging on by a string 😂. So tell me, how do you get good UI and UX?
For my iOS game exported out of Unity LTS 2021 I have added the app icon in Xcode, and when installing the app on my iPhone the correct app icon appears everywhere (home screen, Settings etc.) expect for in the app switcher? Why is the wrong icon appearing in the app switcher?
I'm trying to add an SVG image to my launch screen. The SVG image is working fine in the main storyboard also used in a UIImageView, but the launch screen remains completely black; the launch screen is set with white background, so it seems to be completely ignored. When I remove the image from the UIImageView the launch screen is shown with correct background color but of course without the whished image. I can also correctly implement text in the launch screen, the launch screen shows the text and the background color correctly. As soon as I define an image from the asset catalogue for the UIImageView in the launch screen, the launch screen is completely black not showing anything. I tried also with a simple png image-set instead of the SVG image, but still the same issue. How can I implement a SVG image in my launch screen?
I create a toggle component based on Toggle
public struct Checkbox: View {
...
public init(...) {
...
}
public var body: some View {
return HStack(spacing: 8) {
ZStack {
Toggle("", isOn: $isPrivateOn)
...
}
...
}
}
}
how can I create a init method to support init with AppIntent like:
// Available when SwiftUI is imported with AppIntents
@available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *)
extension Toggle {
/// Creates a toggle performing an `AppIntent`.
///
/// - Parameters:
/// - isOn: Whether the toggle is on or off.
/// - intent: The `AppIntent` to be performed.
/// - label: A view that describes the purpose of the toggle.
public init<I>(isOn: Bool, intent: I, @ViewBuilder label: () -> Label) where I : AppIntent
}
I'm using Xcode 15.2 and I'm trying to add dark and tinted icon variants for my app, my Xcode doesn't seems to provide the appearances dropdown option mentioned and also displayed on the official guide here: https://developer.apple.com/documentation/Xcode/configuring-your-app-icon
Have I misunderstood the steps to provide the variants? Anyone can help me with this?
I have uploaded my app on app store connect but it has been rejected. I received the message about Guideline 4.8 - Design - Login Services. Can you please guide me about how to solve this issue on app store.
This is the message i receive from app store:
"The app uses a third-party login service, but does not appear to offer an equivalent login option with the following features:
-The login option limits data collection to the user’s name and email address.
-The login option allows users to keep their email address private as part of setting up their account.
-The login option does not collect interactions with the app for advertising purposes without consent.
Next Steps
Revise the app to offer an equivalent login option that meets all of the above requirements.
If the app already includes a login option that meets the above requirements, reply to App Review in App Store Connect, identify which login option meets the requirements, and explain why it meets the requirements.
Additionally, it would be appropriate to update the screenshots in the app's metadata to accurately reflect the revised app once another login service has been implemented."
Is the problem caused by not having Privacy Policy and Terms of Service when using third-party login service? If it is, then I will add the Privacy Policy and Terms of Service.
as shown in photo the noise level indicator is too big and not centred. not a major issue just a cosmetic flaw i thought i would bring up
Currently, it seems Apple uses something to detect colors in app icons and make them look good in dark mode, but for apps like Subway Surfers, that doesn’t happen, and why would they change the icon? So, behold! My fix to this problem: There should be some color picker and changer in xcode to change the colors on your app icon for dark mode. This would help a lot for apps like CARROT weather where the image just doesn’t look right when it has a dark tint. This would make the app seem presentable in dark mode and light mode.
In our application we have one banner via UIStackview which has one UIBotton & UILabel in horizontal stackview.
In UI is working fine in all the iOS Version & devices but it is creating issue for iOS 14.2 iPhone 6s.
We have verified the same in iOS 15.3.1 iPhone 6s, its is working fine.
We are attaching 2 screenshot:
Our Storybaord specific ui component.
The distorted UI of iOS 14.2 iPhone 6s.
Kindly update us on priority as end customer is facing issue.
Does vision pro support opening or closing an app with a gesture? Moreover, can vector animation be added into the app‘s launch animation?
Hi guys, is there a possible method or platform to code a precise and intensive input virtual tool (as sorts of keyboard app) on vision pro?
(A little bit confused to choose Xcode or Unity cause the App may require plenty of 3D interactions, which as far as I'm concerned might be complicated to bring such here on Xcode trough either Volumes or Spaces.
Dear all,
I'm building my first MacOs app.
I've created my app icon and add it to AppIcon folder, but when I'm building the application the icon shows in the dock of the screen with no rounded borders like all the other apps.
I'm attaching here the icon and as you can see it has sharp edges. It is the same way in which it shows on the dock.
Why? Has anybody experienced the same?
Thanks for the support in advance,
A.
I know this is a more abnormal question to ask on this forum but I really would like to gauge feedback from a community of other Swift developers on an idea. A colleague and I are seriously considering building a open-source web based SwiftUI component catalog that feature a collection of prebuilt modular components very similar to Shadcn for those of you who have worked in React but for SwiftUI where you can also contribute your own SwiftUI elements. Im curious if this would be something iOS/Swift devs would be possibly interested in and would love to hear thoughts on this idea. This is not a component library as Xcode technically has one thats built in, but rather fully built out SwiftUI elements such as UIs that use glass morphism for macOS, calendars for iOS apps, charts, etc.
Hello,
while app icon is shown in 'Targets' app icon is not shown in 'alert panel'
What is wrong?
Best regards
Gerhard
I'm curious about the new app icon options (any, dark, tinted) for Progressive Web Apps in iOS / iPadOS 18.
Has this feature been implemented yet?
If so, could someone point me to the specific documentation?
I've searched the Apple Developer Forums, Google, and Reddit but couldn't find any relevant information.
Thanks!
Hey guys,
maybe I am doing. Something wrong but my icons wont change back to light mode in my notification.
is there any solution to this ?
I am writing to inquire if there is any way to programmatically check whether a user has enabled the “Large App Icon” mode in iOS 18. Our development team is working on optimizing our app’s user interface, and it would be beneficial to adapt the design based on this setting.
Any guidance on how to access this information, or if it’s even possible within the current iOS APIs, would be greatly appreciated.
Thank you for your time and assistance.
i have a suggestion for an app that will help many families and once installed you won't be able to do without it.
I'm sure that at least 70% of families will use it at least twice a day.
who do I sell my project to?
applace many families will remember me.
finally sorry
my english comes from a translator.