NSString *string = @"Text to share"
UIImage *image = [UIImage imageNamed:@"imageToShare"];
NSURL *URL = [NSURL URLWithString:@"relativeUrl"];
// Integrate with WeChat
NSArray *activity = @[[[WeixinSessionActivity alloc] init], [[WeixinTimelineActivity alloc] init]];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[string, image, URL] applicationActivities:activity];
[self.navigationController presentViewController:activityViewController animated:YES completion:nil];
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSObject { | |
/** | |
* ASSOCIATED - OBJECTS | |
*/ | |
public func associate(value: AnyObject, withKey: String) { | |
objc_setAssociatedObject(self, withKey, value, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
} | |
public func getAssociatedValue(key: String) -> AnyObject { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSObject+AssociatedObject.h | |
// OCLearning | |
// | |
// Created by Manish Verma on 26/07/16. | |
// Copyright © 2016 Manish Verma. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController+Tracking.h | |
// OCLearning | |
// | |
// Created by Manish Verma on 26/07/16. | |
// Copyright © 2016 Manish Verma. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSData+AESCrypt.h | |
// | |
// AES Encrypt/Decrypt | |
// Created by Jim Dovey and 'Jean' | |
// See http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html | |
// | |
// BASE64 Encoding/Decoding | |
// Copyright (c) 2001 Kyle Hammond. All rights reserved. | |
// Original development by Dave Winer. |