Skip to content

Instantly share code, notes, and snippets.

View speaktoalvin's full-sized avatar

Alvin speaktoalvin

View GitHub Profile
// Custom SFSafariViewController
import UIKit
import SafariServices
class IDMSafariViewController : SFSafariViewController {
var edgeView: UIView? {
get {
if (_edgeView == nil && isViewLoaded()) {
_edgeView = UIView()
@speaktoalvin
speaktoalvin / Galaxy Of Tutorial Torrents
Created November 3, 2015 10:24 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
@speaktoalvin
speaktoalvin / UICollectionViewLayout
Created March 17, 2016 14:20
UICollectionViewLayoutArticle
struct Hello {
var parent : Hello? = nil
var children : [Hello] = []
}
// Error : Recursive value type 'Hello' is not allowed
@speaktoalvin
speaktoalvin / productRequest
Last active April 1, 2016 09:45
In App Purchase
func productRquestStarted(productReferenceName : String)
{
if (SKPaymentQueue.canMakePayments()) // 1
{
if productReferenceName == PRODUCT_IDENTIFIERS.k_RESTORE_WORDS_PRODUCT_IDENTIFIER.rawValue // 2
{
// You can call your function for restoring purchases here.
}
else
{
@speaktoalvin
speaktoalvin / enumList
Created April 1, 2016 09:38
Product Identifiers
private enum ProductRefereneNames : String
{
case HundreadNotes = "HundreadNotesSwiftCoderClub"
// Just like this put all your product identifiers here
}
@speaktoalvin
speaktoalvin / peerid
Last active April 5, 2016 14:13
MCPeerId
import Foundation
import UIKit
import MultipeerConnectivity
//MARK: MultiPeerFrameworkHelper
class MultiPeerFrameworkHelper : NSObject
{
// Peer Id
var myOwnPeerId : MCPeerID!
@speaktoalvin
speaktoalvin / Multipeer
Created April 5, 2016 14:10
ImportingFramework
import MultipeerConnectivity // Importing Framework
@speaktoalvin
speaktoalvin / Advertiser
Last active April 5, 2016 14:57
Mulitpeer Connectivity Advertiser
import Foundation
import UIKit
import MultipeerConnectivity
//MARK: MultiPeerFrameworkHelper
class MultiPeerFrameworkHelper : NSObject
{
....... // More code
@speaktoalvin
speaktoalvin / DelegateMethods
Last active April 5, 2016 15:15
MCNearbyServiceAdvertiserDelegate
//MARK: MCNearbyServiceAdvertiserDelegate
extension MultiPeerHelper : MCNearbyServiceAdvertiserDelegate
{
// Incoming invitation request. Call the invitationHandler block with YES
// and a valid session to connect the inviting peer to the session.
func advertiser(advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: NSData?, invitationHandler: (Bool, MCSession) -> Void)
{
invitationHandler(true, self.session) // Accepting an invitation
}
@speaktoalvin
speaktoalvin / Browsing
Created April 5, 2016 15:07
Multipeer Browsing
import Foundation
import UIKit
import MultipeerConnectivity
//MARK: MultiPeerFrameworkHelper
class MultiPeerFrameworkHelper : NSObject
{
....... // More code