Skip to content

Instantly share code, notes, and snippets.

View litoarias's full-sized avatar
💭
I may be slow to respond.

Lito litoarias

💭
I may be slow to respond.
View GitHub Profile
#import "CenterLayoutPaging.h"
@implementation CenterLayoutPaging
- (void)awakeFromNib
{
[super awakeFromNib];
self.itemSize = CGSizeMake(CGRectGetWidth(self.collectionView.frame) / 1.2, CGRectGetHeight(self.collectionView.frame));
//
// CenterLayoutPaging.m
// POCCollection
//
// Created by Hipolito Arias on 5/11/16.
// Copyright © 2016 Hipolito Arias. All rights reserved.
//
#import "CenterLayoutPaging.h"
@litoarias
litoarias / TTPopAnimator.h
Created November 30, 2016 17:27
Transition Animator two parts of de middle
@import Foundation;
@interface TTPopAnimator : NSObject <UIViewControllerAnimatedTransitioning>
@end
@litoarias
litoarias / Fastfile
Last active February 10, 2023 07:23
Fastlane generator IPA Enterprise and Build Cordova project
fastlane_version "1.111.0"
scheme = "YOur scheme project"
configuration = "Release" # Debug or Release
project_name = "Your Project Name"
export_method = "enterprise" # app-store, ad-hoc, package, enterprise, development, developer-id
timestamp = Date.parse(Time.now.to_s)
ipa_name = "#{project_name}_#{timestamp}.ipa"
@litoarias
litoarias / HATextField
Created February 20, 2017 12:11
UITextField with left icon for Swift 3
import UIKit
@IBDesignable
class HATextField: UITextField {
override func textRect(forBounds bounds: CGRect) -> CGRect {
return CGRect(x: bounds.origin.x + iconWidth*2, y: bounds.origin.y, width: bounds.width, height: bounds.height)
}
override func editingRect(forBounds bounds: CGRect) -> CGRect {
@litoarias
litoarias / HAButton
Created February 20, 2017 13:05
UIButton deasignable cornerRadius, borderWidth, borderColor for Swift 3
import UIKit
@IBDesignable public class HAButton: UIButton {
@IBInspectable var borderColor: UIColor = UIColor.white {
didSet {
layer.borderColor = borderColor.cgColor
setTitleColor(borderColor, for: .normal)
}
}
@litoarias
litoarias / CustomWKWebView.swift
Last active June 20, 2024 20:19
Custom class of WKWebView implementing SSL Pinning
import WebKit
public class CustomWebView: WKWebView {
// var javascript: Javascript!
public override init(frame: CGRect, configuration: WKWebViewConfiguration = WKWebViewConfiguration()) {
super.init(frame: frame, configuration: configuration)
doInit()
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :generate_ipa_develop do
build_ios_app(
configuration: "Debug",
scheme: "Test",
clean: true,
export_method: 'development',
output_directory: "~/Desktop", # Destination directory. Defaults to current directory.
@litoarias
litoarias / InterfaceController.swift
Last active June 14, 2018 14:30
Watch Tutorial - 1
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet weak var table: WKInterfaceTable!
@IBAction func sendMessage() {
}
@litoarias
litoarias / InterfaceController.swift
Last active June 14, 2018 19:26
Watch Tutorial - 3
class InterfaceController: WKInterfaceController {
// ...
// MARK: - Items Table
private var items = [String]() {
didSet {
DispatchQueue.main.async {
self.updateTable()