http://scriptlife.hacca.jp/contents/programming/2016/08/14/post-1709/
# pip list
| #!/usr/bin/env python | |
| import argparse | |
| import datetime | |
| import os | |
| import yaml | |
| def main(args): |
| #!/bin/sh | |
| UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
| # make sure the output directory exists | |
| mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
| # Step 1. Build Device and Simulator versions | |
| xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
| xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
| import UIKit | |
| class CustomActivity: UIActivity { | |
| override class var activityCategory: UIActivityCategory { | |
| return .action | |
| } | |
| override var activityType: UIActivityType? { | |
| guard let bundleId = Bundle.main.bundleIdentifier else {return nil} |
##duration と timestamp
普通に初期化して、
CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onTimer:)];
displayLink.frameInterval = 30;
[displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
self.displayLink = displayLink;
[self onTimer:self.displayLink];
| public struct Async { | |
| // MARK: - Private properties and init | |
| /** | |
| Private property to hold internally on to a `dispatch_block_t` | |
| */ | |
| private let block: dispatch_block_t | |
| /** |
| let username = organizer.twitter | |
| let twitterURLs = [ | |
| "twitter://user?screen_name=\(username)", // Twitter | |
| "tweetbot://user_profile/\(username)", // TweetBot | |
| "echofon://user_timeline?\(username)", // Echofon | |
| "twit://user?screen_name=\(username)", // Twittelator Pro | |
| "x-seesmic://twitter_profile?twitter_screen_name=\(username)", // Seesmic | |
| "x-birdfeed://user?screen_name=\(username)", // Birdfeed | |
| "tweetings://user?screen_name=\(username)", // Tweetings |
| // Modified from: https://github.com/katleta3000/CancelBlocks/blob/master/CancelBlocks.swift | |
| typealias dispatch_cancelable_block_t = (cancel: Bool) -> (Void) | |
| private func dispatch_after_delay(delay: Double, queue: dispatch_queue_t, block: dispatch_block_t?) -> dispatch_cancelable_block_t? { | |
| guard let block = block else { return nil } | |
| var originalBlock: dispatch_block_t? = block | |
| var cancelableBlock: dispatch_cancelable_block_t? = nil | |
| let delayBlock: dispatch_cancelable_block_t = {(cancel: Bool) -> Void in | |
| if let originalBlock = originalBlock where !cancel { |
| @IBDesignable | |
| class TextField: UITextField { | |
| @IBInspectable var insetX: CGFloat = 0 | |
| @IBInspectable var insetY: CGFloat = 0 | |
| // placeholder position | |
| override func textRectForBounds(bounds: CGRect) -> CGRect { | |
| return CGRectInset(bounds , insetX , insetY) | |
| } |