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
}
Create elegant and intuitive apps that integrate seamlessly with Apple platforms.
Post
Replies
Boosts
Views
Activity
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.
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?
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?
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?
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()
}
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 ?
Hello everyone, for a personal project I'd like to reproduce a design element from Apple's saving application.
I'd like to display three rectangles containing text: two horizontally aligned and one next to it. And I'd like the height of the last rectangle to be equal to the height of the two smallest.
Does anyone have a solution? Please provide a sample code
I'm looking for someone who can make me such a design. I just want this large text to work as a preview for pictures and videos at the top and the comment field at the bottom has the same design as in the picture and that it is together with the keyboard and that should all be only for the post-constitution. Maybe someone can do something like in this picture with exactly the same design and in the comment field there should also be this small Siri icon from Apple Intelligence. It doesn't have to work, but it just looks chic. In addition, I would like that on the main page where post is displayed like on TikTok and Instagram, is with a 3-D floating postcard and I have a sketch (see picture)
Since ios 17 I can’t choose the destination of airdropped files anymore.
why this error persists?
How to set Tx power level for iphone
I see that iOS 18 has tinted app icons. Does anyone know what will happen if we choose not to provide a version of our icon for tinting?
This is the worse service, Developer support do not respond its been 2 months and I cant even put the app live and am losing a lot of business, I can’t go live with this problem. We have been trying to change this account type from individual to business. This is frustrating, What kind of support that do not respond to their customers, Android fixed this long time, I can’t go live with this ,
I am even struggling to get the DNS number. What does one has to do here to get help, Honestly .
So disappointed on apple support
Sindi
Hi,
I want to create a real time sports analytics app that takes camera input and records basketball stats. I want to use pose estimation and object classification to record things such as dribbles, when the ball leaves one's hands. etc.
Is it possible to have a model in CoreML that performs pose estimation on people but also does just simple object detection on other classes (ie. ball, hoop?)
Thanks
Hii apple!
What about zooming with 2 fingers without making a screenshot to zoom it!!
I will love to make a pattent about it!!!
Everywhere we ad on the iphone should we zoom in with 2 fingers!!!
love to hear from ya
I'm getting a filed to diagnose for expression; submit a bug report (http://swift.org
Apple Rejected my Game which is published on my Google Play Account. It Requires me to Send the documentation to demonstrate that you are currently authorized by the rights holder to represent the products. I have sent them My Google Play Console Screenshot for the proof But they are requiring to submit documentation for that.
Can you please guide me how can I prove them that I own that game in third party store?
It has same package name and website/Privacy Policy links etc.
Hello,
I'm building apps for iPhone and iPad.
Those are working together like a 2-screen Nintendo switch.
Is there any way for communication between iPhone and iPad without an outside server?
PAN(personal area network) could be a solution, but I could not find any information to use it for my case.
If the iPad is connected to iPhone as a personal hotspot (though there's no cell tower), they should be communicate each other. I think there's a better way for my case.
Could anyone can tell me where I start to looking for?
Thanks,
JJ
Hi, thought I'd share some feedback (which was also sent to Apple) publicly in case anyone else is experiencing the same issue or has an idea of how to circumvent the issue while Apple investigates.
TLDR: Views presented with the .fullScreenCover modifier can be incorrectly dismissed when a child view presented with a .sheet modifier inside the .fullScreenCover is dismissed.
The intended behavior is that the child sheet views can be dismissed without dismissing the parent full screen cover views. It appears this bug has been present in versions of iOS 17 as well as iOS 18.
Short of using something other than a .fullScreenCover to present the view, I'm still searching for a solution to this bug.
Filing: FB14007758
Steps to Reproduce (see code below):
Open a View in .fullScreenCover presentation
In the view presented via the .fullScreenCover, add two sheet modifiers with two different views (e.g. SheetOneView, SheetTwoView)
Toggle the presentation of SheetOneView and SheetTwoView randomly until the .fullScreenCover is incorrectly dismissed.
Reproducible Code:
import SwiftUI
struct SheetOneView: View {
var body: some View {
Text("Sheet: 1")
}
}
struct SheetTwoView: View {
var body: some View {
Text("Sheet: 2")
}
}
struct FullScreenCoverView: View {
@State var isSheetOnePresented = false
@State var isSheetTwoPresented = false
var body: some View {
VStack(content: {
Text("Full Screen Cover")
HStack {
Button("Open Sheet 1") {
isSheetOnePresented = true
}
Button("Open Sheet 2") {
isSheetTwoPresented = true
}
}
.buttonStyle(.borderedProminent)
.buttonBorderShape(.capsule)
})
.sheet(isPresented: $isSheetOnePresented) {
SheetOneView()
}
.sheet(isPresented: $isSheetTwoPresented) {
SheetTwoView()
}
}
}
struct ContentView: View {
@State var isFullScreenCoverPresented = false
var body: some View {
VStack {
Button("Open Full Screen Cover") {
isFullScreenCoverPresented = true
}
}
.fullScreenCover(isPresented: $isFullScreenCoverPresented, content: {
FullScreenCoverView()
})
.padding()
}
}