Post

Replies

Boosts

Views

Activity

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
542
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
586
Jun ’21
Failed to build "MeetingView.swift"
initializer 'init(value:total:)' requires that 'Int' conform to 'BinaryFloatingPoint' CompileDylibError: Failed to build MeetingView.swift Compiling failed: initializer 'init(value:total:)' requires that 'Int' conform to 'BinaryFloatingPoint' /Users/besleagaalexandrumarian/Documents/Scrumdinger/Scrumdinger/MeetingView.swift:13:13: error: initializer 'init(value:total:)' requires that 'Int' conform to 'BinaryFloatingPoint'             ProgressView(value: __designTimeInteger("#9345.[1].[0].property.[0].[0].arg[0].value.[0].arg[0].value", fallback: 5), total: __designTimeInteger("#9345.[1].[0].property.[0].[0].arg[0].value.[0].arg[1].value", fallback: 15))             ^ SwiftUI.ProgressView:3:12: note: where 'V' = 'Int'     public initV(value: V?, total: V = 1.0) where Label == EmptyView, CurrentValueLabel == EmptyView, V : BinaryFloatingPoint            ^ ================================== |  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/iPhoneSimulator14.5.sdk -target x86_64-apple-ios14.0-simulator -module-cache-path /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -swift-version 5 -I /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Products/Debug-iphonesimulator -F /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Products/Debug-iphonesimulator -c -j4 -serialize-diagnostics -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Scrumdinger-generated-files.hmap -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Scrumdinger-own-target-headers.hmap -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Scrumdinger-all-target-headers.hmap -Xcc -iquote -Xcc /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Scrumdinger-project-headers.hmap -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Products/Debug-iphonesimulator/include -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/DerivedSources-normal/x86_64 -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/DerivedSources/x86_64 -Xcc -I/Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/DerivedSources -Xcc -DDEBUG=1 -working-directory /Users/besleagaalexandrumarian/Documents/Scrumdinger /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Objects-normal/x86_64/MeetingView.2.preview-thunk.swift -o /Users/besleagaalexandrumarian/Library/Developer/Xcode/DerivedData/Scrumdinger-ezuqtqwebpjpzeeplhmsovhoewgh/Build/Intermediates.noindex/Previews/Scrumdinger/Intermediates.noindex/Scrumdinger.build/Debug-iphonesimulator/Scrumdinger.build/Objects-normal/x86_64/MeetingView.2.preview-thunk.o -module-name Scrumdinger_PreviewReplacement_MeetingView_2 -Onone -Xfrontend -disable-modules-validate-system-headers I do not have any preview after Refactoring names lines of code ?
2
0
1.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
402
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
2.8k
May ’21
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
496
May ’21