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
| import SwiftUI | |
| struct ContentView: View { | |
| @State var t: Float = 0.0 | |
| @State var timer: Timer? | |
| var body: some View { | |
| ZStack { | |
| MeshGradient( |
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
| CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
| CVPixelBufferLockBaseAddress(imageBuffer,0); | |
| size_t height = CVPixelBufferGetHeight(imageBuffer); | |
| size_t width = CVPixelBufferGetWidth(imageBuffer); | |
| size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer); | |
| void *sourceData = CVPixelBufferGetBaseAddress(imageBuffer); | |
| // Set a bunch of variables we need. The "radius" for the blur kernel needs to be positive and odd. The permute map maps the BGRA channels of the buffer to the ARGB that vImage needs. |
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
| func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { | |
| cell.layoutMargins = UIEdgeInsetsZero | |
| cell.separatorInset = UIEdgeInsetsZero | |
| cell.preservesSuperviewLayoutMargins = false | |
| } |
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
| self.navigationController?.navigationBar.barTintColor = UIColor.redColor() | |
| self.navigationController?.navigationBar.translucent = false | |
| self.navigationController?.navigationBar.tintColor = UIColor.whiteColor() | |
| self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()] |
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
| - (void)setupMapSnapshot | |
| { | |
| CLLocationCoordinate2D coordinate = self.outlet.annotaion.coordinate; | |
| MKMapSnapshotOptions* options = [MKMapSnapshotOptions new]; | |
| options.size = self.mapImageView.frame.size; | |
| options.scale = [[UIScreen mainScreen] scale]; | |
| options.region = MKCoordinateRegionMakeWithDistance(coordinate, 2000.f, 2000.f); | |
| MKMapSnapshotter* snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; | |
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
| // set UIViewControllerBasedStatusBarAppearance to NO in the Info.plist | |
| UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent |
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
| // App Delegate | |
| NSNotificationCenter.defaultCenter().postNotificationName("EventNotification", object: nil, userInfo: ["data": "dummy"]) | |
| // View Controller | |
| NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleEventNotification", name: "EventNotification", object: 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
| if let currentViewController = self.window?.rootViewController { | |
| // do something here | |
| } |
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
| let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate |
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
| #! /bin/sh | |
| function print_example() { | |
| echo "Example" | |
| echo " icons ios ~/AppIcon.png ~/Icons/" | |
| } | |
| function print_usage() { | |
| echo "Usage" | |
| echo " icons <ios|watch|all> in-file.png (out-dir)" |
NewerOlder