Skip to content

Instantly share code, notes, and snippets.

View cemolcay's full-sized avatar
🎼
🎶

Cem Olcay cemolcay

🎼
🎶
View GitHub Profile
@cemolcay
cemolcay / renameFilesByStringSwap.sh
Created August 16, 2016 00:00
$ Rename files in a folder by replacing strings
for f in *.png; do mv "$f" "${f/ReplaceThisText/WithThisText}"; done
@cemolcay
cemolcay / KVOManager.swift
Created August 15, 2016 18:29
NSNotificationCenter wrapper in swift
import Foundation
enum KVOManagerNotificationType: String {
case StickerBought = "com.mojilala.Stickers.Keyboard.StickerBought"
}
class KVOManager: NSObject {
static let sharedManager = KVOManager()
func addObserver(
@cemolcay
cemolcay / SaveManager.swift
Last active December 12, 2019 19:46
NSUserDefaults Save Manager
// MARK: - Manager
class SaveManager {
// MARK: Singleton
private static let instance = SaveManager()
class func sharedInstance () -> SaveManager {
@cemolcay
cemolcay / transperentUINavigationBar
Created May 12, 2015 10:21
transparent uinavigationbar
navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.translucent = true
navigationController?.navigationBar.backgroundColor = UIColor.clearColor()
@cemolcay
cemolcay / UIViewController+NavigationBarScrollingTitleView
Created February 27, 2015 10:13
Registers scroll view and label to navigation bar. Title attachs the navigation bar if scrolled out of screen
private var UIViewControllerRegisteredLabel: UInt8 = 0
private var UIViewControllerScrollTitleLabel: UInt8 = 1
extension UIViewController {
private var registeredLabel: UILabel? {
get {
return objc_getAssociatedObject(self, &UIViewControllerRegisteredLabel) as? UILabel
} set (value) {
objc_setAssociatedObject(self, &UIViewControllerRegisteredLabel, value, UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC))
@cemolcay
cemolcay / BlockTapView
Created February 25, 2015 08:02
uiview with tap gesture action
#import <UIKit/UIKit.h>
typedef void(^tapAction)(UITapGestureRecognizer *tap);
@interface BlockTapView : UIView
@property (copy) tapAction blockTapAction;
- (instancetype)initWithFrame:(CGRect)frame andAction:(tapAction)action;
@cemolcay
cemolcay / ASDisplayNodeDraw
Created February 19, 2015 12:24
ASDisplayNode draw shadow & border
override class func drawRect(
bounds: CGRect,
withParameters parameters: NSObjectProtocol!,
isCancelled isCancelledBlock: asdisplaynode_iscancelled_block_t!,
isRasterizing: Bool) {
let context = UIGraphicsGetCurrentContext()
CGContextSaveGState(context)
CGContextSetShadowWithColor(context, CGSize (width: 0, height: 1), 10, UIColor.TitleColor().CGColor)
@cemolcay
cemolcay / circleBlurMask.swift
Last active April 23, 2018 06:17
blurred screen with circle mask
@IBOutlet var mapView: MKMapView!
func setupMapBlur () {
var blur: UIView!
if ios8() {
blur = UIVisualEffectView (effect: UIBlurEffect (style: UIBlurEffectStyle.Light))
} else {
blur = FXBlurView (frame: view.frame)
}
@cemolcay
cemolcay / readme build box cheat sheet
Last active August 29, 2015 14:14
readme build box cheat sheet
[![Build Status](https://travis-ci.org/facebook/AsyncDisplayKit.svg)](https://travis-ci.org/facebook/AsyncDisplayKit)
[![Version](http://img.shields.io/cocoapods/v/AsyncDisplayKit.svg)](http://cocoapods.org/?q=AsyncDisplayKit)
[![Platform](http://img.shields.io/cocoapods/p/AsyncDisplayKit.svg)]()
@cemolcay
cemolcay / swift string array search
Created January 9, 2015 13:37
filters the dataSource with searchText