Skip to content

Instantly share code, notes, and snippets.

@vikrant-Ios
vikrant-Ios / Table view Next Textfield and keyboard open and close
Last active May 16, 2018 06:38
Table view Next Textfield and keyboard open and close
import Foundation
import UIKit
extension UITableView {
func nextResponder(index: Int){
var currIndex = -1
for i in index+1..<index+100{
if let view = self.superview?.superview?.viewWithTag(i){
view.becomeFirstResponder()
@vikrant-Ios
vikrant-Ios / CarthageReadme.txt
Created January 10, 2018 10:42
Carthage integrate in your project in simple way
### Carthage integrate in your project
1) #Download the latest release of Carthage from https://github.com/Carthage/Carthage/releases. Select the most recent build, then under Downloads select Carthage.pkg.
2) #Double-click Carthage.pkg to run the installer. Click Continue, select a location to install to, click Continue again, and finally click Install.
#if Carthage.pkg not installed
#Note: When you may see a message stating “Carthage.pkg can’t be opened because it is from an unidentified developer.” Open the finder Right click on Carthage.pkg --- > openwith ----> Installer(default )
Installation process start select a location to install, Click to continue
And you done,To check that Carthage installed correctly, open Terminal and run the following command:
@vikrant-Ios
vikrant-Ios / Create PEM file for push notification
Last active January 10, 2018 10:42
Create PEM file for push notification
# Convert the .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in Filename.p12 -out FileName.pem
# Convert the .cer file into a .pem file:
$ openssl x509 -in apns_development.cer -inform der -out PushCert.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushCert.pem FileName.pem > final.pem
# Finally use final.pem or FileName.pem
@vikrant-Ios
vikrant-Ios / AlertExtension.swift
Created December 1, 2017 09:31
AlertExtension use in your project
//
// AlertExtension.swift
//
//
// Created by vikrant-Ios on 01/12/17.
// Copyright © 2017 vikrant-Ios. All rights reserved.
//
import Foundation
@vikrant-Ios
vikrant-Ios / viewcontroller.swift
Last active December 1, 2017 09:32
view property add with closure
@IBOutlet weak var myCustomView: UIView! {
didSet {
myCustomView.backgroundColor = UIColor.blue
myCustomView.layer.cornerRadius = myCustomView.bounds.width / 2
}
}
@vikrant-Ios
vikrant-Ios / podInstalation step.swift
Last active December 1, 2017 09:33
Pod Installation step
POD Install
Step [ 1 ] Open terminal and type:
sudo gem install cocoapods
Gem will get installed in Ruby inside System library. Or try on 10.11 Mac OSX El Capitan, type:
sudo gem install -n /usr/local/bin cocoapods
If there is an error "activesupport requires Ruby version >= 2.xx", then install latest activesupport first by typing in terminal.