Skip to content

Instantly share code, notes, and snippets.

View ingconti's full-sized avatar

ingconti ingconti

View GitHub Profile
//
// ContentView.swift
// CustomToolBar
//
// Created by ing.conti on 05/08/23.
//
// some stuff from nice exmple:
// https://stackoverflow.com/questions/66134755/swiftui-extract-toolbarcontent-to-its-own-var
// with some buttons and call back.
@ingconti
ingconti / AllowChangeContentView.swift
Created April 26, 2023 13:15
Cannot assign to property: 'self' is immutable FIX it!
//
// AllowChangeContentView.swift
// simpleSample
//
// Created by ing.conti on 26/04/23.
//
/* You got: Cannot assign to property: 'self' is immutable
if You write;
// ContentView.swift
import SwiftUI
struct ContentView: View {
var body: some View {
Image(systemName: "paperplane")
.renderingMode(.template)
@ingconti
ingconti / ListdemoWithSelection.swift
Last active August 8, 2023 20:18
list with check and actions, na navigations
//
// ContentView.swift
// aaaa
//
// Created by ing.conti on 08/08/23.
//
//
// ContentView.swift
// ListdemoWithSelection
//
// ViewController.swift
// SampleColoredLabel
//
// Created by ing.conti on 17/09/2019.
// Copyright © 2019 ing.conti. All rights reserved.
//
import UIKit
@ingconti
ingconti / CGRect+JSONCodable.swift
Last active June 19, 2023 04:27
real JSON encode / decode for CGRect
import Foundation
import CoreGraphics
// Apple does implement Codable, but is NOT really JSON and fails with arrys of CGRects.
extension CGRect {
func toDict()->Dict{
let d : Dict = [
"origin" : ["x" : self.origin.x, "y" : self.origin.y],
@ingconti
ingconti / QRImage.swift
Created June 8, 2019 12:12
QRCodeImage for iOS and OSX: allows to create a correct QR code without blur (ported from https://gist.github.com/snej/c210cc4cbfe8fd277186)
//
// QRImage.swift
// QRCodeSample
//
// Created by ing.conti on 08/06/2019.
// Copyright © 2019 ing.conti. All rights reserved.
//
@ingconti
ingconti / ViewController.swift
Last active March 24, 2019 07:45
colouring NSImage
//
// ViewController.swift
// NSImageColoring
//
// Created by ing.conti on 21/03/2019.
// Copyright © 2019 ing.conti. All rights reserved.
//
import Cocoa