Post

Replies

Boosts

Views

Activity

How to declare a class with Objective-C ?
// //  main.m //  TowergraphOS // //  Created by Besleaga Alexandru Marian on 5/12/21. // #import Foundation/Foundation.h int main(int argc, const char * argv[]) {     @autoreleasepool {         // insert code here...         NSLog(@"Hello, World!");     }     return 1; } I want to declare class NSObject for class initializing.
1
0
552
May ’21
How to declare a scope in code ?
// //  GegeApp.swift //  Gege // //  Created by Besleaga Alexandru Marian on 5/15/21. // import SwiftUI @main struct GegeApp: App {     var body: some Scene {         WindowGroup {             Text("Besleaga Alexandru Marian")         }         #if os(macOS)                 Settings {                     SettingsView()                 }         #endif     } } struct GeneralSettingsView: View {     @AppStorage("showPreview") private var showPreview = true     @AppStorage("fontSize") private var fontSize = 12.0     var body: some View {         Form {             Toggle("Show Previews", isOn: $showPreview)             Slider(value: $fontSize, in: 9...96) {                 Text("Font Size (\(fontSize, specifier: "%.0f") pts)")             }         }         .padding(20)         .frame(width: 350, height: 100)     } } struct SettingsView: View {     private enum Tabs: Hashable {         case general, advanced     }     var body: some View {         TabView {             GeneralSettingsView()                 .tabItem {                     Label("General", systemImage: "gear")                 }                 .tag(Tabs.general)             `AdvancedSettingsView()`                 .tabItem {                     Label("Advanced", systemImage: "star")                 }                 .tag(Tabs.advanced)         }         .padding(20)         .frame(width: 375, height: 150)     } } Cannot find AdvancedSettingsView in scope ?
12
0
3.1k
May ’21
Swift App UI Button Scope
// //  TowerAppApp.swift //  TowerApp // //  Created by Besleaga Alexandru Marian on 5/17/21. // import SwiftUI @main struct TowerApp: App {     var body: some Scene {         WindowGroup {             Text("5/17/21")             Text(greeting + otherGreeting + name)         }     } } let greeting = "Welcome!" let otherGreeting = " Have a nice time!" let name = " Marie Curie" Button("Sign In", action: signIn) struct ButtonLabel where Label : View{     Button(action: signIn) {         Text("Sign In")     } } Cannot find 'signIn' in scope Cannot find type 'signIn'' in scope How to declare the UI Button ?
1
0
445
May ’21
What is a scope declaration in swift programming language ?
I'm reading https://docs.swift.org/swift-book/ReferenceManual/Declarations.html the swift reference manual at declarations to learn how to program a scope and still can't find the correct answer to solve these issue. // //  ContentView.swift //  MyMacCamera // //  Created by Besleaga Alexandru Marian on 14.06.2021. // import SwiftUI struct ContentView: View {     var body: some View {         Text("Hello, world!")             .padding()     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } class AVCaptureDevice : NSObject {     func lockForConfiguration() throws {              }     func unlockForConfiguration(){              } } class AVCaptureSession : NSObject {     func startRunning(){              }     func stopRunning(){              } } class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus {} Cannot find type 'AVAuthorizationStatus' in scope How should I proceed or should I do handle these error ?
2
0
594
Jun ’21
What is a identifier ?
I start learning Objective-C and the Xcode is returning errors of identification for the code that I'm developing.  - (void)mouseDown:(NSEvent *)event; Use of undeclared identifier 'mouseDown' NSLog("mouseDown") How to identify 'mouseDown" Event and receive a event in the output ?
1
0
652
Jun ’21