Skip to content

Instantly share code, notes, and snippets.

View korgx9's full-sized avatar
🐢

Kishvarsho Pallaev korgx9

🐢
View GitHub Profile
@nrlnishan
nrlnishan / CustomUIView
Created November 1, 2017 15:28
Creating a custom UIView using Xib
Steps for creating custom UIView.
1. Create a xib file, eg: MyCustomView.xib
2. Do necessary layout in xib file
3. Create a UIView file. eg: MyCustomView.swift.
4. Set this MyCustomView.swift file as the file owner of that xib
5. Create necessary outlets from the .xib file to .swift file. Important: Create one outlet for the root parent UIView to .swift file.
Name this outlet as as containerView
6. Override both the init method i.e using decoder & frame
7. Set the code as follows
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 1, 2024 06:16
Swift Concurrency Manifesto
@imkevinxu
imkevinxu / Device.swift
Last active March 4, 2023 16:09
iOS device checks for OS version and screen size in Swift
//
// Device.swift
// imHome
//
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15.
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved.
//
import Foundation
@yannickl
yannickl / YLColor.swift
Last active September 16, 2023 03:55
Hex string <=> UIColor conversion in Swift
import Foundation
import UIKit
extension UIColor {
convenience init(hexString:String) {
let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
let scanner = NSScanner(string: hexString)
if (hexString.hasPrefix("#")) {
scanner.scanLocation = 1
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation