Skip to content

Instantly share code, notes, and snippets.

View Sangsom's full-sized avatar
🥇
Swift

Rinalds Domanovs Sangsom

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