This file contains hidden or 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
| // Simple function converting from UIViewAnimationCurve to UIViewAnimationCurveOptions | |
| // Not all UIViewAnimationCurve values have a specified equivalent UIViewAnimationCurveOptions, | |
| // making it tricky to use the animation curve of the keyboard with UIView.animateWithDuration(...) API. | |
| // This works as late as iOS 9.1, but could change in the future. | |
| extension UIViewAnimationCurve { | |
| func toOptions() -> UIViewAnimationOptions { | |
| return UIViewAnimationOptions(rawValue: UInt(rawValue << 16)) | |
| } | |
| } |
This file contains hidden or 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
| // | |
| // APCustomBlurView.swift | |
| // Created by Collin Hundley on 1/15/16. | |
| // | |
| import UIKit | |
| public class APCustomBlurView: UIVisualEffectView { | |
| private let blurEffect: UIBlurEffect |
This file contains hidden or 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
| @implementation CMFWallpaper | |
| + (void)setImage:(UIImage *)image { | |
| NSAssert([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized, @"access to photos is needed to set the wallpaper"); | |
| NSString *path; | |
| #if TARGET_OS_SIMULATOR | |
| path = @"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibrary.framework"; | |
| #else | |
| path = @"/System/Library/PrivateFrameworks/PhotoLibrary.framework"; |
This file contains hidden or 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 UIView { | |
| public class func findByAccessibilityIdentifier(identifier: String) -> UIView? { | |
| guard let window = UIApplication.sharedApplication().keyWindow else { | |
| return nil | |
| } | |
| func findByID(view: UIView, _ id: String) -> UIView? { | |
| if view.accessibilityIdentifier == id { return view } | |
| for v in view.subviews { |
This file contains hidden or 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
| function test_lun2sol() { | |
| Logger.log(lun2sol(2013, 1, 4, 0)); | |
| } | |
| function test_sol2lun() { | |
| Logger.log(sol2lun(2013, 1, 26, 1)); | |
| } | |
| /** | |
| * lun2sol 의 date 버전 |
This file contains hidden or 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 altitude = distance*tan(M_PI*(75.0/180.0)) |
This file contains hidden or 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
| final class SnappingSlider: UISlider { | |
| override var value: Float { | |
| set { super.value = newValue } | |
| get { | |
| return round(super.value * 1.0) / 1.0 | |
| } | |
| } | |
| } |
This file contains hidden or 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
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
This file contains hidden or 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
| { | |
| "hosting": { | |
| "headers": [ | |
| { | |
| "source": "/.well-known/apple-app-site-association", | |
| "headers": [{"key": "Content-Type", "value": "application/json"}] | |
| } | |
| ] | |
| } | |
| } |
This file contains hidden or 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
| package xxx | |
| import android.content.Context | |
| import android.graphics.Bitmap | |
| import android.graphics.PixelFormat | |
| import android.hardware.display.DisplayManager | |
| import android.hardware.display.VirtualDisplay | |
| import android.media.ImageReader | |
| import android.media.projection.MediaProjection | |
| import android.util.Log |