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 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() { | |
runApp(const GmailComposeButton()); | |
} | |
class GmailComposeButton extends StatefulWidget { |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; | |
Future main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
runApp(new MyApp()); | |
} | |
class MyApp extends StatefulWidget { |
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
// | |
// UILabel+FontSize.Swift | |
// | |
// Created by Nutchaphon Rewik on 7/11/15. | |
// Copyright (c) 2015 Nutchaphon Rewik. All rights reserved. | |
// | |
import UIKit | |
extension UILabel{ |
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 keyboardWillShow(notification: NSNotification) { | |
if let keyboardSize = (notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.CGRectValue() { | |
let contentInsets = UIEdgeInsets(top: self.tableView.contentInset.top, left: 0, bottom: keyboardSize.height, right: 0) | |
self.tableView.contentInset = contentInsets | |
// If active text field is hidden by keyboard, scroll it so it's visible | |
// Your app might not need or want this behavior. | |
var aRect: CGRect = self.view.frame | |
aRect.size.height -= keyboardSize.height | |
let activeTextFieldRect: CGRect? |
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
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- array of downloads. --> | |
<key>items</key> | |
<array> | |
<dict> | |
<!-- an array of assets to download --> |
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 String { | |
func md5() -> String! { | |
let str = self.cStringUsingEncoding(NSUTF8StringEncoding) | |
let strLen = CUnsignedInt(self.lengthOfBytesUsingEncoding(NSUTF8StringEncoding)) | |
let digestLen = Int(CC_MD5_DIGEST_LENGTH) | |
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLen) | |
CC_MD5(str!, strLen, result) | |
var hash = NSMutableString() |
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
// | |
// ViewController.swift | |
// | |
import UIKit | |
class ViewController: UIViewController, UIActionSheetDelegate { | |
@IBAction func tapButton(sender : AnyObject) { | |
var sheet: UIActionSheet = UIActionSheet(); | |
let title: String = "Please choose a course"; |
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
// | |
// AppDelegate.swift | |
// pushtest | |
// | |
// Created by sawapi on 2014/06/08. | |
// Copyright (c) 2014年 sawapi. All rights reserved. | |
// | |
// iOS8用 | |
import UIKit |
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 | |
extension Int{ | |
var day: (Int, Calendar.Component) { | |
return (self, .day) | |
} | |
var month: (Int, Calendar.Component) { | |
return (self, .month) | |
} |
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, UITableViewDataSource, UITableViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func didReceiveMemoryWarning() { |
NewerOlder