Post

Replies

Boosts

Views

Created

Cannot update view
The variable from SignInController changes, the view does not. import SwiftUI import Foundation class SignInController: ObservableObject { var signedIn: Bool = false } struct MainView: View { @StateObject var signCon = SignInController() var body: some View { return Group { if signCon.signedIn == false { ZStack { SignView() Button { signCon.signedIn.toggle() print(signCon.signedIn) } label: { Text("Make True") } } } else if signCon.signedIn == true { HomeView() } } } } struct MainView_Previews: PreviewProvider { static var previews: some View { MainView() } } extension UserDefaults { func valueExists(forKey key: String) -> Bool { return object(forKey: key) != nil } }
1
0
417
Dec ’21
.navigationViewStyle(.columns) doesn't work
Hi, I'm trying to do basic app with fixed Navigation View on iPad. Doesn't work. What am I doing wrong? import SwiftUI struct CollectionView: View {     var body: some View {         if #available(iOS 15.0, *) {             NavigationView {                                  Text("Hello")                                      .navigationTitle("Hello")             }             .navigationViewStyle(.columns)             .padding()         } else {             // Fallback on earlier versions         }     } } struct CollectionView_Previews: PreviewProvider {     static var previews: some View {         CollectionView()     } }
1
0
546
Oct ’21
'ColumnNavigationViewStyle' initializer is inaccessible due to 'internal' protection level
Hi, trying simply using new ColumnNavigationViewStyle and getting error in title on using it. struct CollectionView: View {     var body: some View {         NavigationView {                      Text("Hello")                          .navigationTitle("Hello")         }         .navigationViewStyle(ColumnNavigationViewStyle())     } } struct CollectionView_Previews: PreviewProvider {     static var previews: some View {         CollectionView()     } }
1
0
992
Oct ’21
Peripheral.name won't change, when device's name is changed - CoreBluetooth
Hi, so I have a simple app, that lists out available peripheral names. It found for example my iPad, but if I want to change the name to whatever else, it's still showing the old name. Is there any way to refresh it? Thanks a lot
Replies
1
Boosts
0
Views
795
Activity
Sep ’22
Raspberry Pi - controlling iPhone
Hi, is there any possibility to control iPhone over Raspberry's Bluetooth? For example, when I press button, iPhone will stop playing music. Thanks a lot!
Replies
1
Boosts
0
Views
1.2k
Activity
Mar ’22
NavigationView Gray are when loading
Hi, as you can see, I'm loading json data from server. Sometimes when I click on Navigation Link, it shows this gray are... any help? Thanks!
Replies
0
Boosts
0
Views
379
Activity
Dec ’21
Cannot update view
The variable from SignInController changes, the view does not. import SwiftUI import Foundation class SignInController: ObservableObject { var signedIn: Bool = false } struct MainView: View { @StateObject var signCon = SignInController() var body: some View { return Group { if signCon.signedIn == false { ZStack { SignView() Button { signCon.signedIn.toggle() print(signCon.signedIn) } label: { Text("Make True") } } } else if signCon.signedIn == true { HomeView() } } } } struct MainView_Previews: PreviewProvider { static var previews: some View { MainView() } } extension UserDefaults { func valueExists(forKey key: String) -> Bool { return object(forKey: key) != nil } }
Replies
1
Boosts
0
Views
417
Activity
Dec ’21
.navigationViewStyle(.columns) doesn't work
Hi, I'm trying to do basic app with fixed Navigation View on iPad. Doesn't work. What am I doing wrong? import SwiftUI struct CollectionView: View {     var body: some View {         if #available(iOS 15.0, *) {             NavigationView {                                  Text("Hello")                                      .navigationTitle("Hello")             }             .navigationViewStyle(.columns)             .padding()         } else {             // Fallback on earlier versions         }     } } struct CollectionView_Previews: PreviewProvider {     static var previews: some View {         CollectionView()     } }
Replies
1
Boosts
0
Views
546
Activity
Oct ’21
'ColumnNavigationViewStyle' initializer is inaccessible due to 'internal' protection level
Hi, trying simply using new ColumnNavigationViewStyle and getting error in title on using it. struct CollectionView: View {     var body: some View {         NavigationView {                      Text("Hello")                          .navigationTitle("Hello")         }         .navigationViewStyle(ColumnNavigationViewStyle())     } } struct CollectionView_Previews: PreviewProvider {     static var previews: some View {         CollectionView()     } }
Replies
1
Boosts
0
Views
992
Activity
Oct ’21