Isn't this the same question as in your previous post? You should better reply to comments and answers to it before writing a duplicate post.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Please try again later.
Have you taken enough time when you tried again? Apple's server related to WWDC may be getting too heavy and some services would not work properly.
And anyway, iOS 15 beta is a beta version of a product and it may contain many flaws or bugs. If the issue continues even if you try it later (with enough interval), you should better send a bug report.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
I could have extracted Xcode-beta.app with just double-clicking Xcode_13_beta.xip on my Mac mini 2018. How much free storage do you have?
Topic:
Programming Languages
SubTopic:
Swift
Tags:
There's some discussion about the same issue on forums.swift.org .
Will Swift Concurrency deploy back to older OSs?
It seems to be true that the runtime needed for await/async is provided as part of the new OSs.
It is a very sad fact that most of us developers need years to adopt this bright and successful new feature.
My company follows three-generation policy to support older OSs, which means we can use async/await when iOS 17 will be out.
I cannot be sure if I could remember that we could use this feature three years from now.
Apple should consider backward compatibility more severely to make this sort of great feature more popular in apps.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Can you show an example of the downloaded data? If it is in an original format, you may need to implement init(data:) all by yourself, without using Codable.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
If you want to use the data as Data (or NSData), use the downloaded data as is.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
You can write something like this:
var atext: AttributedString = "The little duck marveled at the sight of the bigger ducks playing in the lake"
if let range = atext.range(of: "duck") {
atext[range].font = .body.italic()
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
I guess you are nested NavigationViews.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can you try something like this?
func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) {
let optPeripheral: CBPeripheral? = service.peripheral
guard let peripheral = optPeripheral else {
return
}
let result: CBPeripheral = peripheral
print ("\(result)")
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
is it possible to use the app for sub version of IOS like iPhone 6s devices ?
I may be mistaking what you mean by sub version of IOS, but you should better check the documentations of SwiftUI components.
For example, View -- a very basic component in SwiftUI -- has an Availability notation as iOS 13.0+.
Generally, SwiftUI was introduced in iOS 13 and SwiftUI apps run only on devices with iOS 13 or later.
If the app may be using some feature available only in later iOS, it will run on devices with such iOS versions.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Generally, you would see some more info in the debug console when you get Thread 1: signal SIGABRT.
Better check it again.
But when you get it on the line let destinationVC = segue.destination as! ViewController, the most suspicious thing is segue.destination being non-ViewController.
Have you checked which segue is invoked and what is set in the Custom Class of the target view controller?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
NSAttributedString is given a new initializer taking an AttributedString.
convenience init(_ attrStr: AttributedString)
You can easily convert an AttributedString to an NSAttributedString:
var astr = AttributedString("Hello, world!")
if let range = astr.range(of: "world") {
astr[range].font = .boldSystemFont(ofSize: 22)
}
label.attributedText = NSAttributedString(astr)
Topic:
App & System Services
SubTopic:
General
Tags:
You should better use Code Block properly which improves readability and increases the chance to get better responses sooner.
But generally, Swift for Ubuntu cannot be the main topic of the dev forums. This site is mainly intended to discuss and share info about Apple's frameworks on Apple's platforms.
And the final Swift 5.5 is not released yet. Foundation types such as URLSession would be ported into Ubuntu, but it may not be the same time as the Swift 5.5 for Apple's platforms is released. You should better visit swift.org and get info about the status of Swift 5.5 for Ubuntu there.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
One possible solution would be adding a computed property:
extension Item {
var nameDefaulted: String {name ?? "default"}
}
struct ItemTable: View {
let items: [Item]
var body: some View {
Table(items) {
TableColumn("Name", value: \.nameDefaulted)
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
This is the output when I tested your code on iOS 15 simulator:
[start] longCalculation / is on main thread: false
[start] longCalculation / is on main thread: false
[end] longCalculation / is on main thread: false
[end] longCalculation / is on main thread: false
[end] action / is on main: true
Can you clarify your environment used for the test?
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Isn't this the same question as in your previous post? You should better reply to comments and answers to it before writing a duplicate post.
- Replies
- Boosts
- Views
- Activity
Please try again later.
Have you taken enough time when you tried again? Apple's server related to WWDC may be getting too heavy and some services would not work properly.
And anyway, iOS 15 beta is a beta version of a product and it may contain many flaws or bugs. If the issue continues even if you try it later (with enough interval), you should better send a bug report.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
- Replies
- Boosts
- Views
- Activity
I could have extracted Xcode-beta.app with just double-clicking Xcode_13_beta.xip on my Mac mini 2018. How much free storage do you have?
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
There's some discussion about the same issue on forums.swift.org .
Will Swift Concurrency deploy back to older OSs?
It seems to be true that the runtime needed for await/async is provided as part of the new OSs.
It is a very sad fact that most of us developers need years to adopt this bright and successful new feature.
My company follows three-generation policy to support older OSs, which means we can use async/await when iOS 17 will be out.
I cannot be sure if I could remember that we could use this feature three years from now.
Apple should consider backward compatibility more severely to make this sort of great feature more popular in apps.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
Can you show an example of the downloaded data? If it is in an original format, you may need to implement init(data:) all by yourself, without using Codable.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
If you want to use the data as Data (or NSData), use the downloaded data as is.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
You can write something like this:
var atext: AttributedString = "The little duck marveled at the sight of the bigger ducks playing in the lake"
if let range = atext.range(of: "duck") {
atext[range].font = .body.italic()
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
I guess you are nested NavigationViews.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
- Replies
- Boosts
- Views
- Activity
Can you try something like this?
func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) {
let optPeripheral: CBPeripheral? = service.peripheral
guard let peripheral = optPeripheral else {
return
}
let result: CBPeripheral = peripheral
print ("\(result)")
}
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
is it possible to use the app for sub version of IOS like iPhone 6s devices ?
I may be mistaking what you mean by sub version of IOS, but you should better check the documentations of SwiftUI components.
For example, View -- a very basic component in SwiftUI -- has an Availability notation as iOS 13.0+.
Generally, SwiftUI was introduced in iOS 13 and SwiftUI apps run only on devices with iOS 13 or later.
If the app may be using some feature available only in later iOS, it will run on devices with such iOS versions.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
- Replies
- Boosts
- Views
- Activity
Generally, you would see some more info in the debug console when you get Thread 1: signal SIGABRT.
Better check it again.
But when you get it on the line let destinationVC = segue.destination as! ViewController, the most suspicious thing is segue.destination being non-ViewController.
Have you checked which segue is invoked and what is set in the Custom Class of the target view controller?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
- Replies
- Boosts
- Views
- Activity
NSAttributedString is given a new initializer taking an AttributedString.
convenience init(_ attrStr: AttributedString)
You can easily convert an AttributedString to an NSAttributedString:
var astr = AttributedString("Hello, world!")
if let range = astr.range(of: "world") {
astr[range].font = .boldSystemFont(ofSize: 22)
}
label.attributedText = NSAttributedString(astr)
Topic:
App & System Services
SubTopic:
General
Tags:
- Replies
- Boosts
- Views
- Activity
You should better use Code Block properly which improves readability and increases the chance to get better responses sooner.
But generally, Swift for Ubuntu cannot be the main topic of the dev forums. This site is mainly intended to discuss and share info about Apple's frameworks on Apple's platforms.
And the final Swift 5.5 is not released yet. Foundation types such as URLSession would be ported into Ubuntu, but it may not be the same time as the Swift 5.5 for Apple's platforms is released. You should better visit swift.org and get info about the status of Swift 5.5 for Ubuntu there.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity
One possible solution would be adding a computed property:
extension Item {
var nameDefaulted: String {name ?? "default"}
}
struct ItemTable: View {
let items: [Item]
var body: some View {
Table(items) {
TableColumn("Name", value: \.nameDefaulted)
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
- Replies
- Boosts
- Views
- Activity
This is the output when I tested your code on iOS 15 simulator:
[start] longCalculation / is on main thread: false
[start] longCalculation / is on main thread: false
[end] longCalculation / is on main thread: false
[end] longCalculation / is on main thread: false
[end] action / is on main: true
Can you clarify your environment used for the test?
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity