Post

Replies

Boosts

Views

Activity

Reply to Adding MapPin to SwiftUI Tutorial MapView.swift
So, Place and annotations are declared inside struct MapView and coordinate is a property of MapView. You should better include all such info in the original post. Generally, when you show your code, you should better show the whole file of interest, that helps readers check what's going on. As the error message is clearly stating, in your code on the line initializing the instance property annotations, you are trying to use another instance property coordinate, which is not permitted in Swift. One possible solution would be initializing annotations somewhere else than the property initializer. struct MapView: View { var coordinate: CLLocationCoordinate2D @State private var region = MKCoordinateRegion() struct Place: Identifiable { let id = UUID() let name: String let coordinate: CLLocationCoordinate2D } @State var annotations: [Place] = [] //<- var body: some View { Map(coordinateRegion: $region, annotationItems: annotations) { MapPin(coordinate: $0.coordinate) } .onAppear { setRegion(coordinate) //↓ annotations = [ Place(name: "Xyz", coordinate: CLLocationCoordinate2D(latitude: coordinate.latitude, longitude: coordinate.longitude)) ] } } private func setRegion(_ coordinate: CLLocationCoordinate2D) { region = MKCoordinateRegion( center: coordinate, span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2) ) } }
Oct ’21
Reply to Type 'ToggleStyle' has no member 'switch'
after i upgraded Xcdoe 13 beta to Xcode 13 i lost ability to build for 12.0 Please check the Software Download page of Xcode 13 Applications Xcode 13 Xcode 13 includes everything you need to create and submit apps to the App Store for all Apple platforms. It Includes the SDKs for iOS 15, iPadOS 15, watchOS 8, tvOS 15, and macOS Big Sur. To continue developing apps for macOS Monterey, use Xcode 13 beta 5. i can't event download Xcode-beta 13 You can download Xcode 13 beta 5 from the link on the page above, or you can download older Xcodes from the More Download pages. Or you can use SwitchToggleStyle() explicitly: Toggle(isOn: $isOn) { Text("IPv6") } .toggleStyle(SwitchToggleStyle())
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Xcode10/Swift on Mac OS 10.13.6??? (Mountain Lion)
developing a new App for iOS/iPadOS/macOS If you are planning to develop apps for App Store, you cannot use the old iMac. App Store submission update iPhone and iPad apps. Starting April 26, 2021, all iPhone and iPad apps submitted to the App Store must be built with Xcode 12 and the iOS 14 SDK or later. So, you need a Mac capable of running Xcode 12 which requires macOS Catalina 10.15.4 or later. Minimum requirements and supported SDKs The iMac (21.5in, mid-2011) is not supported. macOS Catalina - Technical Specifications ... Mac Hardware Requirements ... Mac mini (Late 2012 or newer) ...
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to textSelection(_:) too basic
As far as I tried (and read some blogs), in the current implementation of SwiftUI, users can just select all the text where textSelection(.enabled) is applied. You can send an enhancement request using the Feedback Assistant.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Cannot convert value of type 'Task.Type' to expected argument type 'Task'
Please use the Code Block feature of this site when showing your code. (Or you can enclose each code block with lines containing only ``` manually.) And the last line of the DetailsView.swift in your shown code is a closing brace (}) and it lacks another closing brace. I guess the line you get the error is: DetailsView(task: Task) Then the cause of the error is obvious. When you use DetailsView(task:), you need to pass an instance of Task to the parameter task:, but you are just writing the type name Task. Please try changing the line as follows: DetailsView(task: Task(name: "Make home work - Science", isComplete: false, lastCompleted: nil))
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to developing a camera app(self timer, camera timer, delayed shooting))
This question seems to be just a duplicate of another post of yours. Generally, when any of your question could not get good responses, duplicate posts would not considered to be a good manner. And do everything for me-type questions are not preferred. To get better responses sooner, you should better include as much info as you can explaining what you have learnt till now. Frankly, posts including codes would get more responses even when the code is incomplete.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Observing UIButton Tap with Combine?
It doesn't look like Combine lets us observe a button tap. Am I right? Right. Combine has no native approach?  NO. At least, not yet. you still have to use the IBAction? Currently, target-action seems to be the only event handling scheme of UIKit. There may be some advances in the future, announced in WWDC 22 or later. As you know, Combine seems to be mainly designed for SwiftUI and works well with SwiftUI. If you want some native support for Combine in UIKit, you may want to write an enhancement request to Apple using the Feedback Assistant.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Guided Project: Apple Pie
how can I fix it? When you show your code, you should better show the code and the whole error message as text (use the Code Block). With the code being easily testable (copy and paste!), more readers would be involved. Screen shot is useful as an additional info, but you should better not think it would be a good primary info. Any way, the most problematic issue is here: I´m going through the "Develop in swift Fundamentals XCODE 12" course I'm currently on XCODE 13 Why the heck are you using Xcode 13 for the course written for Xcode 12?????????? Xcode and iOS changes every year, and in some cases it may cause some severe issues when you followed instructions correctly. Especially, iOS 15 introduced some ground up changes in UIButton. You may have noticed some settings views are different than in the course. If you insist on going on with Xcode 13, you may find other issues in the future. I recommend you to find a course written for Xcode 13 or get Xcode 12. (See More Downloads pages.)
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Add Image to View with Button Click
Is this possible? YES. (If you want something more, you should better show something more. Showing all the code what you have done till now would help showing more detailed answer.)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to See nothing when I use CloudKit cursor. Where is a problem?
Where is a mistake It is very likely your mistake exists somewhere not yet shown. Without showing enough code, nobody would be able to show how to fix. By the way, you should better respond to comments to make good communication in the dev forums.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Adding MapPin to SwiftUI Tutorial MapView.swift
@rKubischt, if all the code is exactly the same as the tutorial, you would not get that error. You should better show YOUR code.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Adding MapPin to SwiftUI Tutorial MapView.swift
So, Place and annotations are declared inside struct MapView and coordinate is a property of MapView. You should better include all such info in the original post. Generally, when you show your code, you should better show the whole file of interest, that helps readers check what's going on. As the error message is clearly stating, in your code on the line initializing the instance property annotations, you are trying to use another instance property coordinate, which is not permitted in Swift. One possible solution would be initializing annotations somewhere else than the property initializer. struct MapView: View { var coordinate: CLLocationCoordinate2D @State private var region = MKCoordinateRegion() struct Place: Identifiable { let id = UUID() let name: String let coordinate: CLLocationCoordinate2D } @State var annotations: [Place] = [] //<- var body: some View { Map(coordinateRegion: $region, annotationItems: annotations) { MapPin(coordinate: $0.coordinate) } .onAppear { setRegion(coordinate) //↓ annotations = [ Place(name: "Xyz", coordinate: CLLocationCoordinate2D(latitude: coordinate.latitude, longitude: coordinate.longitude)) ] } } private func setRegion(_ coordinate: CLLocationCoordinate2D) { region = MKCoordinateRegion( center: coordinate, span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2) ) } }
Replies
Boosts
Views
Activity
Oct ’21
Reply to Does making an updates to my app in App Store
Does making an updates to my app free and the cost alr included in the developer license fees? YES. You have no need to pay extra cost for submitting a new app or an update. You just need to keep your Apple Developer Program alive while you want to publish your apps in the App Store.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Type 'ToggleStyle' has no member 'switch'
after i upgraded Xcdoe 13 beta to Xcode 13 i lost ability to build for 12.0 Please check the Software Download page of Xcode 13 Applications Xcode 13 Xcode 13 includes everything you need to create and submit apps to the App Store for all Apple platforms. It Includes the SDKs for iOS 15, iPadOS 15, watchOS 8, tvOS 15, and macOS Big Sur. To continue developing apps for macOS Monterey, use Xcode 13 beta 5. i can't event download Xcode-beta 13 You can download Xcode 13 beta 5 from the link on the page above, or you can download older Xcodes from the More Download pages. Or you can use SwitchToggleStyle() explicitly: Toggle(isOn: $isOn) { Text("IPv6") } .toggleStyle(SwitchToggleStyle())
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode10/Swift on Mac OS 10.13.6??? (Mountain Lion)
developing a new App for iOS/iPadOS/macOS If you are planning to develop apps for App Store, you cannot use the old iMac. App Store submission update iPhone and iPad apps. Starting April 26, 2021, all iPhone and iPad apps submitted to the App Store must be built with Xcode 12 and the iOS 14 SDK or later. So, you need a Mac capable of running Xcode 12 which requires macOS Catalina 10.15.4 or later. Minimum requirements and supported SDKs The iMac (21.5in, mid-2011) is not supported. macOS Catalina - Technical Specifications ... Mac Hardware Requirements ... Mac mini (Late 2012 or newer) ...
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to textSelection(_:) too basic
As far as I tried (and read some blogs), in the current implementation of SwiftUI, users can just select all the text where textSelection(.enabled) is applied. You can send an enhancement request using the Feedback Assistant.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to AirPlay available devices list?
I read about AVRoutePickerView but is not show all available devices for me. Can you share the code you have tried?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cannot convert value of type 'Task.Type' to expected argument type 'Task'
Please use the Code Block feature of this site when showing your code. (Or you can enclose each code block with lines containing only ``` manually.) And the last line of the DetailsView.swift in your shown code is a closing brace (}) and it lacks another closing brace. I guess the line you get the error is: DetailsView(task: Task) Then the cause of the error is obvious. When you use DetailsView(task:), you need to pass an instance of Task to the parameter task:, but you are just writing the type name Task. Please try changing the line as follows: DetailsView(task: Task(name: "Make home work - Science", isComplete: false, lastCompleted: nil))
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to developing a camera app(self timer, camera timer, delayed shooting))
This question seems to be just a duplicate of another post of yours. Generally, when any of your question could not get good responses, duplicate posts would not considered to be a good manner. And do everything for me-type questions are not preferred. To get better responses sooner, you should better include as much info as you can explaining what you have learnt till now. Frankly, posts including codes would get more responses even when the code is incomplete.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS15NSTextAttachment
Do you have any questions? If so, please clarify what you want to ask.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cannot convert value of type 'Task.Type' to expected argument type 'Task'
{The site was malfunctioning -- removed.}
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Observing UIButton Tap with Combine?
It doesn't look like Combine lets us observe a button tap. Am I right? Right. Combine has no native approach?  NO. At least, not yet. you still have to use the IBAction? Currently, target-action seems to be the only event handling scheme of UIKit. There may be some advances in the future, announced in WWDC 22 or later. As you know, Combine seems to be mainly designed for SwiftUI and works well with SwiftUI. If you want some native support for Combine in UIKit, you may want to write an enhancement request to Apple using the Feedback Assistant.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Guided Project: Apple Pie
how can I fix it? When you show your code, you should better show the code and the whole error message as text (use the Code Block). With the code being easily testable (copy and paste!), more readers would be involved. Screen shot is useful as an additional info, but you should better not think it would be a good primary info. Any way, the most problematic issue is here: I´m going through the "Develop in swift Fundamentals XCODE 12" course I'm currently on XCODE 13 Why the heck are you using Xcode 13 for the course written for Xcode 12?????????? Xcode and iOS changes every year, and in some cases it may cause some severe issues when you followed instructions correctly. Especially, iOS 15 introduced some ground up changes in UIButton. You may have noticed some settings views are different than in the course. If you insist on going on with Xcode 13, you may find other issues in the future. I recommend you to find a course written for Xcode 13 or get Xcode 12. (See More Downloads pages.)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21