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 | |
class ViewController: UIViewController { | |
let scrollView = UIScrollView() | |
let containerView = UIView() | |
let imageView = UIImageView(image: UIImage(named: "quita")) | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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
struct ContentView: View { | |
var body: some View { | |
VStack(alignment: .leading) { | |
Text("Dark Side of the Moon") | |
.frame(maxHeight: .infinity) | |
Text("Wish You Were Here") | |
.frame(maxHeight: .infinity) | |
Text("Animals") | |
.frame(maxHeight: .infinity) | |
Text("The Wall") |
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
struct ContentView: View { | |
@State private var showPopover: Bool = false | |
var body: some View { | |
Button(action: { | |
self.showPopover = true | |
}) { | |
Text("Albums") | |
}.popover(isPresented: $showPopover) { | |
ScrollView(.vertical, showsIndicators: true) { |
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
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.00 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ | |
// code | |
}); |
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
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodName) name:UIApplicationDidBecomeActiveNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodName) name:UIApplicationWillEnterForegroundNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodName) name:UIApplicationDidEnterBackgroundNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodName) name:UIApplicationWillResignActiveNotification object:nil]; |
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
#!/bin/sh | |
# Usage: ./sign.sh INPUT.ipa OUTPUT PROVISION.mobileprovision IDENTITY_NAME ENTITLEMENTS BUNDLEID | |
# Reading parameters | |
INPUT=$1 | |
OUTPUT=$2.ipa | |
MOBILE_PROVISTION=$3 | |
CER_NAME=$4 | |
ENTITLEMENTS=$5 | |
BUNDLEID=$6 |
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
NSURLSession *session = [NSURLSession sharedSession]; | |
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.example.com/endpoint_%@.json", parameter]]; | |
NSURLSessionDataTask *dataTask = [session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { | |
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; | |
}]; | |
[dataTask resume]; |
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
class CachedDateFormatter { | |
static let sharedInstance = CachedDateFormatter() | |
var cachedDateFormatters = [String: NSDateFormatter]() | |
func formatterWith(#format: String, timeZone: NSTimeZone = NSTimeZone.localTimeZone(), locale: NSLocale = NSLocale(localeIdentifier: "en_US")) -> NSDateFormatter { | |
let key = "\(format.hashValue)\(timeZone.hashValue)\(locale.hashValue)" | |
if let cachedDateFormatter = cachedDateFormatters[key] { | |
return cachedDateFormatter | |
} |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapFrom:)]; | |
[tapRecognizer setNumberOfTapsRequired:1]; | |
[self.view addGestureRecognizer:tapRecognizer]; | |
} | |
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
NSLog(@"newBannerViewFrame: %@", NSStringFromCGRect(newBannerViewFrame)); |
NewerOlder