i though smart invert on iOS would ignore UIImageView but I just tested it and it does not workis there a setting i need to set so that UIImageView be ignore in smart invert mode ?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When Xcode autocomplete, a popup appear with different choice. At the beginning of the line there is a colored letter. I think M is for Method but some I just can't figured out.
where could I learn about those letter and the color coding they have.
thank you
when I read the disclosureGroup documentation , I see
struct DisclosureGroup<Label, Content> where Label : View, Content : View
in the first part it says label, I dont understand why.
I can put a string and it work,
But
if I put a label I get an error saying it requires that 'Label<Text, Image>' conform to 'StringProtocol'
it get worse (for me :-)
the second part say "where Label : View, Content : View"
for me it says that label conform to view... ?
I tried to put a view, it did not work either , with the same error
if I use the "Jump to definition" of disclosure, I can see this
public init(@ViewBuilder content: @escaping () -> Content, @ViewBuilder label: () -> Label)
then I am totally lost :-)
in label I can see
struct Label<Title, Icon> where Title : View, Icon : View
:-) Title ... a view ?
is there a documentation to help me read documentation :-)
I am trying to rewrite my app in SwiftUI. I used to need to add
NSBluetoothPeripheralUsageDescription in the info.plist
I dont remember how to do it. I dont see a Plus sign, and Right click does not off to add something ?
I am considering converting my app to SwiftUI
My app receive data via bluetooth every second in my BluetoothManager. This data is then send via protocol - delegate to another object that do math and other modification to those data. From there different data are send via protocol or notification to others object to be save to file, other to be send to CoreData , and some to be displayed
So lot's of data move but rarely to be displayed.
Because most of this transfert is between object and rarely view, I wonder which one is better EnvironmentObject or via Protocol and/or notification
I did look briefly at combine, and I am not sure if I would be able to use that in that case.
I would like to share my new project on an open source repository like GitHub. it need capabilities like iCloud. The problem is that I would prefer not have my appleid email being send to the open source repository. I saw that I can exclude files but I would be easier if the open source version had no Apple account associated with it.
how should I manage the open source version vs the App Store one.
Thank you
Topic:
Code Signing
SubTopic:
General
I have some difficulties to recreate the same SF Symbols I have configure in the app into my code. Is there a way to copy not just the name but everything including all modifier.
Thank you
Not sure what could cause this. the UI align differently running on iPhone versus running on Mac. If I remove the HStack, it works but I still would like to know why, and if there is a way to make it right on both platforms.
Thank you
here is my code
@State private var viewModel = FirmwareSelectionViewModel()
var body: some View {
Form {
Section("Setup Name") {
TextField ( "", text: $viewModel.setupName )
.foregroundColor(.green )
.disableAutocorrection(true)
.onSubmit {
print ("On Submit")
}
}
Section("Battery") {
HStack() {
Text("Volt")
TextField("", value: $viewModel.Vnominal, format: .number)
.textFieldStyle(.roundedBorder)
.foregroundColor(.green )
#if !os(macOS)
.keyboardType(.decimalPad)
#endif
.onChange(of: viewModel.Vnominal) {
viewModel.checkEntryValidity()
print("Updated Vnominal: \(viewModel.Vnominal)")
}
Text("Ah")
TextField("", value: $viewModel.batteryCapacity, format: .number)
.textFieldStyle(.roundedBorder)
.foregroundColor(.green )
#if !os(macOS)
.keyboardType(.decimalPad)
#endif
.onChange(of: viewModel.batteryCapacity) {
viewModel.checkEntryValidity()
print("Updated Battery Capacity: \(viewModel.batteryCapacity)")
}
}
}
Section("Firmware Type") {
Picker(selection: $viewModel.selectedType, label: EmptyView()) {
ForEach(TypeOfFirmware.allCases) { type in
Text(type.rawValue).tag(type as TypeOfFirmware)
.foregroundColor(.green )
}
}
.pickerStyle(SegmentedPickerStyle())
Picker(selection: $viewModel.selectedFirmware, label: EmptyView()) {
ForEach(viewModel.availableFirmware) { firmware in
Text(firmware.rawValue.capitalized).tag(firmware as Firmware)
}
}
.pickerStyle(SegmentedPickerStyle())
}
}
.onChange(of: viewModel.selectedType) {
viewModel.resetFirmwareSelection()
}
.navigationTitle("Firmware Selection")
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
I had a problem with my app (or in my setup) and searching the web I found a very simple code where part of my problem occurs.
I create a new Multiplatform App and
paste this code in ContentView.
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Text("Navigation article")
.font(.title)
.padding()
NavigationLink("Go to the second view", destination: SecondView())
.padding()
}
.navigationTitle("First View")
}
}
}
struct SecondView: View {
var body: some View {
Text("This is the Second view")
.font(.headline)
.padding()
.navigationTitle("Second View")
}
}
run on iPhone/ iOS no problem
run on a Mac/macOS
Going from view 1 to view 2 work, the back arrow on view 2 is there, and it is working but the second time I go to the view 2, the back arrow is gone.
after looking closely I can see the Arrow Underneath the S of SecondView.
I have tried many things and could not make it work.
I post this in a HackingWithSwift forum and somebody tried the code and said it work. so it seems the problem could be related to my setup but I create another user in my computer , same problem and tried it on my another computer, same problem.
Topic:
UI Frameworks
SubTopic:
SwiftUI