Skip to content

Instantly share code, notes, and snippets.

View omaarr90's full-sized avatar

Omar Alshammary omaarr90

  • Riyadh,Saudi Arabia
View GitHub Profile
@omaarr90
omaarr90 / CallUI.swift
Created June 16, 2021 21:55
A Call UI replication similar to the one found on WhatsApp
//
// ContentView.swift
// CallsUI
//
// Created by Omar Alshammari on 06/11/1442 AH.
//
import SwiftUI
struct ContentView: View {
@omaarr90
omaarr90 / AttributedString+ResultBuilder.swift
Last active April 17, 2021 03:52
I think I will finally be friend with NSAttributedString. This snippet uses _functionBuilder because I'm still running Xcode 12.4
import UIKit
typealias StyleAttributes = [NSAttributedString.Key: Any]
enum AttributedText {
case text(String, StyleAttributes)
case image(UIImage, StyleAttributes)
}
@_functionBuilder
//
// UIButton+Animations.swift
// OneWallet
//
// Created by Omar Alshammari on 25/01/1440 AH.
// Copyright © 1440 Omar Alshammari. All rights reserved.
//
import UIKit
import PureLayout
@omaarr90
omaarr90 / ElvesAndTheirCodes.swift
Created February 8, 2017 18:59
Elves and Their Codes
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
let alphabitDict = [0: "A", 1: "B", 2: "C", 3: "D", 4: "E", 5: "F", 6: "G", 7: "H", 8: "I", 9: "J", 10: "K", 11: "L", 12: "M", 13: "N", 14: "O", 15: "P", 16: "Q", 17: "R", 18: "S", 19: "T",20: "U", 21: "V", 22: "W", 23: "X", 24: "Y", 25: "Z", 26: " "]
var initalRowOrder = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
@omaarr90
omaarr90 / UIImage+Omar.swift
Created February 17, 2016 09:37
UIImage extensions in swift, If you land on this gist by any chance. feel free to use it :)
//
// UIImageView+Omar.swift
// .........
//
// Created by Omar Alshammari on 12/20/15.
// Copyright © 2015 ___OALSHAMMARI___. All rights reserved.
//
/*
This enum is to help referencing Assets ID.