Last active
March 21, 2018 02:32
-
-
Save adsl99801/061d789d42e1382f87e5728db36a126e to your computer and use it in GitHub Desktop.
IOS Objectivec
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
NSString* fontName = [[AppDelegate getSetting] fontName]; | |
int fontSize = [[AppDelegate getSetting] fontSize]; |
let result=newsPageVos.map({return $0.newsChannel.display_name}).reduce(""){$0+$1}
android intent 在ios 類似的功能
let fileUrl=response.dest
CommonUtils().printLog("\(fileUrl)")
// let file = try Data(contentsOf: fileUrl) will not effect
let file = NSURL(fileURLWithPath: fileUrl.absoluteString)
let activityViewController: UIActivityViewController = UIActivityViewController(activityItems: [file], applicationActivities:nil)
activityViewController.popoverPresentationController?.sourceView = self.lb_attachName
DispatchQueue.main.async {
self.present(activityViewController, animated: true, completion: nil);
}
import Foundation
class FileTool{
public func dir() -> URL {
return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
}
public func documentsDir() -> String {
var paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) as [String]
return paths[0]
}
public func cachesDir() -> String {
var paths = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true) as [String]
return paths[0]
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ad = (AppDelegate*)[[UIApplication sharedApplication] delegate];
NSString* fontName = [[AppDelegate getSetting] fontName];
int fontSize = [[AppDelegate getSetting] fontSize];