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 <WebKit/WebKit.h> | |
@interface ViewController : UIViewController | |
@property(strong,nonatomic) WKWebView *webView; | |
@property (strong, nonatomic) NSString *productURL; @end | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.productURL = @"http://www.URL YOU WANT TO VIEW GOES HERE"; | |
NSURL *url = [NSURL URLWithString:self.productURL]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
_webView = [[WKWebView alloc] initWithFrame:self.view.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
- (void) fireNotificationsForAllWeekDays: (NSInteger) hour minute: (NSInteger) minute { | |
[self fireNotificationForDay:Monday hour:hour minute:minute]; | |
[self fireNotificationForDay:Tuesday hour:hour minute:minute]; | |
[self fireNotificationForDay:Wednesday hour:hour minute:minute]; | |
[self fireNotificationForDay:Thursday hour:hour minute:minute]; | |
[self fireNotificationForDay:Friday hour:hour minute:minute]; | |
} | |
- (void) fireNotificationForDay: (WeekDayType) day hour: (NSInteger) hour minute: (NSInteger) minute { | |
NSDateComponents *dateComponents = [[NSDateComponents alloc]init]; |
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
private let cellReuseIdentifier: String = "yourCellReuseIdentifier" | |
// | |
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
var cell : UITableViewCell? = tableView.dequeueReusableCellWithIdentifier(cellReuseIdentifier) as? UITableViewCell | |
if (cell == nil) { | |
cell = UITableViewCell(style:.Default, reuseIdentifier:cellReuseIdentifier) |
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
//Create a Completion Handler | |
func isTextValid(input: String, completion: (result: Bool) -> Void) { | |
if (input == "Vea Software") { | |
completion(result: true) | |
} else { | |
completion(result: false) | |
} | |
}) | |
//Call a Completion Handler |
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
for var i = 1; i <= 10; i++ { | |
println(i) | |
} |
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
var myArray = UIFont.familyNames() as Array | |
print(myArray) | |
print(UIFont.fontNamesForFamilyName("NanumBarunGothic")) |
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
let emailImgView = UIImageView(image: UIImage(named: "btn_close")) | |
let paddedEmailImgView = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 32)) | |
paddedEmailImgView.addSubview(emailImgView) | |
emailField.leftViewMode = UITextFieldViewMode.Always | |
emailField.leftView = paddedEmailImgView |
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
tableView.registerNib(UINib(nibName: "CommunicationsTableViewCell", bundle: nil), forCellReuseIdentifier: "CommunicationsCell") |
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 TasteMatchesView: UIView { | |
var view: UIView! | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setUp() | |
} | |
required init?(coder aDecoder: NSCoder) { |
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
self.canvasView!.addSubview(label) | |
let widthConstraint = NSLayoutConstraint(item: label, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.LessThanOrEqual, toItem: self.view, attribute: NSLayoutAttribute.Width, multiplier: 1, constant: -40) | |
self.view.addConstraint(widthConstraint) |
OlderNewer