Swift is new for me

i have macos 15 and xcode 16 swift 6 and want to make apps to run on macintosh. i know the syntax of this programming language, but i need informations like which libraries i have to import for func's which name i do not know, and parameters i have not found on websites or the tutorial on swift. i need procedures like open window at x,y,width,height draw rectangle at x,y,width,height,color draw text at x,y,width,height,color,size read keyboard-letter,up/dn,shift read mouse x,y,buttons

Answered by DTS Engineer in 811879022

Hello,

We have developer documentation for all of our APIs located here:

Apple Developer Documentation https://developer.apple.com/documentation/

We also have a large collection of informational videos about our APIs: https://developer.apple.com/videos/

Thank you for your interest.

Welcome to the forum.

Your question is really too vague.

First question: do you want to use AppKit (Cocoa) or SwiftUI ?

  • For SwiftUI, there are many tutorials (including from Apple).

  • For Cocoa, you have to search for: swift developing macapp "cocoa"

Here is a very simple one : https://www.youtube.com/watch?v=8zFzldVgG4k

  • Or search for sample code : swift developing macapp "cocoa" sample code

Many here: https://github.com/kicsipixel/Cocoa-Samples

To search the libraries, the best is to use Xcode documentation directly,

i have listed the func i am interested in. is there no standard library from apple to use? from where i could receive this informations?

Hello,

We have developer documentation for all of our APIs located here:

Apple Developer Documentation https://developer.apple.com/documentation/

We also have a large collection of informational videos about our APIs: https://developer.apple.com/videos/

Thank you for your interest.

the most examples on the documentation do not work. some libraries like visionos 8gb are to download. do i need them for using my func? i have on no website found a listing of the func and their names with parameters and type-info, which i need written above. can somebody write in swift this:

//which libraries?
a=5*sin(33)
if a>2 { 
  openwindow(x,y,width,height)
  while mouseleft=false {
    if keyboard=down {
      if keyboard="A" draw full-rectangle(x,y,width, height,color 40C080)}
      if mouse-x>400 {draw text(x,y,color ff8080,"hello",size 16, font arial)}
  }
  closewindow-complete(?)
}
a=3*sin(55)
Swift is new for me
 
 
Q