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
| struct AudioChannel { | |
| static var maxInputLevelForAllChannels = 0 | |
| } |
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 Foundation | |
| enum MeetupAPI { | |
| // MARK: - Properties | |
| static let url = URL(string: "https://api.meetup.com/find/events?&sign=true&photo-host=public") | |
| static let session: URLSession = { | |
| let config = URLSessionConfiguration.default |
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
| // provide here the image that you want to upload, and | |
| // a value between 0 and 1 where 1 is the highest quality | |
| // https://developer.apple.com/reference/uikit/1624115-uiimagejpegrepresentation | |
| let imageData = UIImageJPEGRepresentation(image, 0.8) | |
| let url = yourUrl | |
| Alamofire.upload(multipartFormData: { multipartFormData in | |
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)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { | |
| NSArray <NLGoal*> *allGoals = [NLGoal goalsForCurrentUser]; | |
| UILocalNotification *localNotification = [[UILocalNotification alloc] init]; | |
| localNotification.alertTitle = @"Neverlate"; | |
| localNotification.timeZone = [NSTimeZone defaultTimeZone]; | |
| localNotification.fireDate = [NSDate date]; | |
| __weak typeof(self) weakSelf = self; |
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 stringIsAnagram(str1: String, str2 : String) -> Bool { | |
| var dict1 = [Character: Int]() | |
| var dict2 = [Character: Int]() | |
| var count = 0 | |
| for char in str1.characters { | |
| if (dict1[char] != nil) { | |
| dict1[char] = count++ | |
| } else { |
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 profile(block:(()->())) { | |
| let start = NSDate() | |
| block() | |
| let end = NSDate() | |
| print(end.timeIntervalSinceDate(start)) | |
| } | |
| //run your function/code inside the block below | |
| profile({ | |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
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
| // | |
| // FSQSplitViewController.h | |
| // | |
| // Copyright (c) 2015 Foursquare. All rights reserved. | |
| // | |
| #import "FSCoreViewController.h" | |
| NS_ASSUME_NONNULL_BEGIN; |
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
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| // Get your cell here | |
| cell.backgroundColor = [UIColor colorWithHue:(float)indexPath.row/[collectionView numberOfItemsInSection:indexPath.section] saturation:0.8 brightness:1 alpha:1]; | |
| // Do more stuff here | |
| } |
NewerOlder