Post

Replies

Boosts

Views

Activity

Reply to MacOS 12 (Monterey) is not supporting Xcode 12.5 and below
Unfortunate, in the past new OS supported more ancient versions of Xcode (MacOS 11.6 supports Xcode 10 and does not require Xcode12) However there was (at least) a warning in Apple News on sept 21 (and probably in Monterrey Release notes as well): https://developer.apple.com/news/?id=ufox7ci5 Xcode 13 required on macOS Monterey September 21, 2021 As you plan to update to macOS Monterey after the public release this fall, you’ll also need to update to Xcode 13 (which includes Xcode Cloud and the latest SDKs for iOS, iPadOS, macOS, tvOS, and watchOS). Xcode 13 is compatible with macOS Big Sur 11.3 or later.
Dec ’21
Reply to How do I get buttons and a title on the right side?
All you describe in not in the code you post, so it is a bit difficult to be sure. You should post a capture of what you get and a drawing of what you want But in principle, replace         Text("Text") by HStack {         Text("Text") Text("title") Button() // Create the button here } As you are new here, note that your tag must be selected properly. Here it is not Swift but SwiftUI. Also, when you paste code, use Paste and Match Style to avoid all blank lines, and use code formatter. You will get this presentation: import SwiftUI struct ContentView: View { var body: some View { NavigationView { List { HStack { Text("Text") Text("title") Button("Hello", action: { print("OK")}) // Create the button here } } .navigationTitle("Text") } } }
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to UICollectionView: Make the index fast-scroll to the section header instead of the first section item
Did you try to scroll "manually", by the height of the header of section (using scrollToFrame in following code) after reaching the section? https://stackoverflow.com/questions/36666100/how-to-programmatically-scroll-through-a-collection-view extension UICollectionView { func scrollToNextItem() { let scrollOffset = CGFloat(floor(self.contentOffset.x + self.bounds.size.width)) self.scrollToFrame(scrollOffset: scrollOffset) } func scrollToPreviousItem() { let scrollOffset = CGFloat(floor(self.contentOffset.x - self.bounds.size.width)) self.scrollToFrame(scrollOffset: scrollOffset) } func scrollToFrame(scrollOffset : CGFloat) { guard scrollOffset <= self.contentSize.width - self.bounds.size.width else { return } guard scrollOffset >= 0 else { return } self.setContentOffset(CGPoint(x: scrollOffset, y: self.contentOffset.y), animated: true) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’21
Reply to test
Would be better to tell what you test… Otherwise we may think of it as a spam or worse.
Dec ’21
Reply to How can I connect to Outlet or Action?
Swift Playground uses SwiftUI. So no storyboard. Unless you import UIKit modules ? Why have you to connect to IBOutlet of IBAction ? That's not how SwhitUI works. Look at tutorials (like in WWDC, and this extract as quick intro): "Platforms State of the Union". WWDC 2021 h t t p s : / / w w w.youtube.com/watch?v=3ELYyOwJCpM Or search for Playground in Apple Books for complete tutorial.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’21
Reply to hello
Please show code and explain better your problem (if difficult in english, do it in your mother language). And please, when you get an answer, give feedback. Either to provide the requested additional information or to tell if it works (if so close the thread), or not, then not explain what is the remaining problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Most wanted Xcode features…
Wanted Feature : Allow to edit a subView in a VC as an independent view. Pain point: In some cases, we may have several subviews in a VC that overlap (they are hidden / unhidden by code depending on conditions). It is then a bit tedious to modify their content or internal constraints because of this overlap. We can of course create a view nib, but that is not always the preferred solution. It would thus be helpful to edit the subview in a temporary hud window (as for setting IBOutlets or IBActions). Feasibility: That's what is done to edit Outlet properties, actions, …
Dec ’21
Reply to Xcode project not updating after changes
It may happen that Xcode caching prevents changes to be taken into account immediately when recompiling. Just do a Clean Build Folder (Product Menu) and everything should work as expected.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Why project won't run when I tell it to
Which version of Xcode ? What do you see in the top bar when you hit the Run Arrow ? Do you get any log message in the Issue Navigator ? Did you try a Clean Build Folder before compiling ?
Replies
Boosts
Views
Activity
Dec ’21
Reply to MacOS 12 (Monterey) is not supporting Xcode 12.5 and below
Unfortunate, in the past new OS supported more ancient versions of Xcode (MacOS 11.6 supports Xcode 10 and does not require Xcode12) However there was (at least) a warning in Apple News on sept 21 (and probably in Monterrey Release notes as well): https://developer.apple.com/news/?id=ufox7ci5 Xcode 13 required on macOS Monterey September 21, 2021 As you plan to update to macOS Monterey after the public release this fall, you’ll also need to update to Xcode 13 (which includes Xcode Cloud and the latest SDKs for iOS, iPadOS, macOS, tvOS, and watchOS). Xcode 13 is compatible with macOS Big Sur 11.3 or later.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Questions about the use of the Swift PlayGrounds
Not sure to understand. You have an app developed in Xcode and want to port it Playgrounds ? AFAIK, you cannot transfer full project, but can export files: https://stackoverflow.com/questions/43033585/can-we-convert-xcode-project-xcodeproj-to-swift-playground-playground-forma
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How do I get buttons and a title on the right side?
All you describe in not in the code you post, so it is a bit difficult to be sure. You should post a capture of what you get and a drawing of what you want But in principle, replace         Text("Text") by HStack {         Text("Text") Text("title") Button() // Create the button here } As you are new here, note that your tag must be selected properly. Here it is not Swift but SwiftUI. Also, when you paste code, use Paste and Match Style to avoid all blank lines, and use code formatter. You will get this presentation: import SwiftUI struct ContentView: View { var body: some View { NavigationView { List { HStack { Text("Text") Text("title") Button("Hello", action: { print("OK")}) // Create the button here } } .navigationTitle("Text") } } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to UICollectionView: Make the index fast-scroll to the section header instead of the first section item
Did you try to scroll "manually", by the height of the header of section (using scrollToFrame in following code) after reaching the section? https://stackoverflow.com/questions/36666100/how-to-programmatically-scroll-through-a-collection-view extension UICollectionView { func scrollToNextItem() { let scrollOffset = CGFloat(floor(self.contentOffset.x + self.bounds.size.width)) self.scrollToFrame(scrollOffset: scrollOffset) } func scrollToPreviousItem() { let scrollOffset = CGFloat(floor(self.contentOffset.x - self.bounds.size.width)) self.scrollToFrame(scrollOffset: scrollOffset) } func scrollToFrame(scrollOffset : CGFloat) { guard scrollOffset <= self.contentSize.width - self.bounds.size.width else { return } guard scrollOffset >= 0 else { return } self.setContentOffset(CGPoint(x: scrollOffset, y: self.contentOffset.y), animated: true) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to test
Would be better to tell what you test… Otherwise we may think of it as a spam or worse.
Replies
Boosts
Views
Activity
Dec ’21
Reply to test
that's a duplicate.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Help with the application
How can I Create a App for the Scientist If you don't know, learn how to code Then learn Xcode and UIKit or SwiftUI Then go… <And please, next time, formulate more precise questions.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How can I connect to Outlet or Action?
Swift Playground uses SwiftUI. So no storyboard. Unless you import UIKit modules ? Why have you to connect to IBOutlet of IBAction ? That's not how SwhitUI works. Look at tutorials (like in WWDC, and this extract as quick intro): "Platforms State of the Union". WWDC 2021 h t t p s : / / w w w.youtube.com/watch?v=3ELYyOwJCpM Or search for Playground in Apple Books for complete tutorial.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to All items in Project navigator in Xcode 13.1 black
Do you speak of icons or something else ? I just tested by creating a project with Xcode 13.1 and do not get the problem. Neither for a UIKit project nor SwiftUI. Just folders are now grey instead of yellow. For comparison, I created similar project in Xcode 12.4. See screenshot. Could you show what you get and explain what you'd expect ?
Replies
Boosts
Views
Activity
Dec ’21
Reply to How do Swift Playgrounds4.0 connect appstore
You need to have a developer account. Then it is straightforward, just an upload button to tap. Look at this video extract (@4:20 about) from WWDC21: https://www.youtube.com/watch?v=3ELYyOwJCpM
Replies
Boosts
Views
Activity
Dec ’21
Reply to Where is my DerivedData folder for Xcode
If you click on the arrow, you will be directed directly to the folder in Finder:
Replies
Boosts
Views
Activity
Dec ’21
Reply to hello
Please show code and explain better your problem (if difficult in english, do it in your mother language). And please, when you get an answer, give feedback. Either to provide the requested additional information or to tell if it works (if so close the thread), or not, then not explain what is the remaining problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Most wanted Xcode features…
Wanted Feature : Allow to edit a subView in a VC as an independent view. Pain point: In some cases, we may have several subviews in a VC that overlap (they are hidden / unhidden by code depending on conditions). It is then a bit tedious to modify their content or internal constraints because of this overlap. We can of course create a view nib, but that is not always the preferred solution. It would thus be helpful to edit the subview in a temporary hud window (as for setting IBOutlets or IBActions). Feasibility: That's what is done to edit Outlet properties, actions, …
Replies
Boosts
Views
Activity
Dec ’21