HTML:
CSS:
div.container {
position: relative ;
width: 250px;
height: 250px;
background-color: green;
}
div.left {
margin: 0;
background: black;
opacity: 0.65;
position: absolute;
top: 50%;
transform: translate(-0%, -50%);
height: 61px;
width: 38px;
left: 0px;
}
div.right {
margin: 0;
background: black;
opacity: 0.65;
...
Thursday, July 28, 2016
Tuesday, July 26, 2016
Swift Request for Authorization
* Photos
func requestForAccessPhotos(view : UIViewController, completionHandler: (accessGranted: Bool) -> Void){
let authorizationStatus = PHPhotoLibrary.authorizationStatus()
switch authorizationStatus {
case .Authorized:
completionHandler(accessGranted: true)
case .Denied, .NotDetermined:
PHPhotoLibrary.requestAuthorization() {(status)...
Monday, July 25, 2016
Swift Infix Custom Threading
Code:
func ~> (task: ()->Void, update: ()-> Void)
{
let priority = DISPATCH_QUEUE_PRIORITY_DEFAULT
dispatch_async(dispatch_get_global_queue(priority, 0)) {
// do some task
task()
dispatch_async(dispatch_get_main_queue()) {
// update some UI
update()
}
}
}
Usage:
({
for i in 0..<100000{
print("count:...
Subscribe to:
Posts (Atom)