Post not yet marked as solved
//MARK : HealthStore
func getData() -> Double {
//Get Authorization
let stepType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)!
let heartRate = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate)!
let spo2 = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.respiratoryRate)!
healthStore.requestAuthorization(toShare: [], read: [stepType,heartRate,spo2]) { (chk, error) in
if (chk){
print("Permission Granted")
var dumm = 0.0
//currentHeartRate(completion: nil)
self.getSteps(currentDate: Date()) { result in
globalString.todayStepsCount = result
dumm = result
print(result)
}
return dumm
}
}
} //getData
func getSteps(currentDate: Date, completion: @escaping (Double) -> Void) {
guard let sampleType = HKCategoryType.quantityType(forIdentifier: .stepCount) else {
print("Get Steps not executed as is null")
return
}
let now = currentDate //Date()
let startDate = Calendar.current.startOfDay(for: now)
let predicate = HKQuery.predicateForSamples(withStart: startDate, end: now, options: .strictEndDate)
let query = HKStatisticsQuery(quantityType: sampleType, quantitySamplePredicate: predicate, options: .cumulativeSum)
{ _, result, _ in
guard let result = result, let sum = result.sumQuantity() else {
completion(0.0)
return
}
completion(sum.doubleValue(for: HKUnit.count()))
}
healthStore.execute(query)
}
Post not yet marked as solved
In my app, I need to have an onscreen button initiate a screenshot (which then gets saved to Photos, etc). Currently, every method I've tried from the forums (every version of UIGraphicsGetImageFromCurrentImageContext...) will capture everything EXCEPT the live feed from the camera, which is running as a sublayer on my view.
Everything from labels to buttons and even background color shows up in the pictures using those methods but no matter what, the image from the camera is just a blank space on the pictures.
However, when my app is running, I can press the two buttons and THAT picture always has the image from the camera included! I need this to happen with my onscreen button and that's what I just can't get to happen the same way.
Does anyone know the actual function/extension/code that runs whenever someone presses the hardware buttons to initiate a screenshot? Or how to accomplish getting everything that's onscreen at a given time to be include in a screenshot, regardless of what layer(s) it's in?
Post not yet marked as solved
I am working through the "Creating and Combining Views" Swift UI Landmarks tutorial using MacOS 12.3 and XCode 13.3. When trying to preview the MapView I receive the error:
| LoadingError: failed to load library at path "/Users/Elizabeth_Russell/Library/Developer/Xcode/DerivedData/Landmarks-fifnagwlpuhontdywqyzptoyghbg/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64/MapView.1.preview-thunk.dylib": Optional(dlopen(/Users/Elizabeth_Russell/Library/Developer/Xcode/DerivedData/Landmarks-fifnagwlpuhontdywqyzptoyghbg/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64/MapView.1.preview-thunk.dylib, 0x0002): Symbol not found: _$s9Landmarks16MapView_PreviewsV8previewsQrvgZTx
| Referenced from: /Users/Elizabeth_Russell/Library/Developer/Xcode/DerivedData/Landmarks-fifnagwlpuhontdywqyzptoyghbg/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64/MapView.1.preview-thunk.dylib
| Expected in: /Users/Elizabeth_Russell/Library/Developer/Xcode/UserData/Previews/Simulator Devices/49F2A163-EF87-47EC-B1F3-425A9742D1F7/data/Containers/Bundle/Application/0F7E6CF4-2589-42E5-B1C5-EE37941E4186/Landmarks.app/Landmarks)
Can someone help me understand why the library is not being loaded?
Thank you
Post not yet marked as solved
Let's say I have a SwiftUI view that's a compose experience, like composing a new email in Mail, an iMessage in Messages, or a Tweet in Twitter.
When the view is loaded, I want the soft keyboard to appear automatically so that the user can type immediately without needing to manually put focus in the TextField or TextEditor by tapping on it.
With the new @FocusState feature in iOS 15, I can programmatically put focus on different TextFields when the user interacts elsewhere in the UI (like pressing a button), but I can't seem to set a default focus.
I tried initializing focus in the SwiftUI view's init method as well as the onAppear method attached to other parts of the view, but this didn't seem to have any effect.
How can I put default focus on a TextField or TextEditor when a view is loaded?
Post not yet marked as solved
Using SwiftUI's new Table container, how can I add a context menu that appears when Control-clicking a row?
I can add the contextMenu modifier to the content of the TableColumn, but then I will have to add it to each individual column. And it only works above the specific text, not on the entire row:
I tried adding the modifier to the TableColumn itself, but it shows a compile error:
Value of type 'TableColumn<RowValue, Never, Text, Text>' has no member 'contextMenu'
Here's what I have in terms of source code, with the contextMenu modifier in the content of the TableColumn:
struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
@FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Item.name, ascending: true)])
private var items: FetchedResults<Item>
@State
private var sortOrder = [KeyPathComparator(\Item.name)]
@State
private var selection = Set<Item.ID>()
var body: some View {
NavigationView {
Table(items, selection: $selection, sortOrder: $items.sortDescriptors) {
TableColumn("Column 1") {
Text("Item at \($0.name!)")
.contextMenu {
Button(action: {}) { Text("Action 1") }
Divider()
Button(action: {}) { Text("Action 2") }
Button(action: {}) { Text("Action 3") }
}
}
TableColumn("Column 2") {
Text($0.id.debugDescription)
}
}
.toolbar {
ToolbarItem {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
}
}
if selection.isEmpty {
Text("Select an item")
} else if selection.count == 1 {
Text("Selected \(items.first(where: { $0.id == selection.first! })!.id.debugDescription)")
} else {
Text("Selected \(selection.count)")
}
}
}
}
So, how can I add a context menu to the entire row inside the Table?
Post not yet marked as solved
HStack {Text("Calculated number"); TextField("", value: $calculated, format: .number) }
HStack {Text("Calculate number"); TextField("", value: $calculator, format: .number) }
HStack {Text("Calculate way"); TextField("", value: $calculateway, format: .number)}
For the code above, Xcode will show error: Can't find $calculated, $calculator and $calculateway. How to solve this error?
Also I want to create a Label that shows word:'Result:'and a variable called calresult but I don't know how to make the Label, can anyone give me the code to create the Label I said?
I hope the Label will show these text, (calresult)means the data in calresult:
Result: (calresult)
Post not yet marked as solved
TextField("Calculated number", value: $calculated, format: Float)
TextField("Calculate number", text: $calculator, format: Float)
TextField("Calculate way", text: $calculateway, format: Float)
How to solve the errors:
'Cannot find $calculated, $calculator and $calculated in scope'?
Also this Label(Maybe I don't know how to make):
Label("Result:"+$calresult, systemImage: "42.circle")
How to solve this error:
'Cannot find $calresult in scope'?
Post not yet marked as solved
Hello there,
I stumbled on the issue of observing UserDefaults. My need is to "listening"/observing UD key named "com.apple.configuration.managed" which is responsible for reading provided MDM external plist. I checked that on the opened app it is possible to provide that plist, and app read this payload correctly.
My problem is to observing that change, when plist is uploading. Requirement is to support iOS 13, this is why I can't use AppStorage.
Despite using some similar solutions like:
someone own implementation of AppStorage,
and using StackOverflow solutions like this,
it still doesn't work.
My, I feel, the closest one solution was:
@objc dynamic var mdmConfiguration: Dictionary<String, String> {
get { (dictionary(forKey: MDM.ConfigurationPayloadKey) != nil) ? dictionary(forKey: MDM.ConfigurationPayloadKey)! as! Dictionary<String, String> : Dictionary<String, String>() }
set { setValue(newValue, forKey: MDM.ConfigurationPayloadKey)}
}
}
class MDMConfiguration: ObservableObject {
//@Binding private var bindedValue: Bool
@Published var configuration: Dictionary = UserDefaults.standard.mdmConfiguration {
didSet {
UserDefaults.standard.mdmConfiguration = configuration
// bindedValue.toggle()
}
}
private var cancelable: AnyCancellable?
init() {
// init(toggle: Binding<Bool>) {
//_bindedValue = toggle
cancelable = UserDefaults.standard.publisher(for: \.mdmConfiguration)
.sink(receiveValue: { [weak self] newValue in
guard let self = self else { return }
if newValue != self.configuration { // avoid cycling !!
self.configuration = newValue
}
})
}
}
struct ContentView: View {
@State private var isConfigurationAvailable: Bool = false
@State private var showLoadingIndicator: Bool = true
@ObservedObject var configuration = MDMConfiguration()
var body: some View {
GeometryReader { geometry in
let width = geometry.size.width
let height = geometry.size.height
VStack {
Text("CONTENT -> \(configuration.configuration.debugDescription)").padding()
Spacer()
if !configuration.configuration.isEmpty {
Text("AVAILABLE").padding()
} else {
Text("NIL NULL ZERO EMPTY")
.padding()
}
}
}
}
}
But it still doesn't ensure any changes in view, when I manually click on f.e. button, which prints the configuration in the console when it has uploaded, it does it well.
Please help, my headache is reaching the zenith. I am a newbie in Swift development, maybe I did something weird and stupid. I hope so :D
Thank in advance!
Post not yet marked as solved
Any idea how to implement an alamofire/ or http login request for this kind of json data
{
"data":{
"email": "myemail@...",
"password":"12345678",
"token":""
}
}
since i don't know how to read these curled bracelets "{" well, i need a severe help !
my data is from a url and not a json file, it is a url request
Post not yet marked as solved
I have been unable to install iOS 15 beta on an iPhone 6S.
I first updated the device to iOS 14.6. I downloaded the iOS 15 Beta Software Profile and installed it. Under Settings > Software Update, I can see the beta.
Selecting "Install Now" shows "Verifying update..." for about 5 minutes and then a generic error. "Unable to Install Update". An error occurred installing iOS 15 Developer beta. Retry / Remind Me Later.
I looked at Console and didn't see any useful errors. The iOS developer beta is 4.66GB, and so my phone is currently at 14.3GB out of 16GB. Is this a disk space issue with an unhelpful error messages? Anything else I should try?
Post not yet marked as solved
I created a slider, but sometimes it slides and sometimes it doesn't respond
Post not yet marked as solved
Currently NaviagitonView on macOS creates a side panel. And then navigationViewStyle does not support stack view for macOS.
Given this, is there currently a method to totally switch the content of a window from one view to another on macOS?
Post not yet marked as solved
I am trying to learn swift UI now and everything was going smoothly. The next day I try to open the project right back up but I can't see the canvas. I have tried numerous times but they all don't work. The diagnostics say this :
file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/RuntimeStubs.h' has been modified since the module file '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
CompileDylibError: Failed to build ContentView.swift
Compiling failed: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/RuntimeStubs.h' has been modified since the module file '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
:0: error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/RuntimeStubs.h' has been modified since the module file '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
:0: note: please rebuild precompiled header '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm'
:1:9: note: in file included from :1:
#import "LibcOverlayShims.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/LibcOverlayShims.h:21:2: error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/RuntimeStubs.h' has been modified since the module file '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
#include "Visibility.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/LibcOverlayShims.h:21:2: note: please rebuild precompiled header '/var/folders/ky/d075t_497gs6yynw5cd489hw0000gn/C/clang/ModuleCache/HP5PGJ664UGB/SwiftShims-2TTN5UXQBRCCQ.pcm'
#include "Visibility.h"
^
:0: error: missing required module 'SwiftOverlayShims'
==================================
| BuildInvocationError
|
| /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -F /Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator -enforce-exclusivity=checked -DDEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -target arm64-apple-ios15.0-simulator -Xfrontend -serialize-debugging-options -enable-testing -swift-version 5 -I /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Products/Debug-iphonesimulator -F /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Products/Debug-iphonesimulator -emit-localized-strings -emit-localized-strings-path /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64 -c -j8 -serialize-diagnostics -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Landmarks-generated-files.hmap -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Landmarks-own-target-headers.hmap -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Landmarks-all-target-headers.hmap -Xcc -iquote -Xcc /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Landmarks-project-headers.hmap -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Products/Debug-iphonesimulator/include -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/DerivedSources-normal/arm64 -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/DerivedSources/arm64 -Xcc -I/Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/DerivedSources -Xcc -DDEBUG=1 -working-directory "/Users/nicholasstefadouros/Desktop/Coding Course And Resources/Xcode Projects/Landmarks" /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64/ContentView.1.preview-thunk.swift -o /Users/nicholasstefadouros/Library/Developer/Xcode/DerivedData/Landmarks-gcahliobeozomohdnhybmlhirqoj/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/Landmarks.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/arm64/ContentView.1.preview-thunk.o -module-name Landmarks_PreviewReplacement_ContentView_1 -Onone -Xfrontend -disable-modules-validate-system-headers -gline-tables-only
Post not yet marked as solved
I have a class where I get data from firebase. But I can't get it exactly as I want, for example document("abc" ) here I need to get the name "abc" from another place, different name may come according to each click. I can't assign this to the class I'm getting the data from, can you help me?
import Firebase
struct StadiumNameView: View {
var body: some View {
VStack{
List(stadiumnameeeee) { i in
NavigationLink(destination: SelectedStadiumView(selectedStadium:i.name)){
Text(i.name)
}
}
}
}
}
struct StadiumNameView_Previews: PreviewProvider {
static var previews: some View {
StadiumNameView()
}
}
I need to pass the "i.name" here to the following class.
import Firebase
class UserInfoModel : ObservableObject {
@Published var city=""
@Published var email=""
@Published var name=""
@Published var surname=""
@Published var phone=""
@Published var town=""
@Published var type=""
@Published var id=""
@Published var birthday=""
@Published var favStadium=[String]()
init(){
let db=Firestore.firestore()
db.collection("Users").document(Auth.auth().currentUser!.uid).addSnapshotListener { (snapshot, error) in
if error == nil {
if let city=snapshot?.get("City") as? String {
self.city=city
}
if let email=snapshot?.get("Email") as? String {
self.email=email
}
if let name=snapshot?.get("Name") as? String {
self.name=name
}
if let surname=snapshot?.get("Surname") as? String {
self.surname=surname
}
if let phonenumber=snapshot?.get("Phone") as? String {
self.phone=phonenumber
}
if let town=snapshot?.get("Town") as? String {
self.town=town
}
if let type=snapshot?.get("Type") as? String {
self.type=type
}
if let id=snapshot?.get("User") as? String {
self.id=id
}
if let birthday=snapshot?.get("DateofBirth") as? String {
self.birthday=birthday
}
if let favStadiums=snapshot?.get("FavoriteStadiums") as? [String]{
self.favStadium=favStadiums
}
}
}
}
}
Post not yet marked as solved
I have 2 lists on different screens. It sorts the other list according to the data in the list I printed first. For example, if "name" is written in the list, it pulls data from firebase and lists it according to the "name" data in the other list. But the first time I click on the list, the empty list comes up and the next time I click, the data comes up according to the first click.
@ObservedObject var findStadium=FindStadium()
@State var selectedTown=""
@State var stadiumNameArray=[String]()
var body: some View {
NavigationView {
List(findStadium.townArray){ towns in
NavigationLink(destination: StadiumNameView().onAppear{
selectedTown=towns.town
let firestoreDatabase=Firestore.firestore()
firestoreDatabase.collection("Stadiums").order(by: "Name",descending: false).addSnapshotListener { (snapshot, error) in
if error != nil {
print(error?.localizedDescription ?? "Error")
} else {
if snapshot?.isEmpty != true && snapshot != nil {
stadiumnameeeee.removeAll(keepingCapacity: false)
print(stadiumnameeeee)
for document in snapshot!.documents {
if let Name = document.get("Town") as? String {
if Name==self.selectedTown {
let stadiumName=document.get("Name") as! String
self.stadiumNameArray.append(stadiumName)
stadiumnameeeee.append(stadiumName)
print(stadiumName)
print(stadiumnameeeee)
}
}
}
}
}
}
}) {
Text(towns.town)
}
}
.navigationBarTitle("İstanbul",displayMode:.large) //başka şehirler eklenirse düzenle
}
}}
and other view
var body: some View {
VStack{
List(stadiumnameeeee,id:\.self) { i in
NavigationLink(destination: SelectedStadiumView()){
Text(i)
}
}
}
}}
where am i doing wrong? please help!
https://developer.apple.com/documentation/swiftui/table
Following the documentation above to build a test table, but I am getting the below errors on the first table:
'buildBlock' is unavailable in iOS
'init(_:columns:)' is unavailable in iOS
'Table' is unavailable in iOS
Xcode version: Version 13.2.1 (13C100)
MacOS 12.1
Not sure what these errors mean, any help would be greatly appreciated.
Thanks!
Post not yet marked as solved
Hi Team,
We are developing an IoT project using Flutter.
We have a requirement for our client. We have developed a mobile app that displays a list of nearby gateway wifi List. The user connects that Wifi and gets gateway information.
Description:
The app will scan for nearby SSIDs, the user can select any one of them, and the user can insert the password. After successfully connecting, the user tries to connect to ssh client using host, port, username, password. Then the user used some commands to fetch HED/LED Logs information.
Can you help me with how to archive it in IOS?
Thanks,
Sitakanta Sundaray
Post not yet marked as solved
Text in iOS 15 Beta 1 (Xcode 13 Beta 1) only handles markdown when string literal was passed to initializer.
struct MarkdownTest: View {
var text: String = "**Hello** *World*"
var body: some View {
VStack {
Text("**Hello** *World*") // will be rendered with markdown formatting
Text(text) // will NOT be rendered according to markdown
}
}
}
struct MarkdownTestPreviews: PreviewProvider {
static var previews: some View {
MarkdownTest()
}
}
Is this a known bug or do I have to create an entry in Feedback Assistant?
Post not yet marked as solved
In the "What's new in Foundation" and "What's new in SwiftUI" talks there were examples of creating custom Attributed String styles. The example shown was for a rainbow style.
They showed creating the style, serializing the style, using the style in a String - but did not show how to actually render the text in the rainbow style. How is that part done in SwiftUI.
ie if I have Text("My fake example of ^[a custom style](customStyle: redAndEmphasized).")
How would i create the piece that renders "a custom style" with foregroundColor red and a heavy font?
Thanks,
Daniel
Hi, thanks for adding markdown support in SwiftUI's Text with Xcode 13 and iOS 15! :)
Even formatting like strikethrough works!
Text("Hello ~~World~~")
So which specification is supported?? This goes apparently beyond Commonmark (as strikethrough is not part of Commonmark specification). Is it GitHub Flavored Markdown or even a different spec?