Hello everyone! I’m going to publish my first app, does the credit card you use for purchases link to your Apple ID or it’ Is it separate. If so how can I change it?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello everyone, On my iPad when I press upload to App Store Connect, It tells me uploaded successfully to App Store Connect. When I go to App Store Connect and to Build section, My app is not there. Am I looking in the right place?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store
Swift Playground
App Store Connect
I keep getting this error,” Cannot convert value of type ‘Currentlydoing.Type’ to expected argument type ‘Currrentlydoing”. When I remove the,”done: Currentlydoing” it gives an error saying,”Missing argument for parameter ‘done’ in call insert done: ,#Currenlydoing# “ but when I insert it it gives the original error. What’s the solution?
import SwiftUI
struct ContentView: View {
var done: Currentlydoing
var body: some View {
VStack {
Text(done.sleep ? "Hello":"HI")
}
}
}
struct MainView: View {
var body: some View {
ContentView()
}
}
struct Currentlydoing: Identifiable, Codable {
var id: String
var text : String
var work: Bool
var sleep: Bool
}
Greetings, can’t increase number of times ForEach is repeated, any solution?
import SwiftUI
struct ContentView: View {
@State var numberOfTimes: Int = 0
var body: some View {
VStack {
ForEach(1..<numberOfTimes, id: \.self) { i in
Text("i \(i)")
}
Text("Add one")
.onTapGesture {
numberOfTimes = numberOfTimes + 1
}
}
}
}
Greetings, in the @main file I keep getting this error, "Thread 1: "-[MTLSimHeap protectionOptions]: unrecognized selector sent to instance 0x600001864d20"" I have no idea what's causing it and how to solve it. Here is the code:
import SwiftUI
import MapKit
struct ContentView: View {
@StateObject private var viewModel = ContentViewModel()
var body: some View {
ZStack {
Map(coordinateRegion: $viewModel.region, showsUserLocation: true)
.accentColor(.blue)
.onAppear{
viewModel.checkIfLocationServicesEnabled()
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
final class ContentViewModel: NSObject, ObservableObject, CLLocationManagerDelegate{
var locationManager: CLLocationManager?
@Published var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 37.331516, longitude: -121.891054), span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01))
func checkIfLocationServicesEnabled() {
if CLLocationManager.locationServicesEnabled() {
locationManager = CLLocationManager()
locationManager!.delegate = self
} else {
print("show alert: location is off.")
}
}
private func checkLocationAuthorization() {
guard let locationManager = locationManager else { return }
switch locationManager.authorizationStatus {
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
case .restricted:
print("Your Location is restricted likely due to parental controls.")
case .denied:
print("You denied this app location permission, go to the settings to change it.")
case .authorizedAlways, .authorizedWhenInUse:
region = MKCoordinateRegion(center: locationManager.location!.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01))
@unknown default:
break
}
}
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
checkLocationAuthorization()
}
}
The @main file:
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Hello, How do I show the whole month name and not just 3 letters?
import SwiftUI
struct ContentView: View {
@State var dateString = ""
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text(dateString)
}
.onAppear{
dateString = Date.now.formatted(.dateTime.month().day().year())
}
}
}