Tuesday, June 28, 2016

Enabling Relation View in phpMyAdmin while using MAMP

Please refer this article:

http://newvibes.com/blog/enabling-relation-view-in-phpmyadmin-mamp/

Thursday, October 1, 2015

How to completely remove Cocoapods from a project

http://stackoverflow.com/questions/16427421/how-to-remove-cocoapods-from-a-project

Tuesday, September 1, 2015

Xcode 7 (beta): Networking issue solved

add this to Info.plist

<key>NSAppTransportSecurity</key>

<dict>

    <key>NSAllowsArbitraryLoads</key>

    <true/>

</dict>



specific exception can also be added:


<key>NSAppTransportSecurity</key>

<dict>

    <key>NSExceptionDomains</key>

        <dict>

            <key>testdomain.com</key>

            <dict>

                <key>NSIncludesSubdomains</key>

                <false/>

                <key>NSExceptionAllowInsecureHTTPSLoads</key>

                <false/>

                <key>NSExceptionRequiresForwardSecrecy</key>

                <true/>

                <key>NSExceptionMinimumTLSVersion</key>

                <string>TLSv1.2</string>

                <key>NSThirdPartyExceptionAllowInsecureHTTPSLoads</key>

                <false/>

                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>

                <true/>

                <key>NSThirdPartyExceptionMinimumTLSVersion</key>

                <string>TLSv1.2</string>

                <key>NSRequiresCertificateTransparency</key>

                <false/>

            </dict>



            ...



    </dict>


</dict>

Facebook Video Upload on iOS using latest Facebook SDK for iOS(4.x)

 let videoData = NSData(contentsOfURL: NSURL.fileURLWithPath(path))
        
        if (hasGrantedPermission("publish_actions")) {
            
            var params = [String: AnyObject]()
            params["fields"] = ""
            params["video.mov"] = videoData
            params["contentType"] = "video/quicktime"
            params["description"] = "Test"
            FBSDKGraphRequest(graphPath: "/me/videos", parameters: params, HTTPMethod:"POST").startWithCompletionHandler {
                (connection, result, error) -> Void in
            }

        }

Wednesday, July 1, 2015

Detect idle time and do something when timer fires (Swift)

func resetIdleTimer()
    {

        if (idleTimer == nil)
        {
           idleTimer = NSTimer.scheduledTimerWithTimeInterval(kMaxIdleTimeSeconds, target: self, selector: "idleTimerExceeded:", userInfo: nil, repeats: false)
        }
        else
        {
           if (fabs(idleTimer.fireDate.timeIntervalSinceNow) < kMaxIdleTimeSeconds-1.0)
           {
               idleTimer.fireDate = NSDate(timeIntervalSinceNow: kMaxIdleTimeSeconds)
            
           }
        }
    }
    
    func idleTimerExceeded(sender: AnyObject)
    {
        idleTimer = nil

//do something when timer fires
    }