Skip to content

Instantly share code, notes, and snippets.

Avatar
🥇
Swift

Rinalds Domanovs Sangsom

🥇
Swift
View GitHub Profile
@Sangsom
Sangsom / NotesTextView.swift
Last active Apr 17, 2020
This is a custom multiline SwiftUI TextView integrated from UITextView
View NotesTextView.swift
import SwiftUI
import UIKit
struct NotesTextView: UIViewRepresentable {
@Binding var text: String
class Coordinator: NSObject, UITextViewDelegate {
@Binding var text: String
@Sangsom
Sangsom / AppConstants.swift
Created Nov 21, 2019
Sample of how to organise Swift global constants
View AppConstants.swift
import UIKit
struct Constants {
struct Design {
struct Color {
struct Primary {
@Sangsom
Sangsom / dropShadow.swift
Created Nov 20, 2019
This adds shadow to a view
View dropShadow.swift
extension UIView {
func dropShadow() {
self.layer.shadowOpacity = 0.7
self.layer.shadowOffset = CGSize(width: 3.0, height: 2.0)
self.layer.shadowRadius = 5.0
}
}