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
| const frameworks = ["AVFoundation", "AVKit"]; | |
| frameworks.forEach(name => { | |
| $objc("NSBundle").$bundleWithPath(`/System/Library/Frameworks/${name}.framework`).$load(); | |
| }); | |
| const gravities = { | |
| resize: "AVLayerVideoGravityResize", | |
| resizeAspect: "AVLayerVideoGravityResizeAspect", | |
| resizeAspectFill: "AVLayerVideoGravityResizeAspectFill", | |
| } |
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
| $define({ | |
| type: "DownloadEventHandler: NSObject<NSURLSessionDownloadDelegate>", | |
| props: ["handlers"], | |
| events: { | |
| "URLSession:downloadTask:didFinishDownloadingToURL:": (session, task, location) => { | |
| const data = $objc("NSData").$dataWithContentsOfURL(location).$copy(); | |
| const filename = task.$response().$suggestedFilename(); | |
| const result = { | |
| "url": task.$originalRequest().$URL().$absoluteString().jsValue(), | |
| "data": data.jsValue(), |
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
| const manager = $objc("SDWebImageManager").$sharedManager(); | |
| const url = $objc("NSURL").$URLWithString(""); | |
| const options = 0; | |
| const modifier = $objc("SDWebImageDownloaderRequestModifier").$requestModifierWithBlock($block("NSURLRequest *, NSURLRequest *", request => { | |
| const mutableRequest = request.$mutableCopy(); | |
| mutableRequest.$setValue_forHTTPHeaderField("value", "key"); | |
| return mutableRequest.$copy(); | |
| })); |
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
| //---- Definition ----/ | |
| const UIAlertActionStyle = { | |
| Default: 0, | |
| Cancel: 1, | |
| Destructive: 2, | |
| } | |
| const UIAlertControllerStyle = { | |
| ActionSheet: 0, |