This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| import SwiftUI | |
| struct TimeCycleScreen: View { | |
| @State private var selectedHour: Int = 7 | |
| @State private var selectedMinute: Int = 30 | |
| @State private var isAM: Bool = true | |
| @State private var timeOfDay: TimeOfDay = .morning | |
| @State private var celestialProgress: CGFloat = 0.3 | |
| @State private var sliderValue: Double = 7.5 |
| import AppKit | |
| import SwiftUI | |
| class PromptWindowController: NSWindowController, NSWindowDelegate { | |
| // Essential properties | |
| private var promptWindowContext: PromptWindowContext | |
| private let finderContext: FinderContext | |
| init() { |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| import SwiftUI | |
| struct ContentView: View { | |
| @ObservedObject var browser = { () -> DocumentBrowserObject in | |
| let dbo = DocumentBrowserObject ( | |
| forOpeningFilesWithContentTypes: [ | |
| "public.png", | |
| "public.jpeg" | |
| ] | |
| ) |
| import UIKit | |
| class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
| @IBOutlet weak var tableView: UITableView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| NSLayoutConstraint.activate([ | |
| tableView.topAnchor.constraint(equalTo: view.topAnchor), |
| // swift 3 | |
| import UIKit | |
| import AVFoundation | |
| class VideoPreviewView: UIView { | |
| private var videoOutput: AVCaptureMovieFileOutput? | |
| private var captureSession: AVCaptureSession? | |
| private var previewLayer: AVCaptureVideoPreviewLayer? | |
| import android.view.animation.Interpolator; | |
| import static java.lang.Math.*; | |
| public class BetterBounceInterpolator implements Interpolator { | |
| private int mBounces; | |
| private double mEnergy; | |
| /** Have more control over how to bounce your values. | |
| * |
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |