This file contains 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 UIKit | |
import GoogleMaps | |
class GMInteractiveMarker: UIViewController,GMSMapViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
self.loadMap() |
This file contains 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
//A function that could be called recursively to calculate the total of an integer array. | |
func total(array:NSArray,index:Int,sum:Int) -> Int { | |
if (index > (array.count - 1)) { | |
return sum | |
}else { | |
let currentNumber:Int = array.objectAtIndex(index) as! Int | |
let currentTotal:Int = sum + currentNumber | |
return total(array, index: index + 1, sum: currentTotal) | |
} |
This file contains 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
cd "${XCS_SOURCE_DIR}/<project directory name>" | |
git log -1 --pretty=%B > "releaseNote.txt" | |
"Pods/Crashlytics/submit" <key> <secret> \ | |
-notesPath "releaseNote.txt" \ | |
-ipaPath "${XCS_PRODUCT}" -groupAliases <your distribution group> \ | |
-notifications YES |
This file contains 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
//Prior to running the script below change build settings as mentioned in https://developer.apple.com/library/ios/qa/qa1827/_index.html | |
cd "${XCS_SOURCE_DIR}/Writer" | |
xcrun agvtool new-version -all "${XCS_INTEGRATION_NUMBER}" |
This file contains 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 *) encodeString: (NSString *) string { | |
NSMutableString *output = [NSMutableString string]; | |
const unsigned char *source = (const unsigned char *)[string UTF8String]; | |
int sourceLen = (int)strlen((const char *)source); | |
for (int i = 0; i < sourceLen; ++i) { | |
const unsigned char thisChar = source[i]; | |
if (thisChar == ' '){ | |
[output appendString:@"%20"]; | |
} else if (thisChar == '.' || thisChar == '-' || thisChar == '_' || thisChar == '~' || |
This file contains 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
enum FontName: String { | |
case timesNewRoman = "TimesNewRomanPSMT" | |
case timesNewRomanItalic = "TimesNewRomanPS-ItalicMT" | |
case timesNewRomanBold = "TimesNewRomanPS-BoldMT" | |
} | |
extension UIFont { | |
class var sanFranciscoRegular: UIFont { | |
if let font = UIFont.init(name: "SFUIText-Regular", size: 15) { |
This file contains 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/Foundation.h> | |
@interface NSString (DateFormatter) | |
- (NSString *)dateStringFromFormat:(NSString *)fromFormat toFormat:(NSString *)toFormat; | |
@end |
This file contains 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 UIView { | |
func frameOfFirstResponder() -> CGRect? { | |
if self.isFirstResponder { | |
return self.frame | |
} | |
for view in self.subviews { | |
if let frame = view.frameOfFirstResponder() { | |
return frame | |
} |
This file contains 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 stringByReplacing(charSet: CharacterSet, with string: String) -> String { | |
let components = self.components(separatedBy: charSet) | |
return components.joined(separator: string) | |
} |
OlderNewer