Skip to content

Instantly share code, notes, and snippets.

View lalkrishna's full-sized avatar
🤩

Lal Krishna lalkrishna

🤩
View GitHub Profile
@lalkrishna
lalkrishna / Fastfile
Last active March 14, 2022 15:28
Fastfile configuration for take enterprise build iOS ipa and upload to diawi.
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@lalkrishna
lalkrishna / UIViewShakeCategory.m
Created October 17, 2019 06:24
UIView error shaking animation.
- (void)shake {
[self _shake:10 direction:1 currentTimes:0 withDelta:5 speed:0.03 shakeDirection:ShakeDirectionHorizontal completion:nil];
}
- (void)_shake:(int)times direction:(int)direction currentTimes:(int)current withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(ShakeDirection)shakeDirection completion:(void (^)(void))completionHandler {
__weak UIView *weakSelf = self;
[UIView animateWithDuration:interval animations:^{
weakSelf.layer.affineTransform = (shakeDirection == ShakeDirectionHorizontal) ? CGAffineTransformMakeTranslation(delta * direction, 0) : CGAffineTransformMakeTranslation(0, delta * direction);
} completion:^(BOOL finished) {
if(current >= times) {
@lalkrishna
lalkrishna / CustomStringConvertible.swift
Created October 17, 2019 06:14
Extension for CustomStringConvertible to print All properties of a class
extension CustomStringConvertible {
var description: String {
var description: String = "\(type(of: self))("
let selfMirror = Mirror(reflecting: self)
if let superclassMirror = selfMirror.superclassMirror {
for child in superclassMirror.children {
if let propertyName = child.label {
description += "Super.\(propertyName): \(child.value), "
@lalkrishna
lalkrishna / LKDebitCard.h
Last active July 11, 2019 09:46
DebitCard - Auto detect card type. Supported Cards: American Express, Discover, MasterCard, Visa Card
//
// LKDebitCard.m
// DebitCard
//
// Created by LK on 21/12/17.
// Copyright © 2017 LK. All rights reserved.
//
#import <Foundation/Foundation.h>