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
| // Safely Modifying The View State (SwiftUI) | |
| // https://swiftui-lab.com | |
| // https://swiftui-lab.com/state-changes | |
| import SwiftUI | |
| struct CustomView: View { | |
| var body: some View { | |
| NavigationView { |
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
| // | |
| // UIResponder+performWindowDrag.swift | |
| // JonnyUtility | |
| // | |
| // Created by Jonny Kuang on 10/7/19. | |
| // Copyright © 2019 Junyu Kuang <[email protected]>. All rights reserved. | |
| // | |
| import UIKit |
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
| addmedia | |
| addphoto | |
| addvideo | |
| appinfo | |
| boot | |
| bootstatus | |
| clone | |
| create | |
| darwinup | |
| delete |
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
| // | |
| // UIView+Tooltips.h | |
| // Crossword | |
| // | |
| // Created by Steven Troughton-Smith on 13/09/2019. | |
| // Copyright © 2019 Steven Troughton-Smith. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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 SwiftUI Lab: Advanced SwiftUI Animations | |
| // https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths) | |
| // https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect) | |
| // https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier) | |
| //------------------------------------------------------------------------ | |
| import SwiftUI | |
| struct ContentView: View { | |
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
| // Don't forget to prefix your category! | |
| #import <UIKit/UIKit.h> | |
| NS_ASSUME_NONNULL_BEGIN | |
| @interface UIWindow (PSPDFAdditions) | |
| #if TARGET_OS_UIKITFORMAC |
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
| - (UIImage *)dynamicImage | |
| { | |
| UITraitCollection *const baseTraitCollection = /* an existing trait collection */; | |
| UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]]; | |
| UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; | |
| UITraitCollection *const darkTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]]; | |
| __block UIImage *lightImage; | |
| [lightTraitCollection performAsCurrentTraitCollection:^{ | |
| lightImage = /* draw image */; |
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
| import JavaScriptCore | |
| extension JSContext { | |
| subscript(key: String) -> Any { | |
| get { | |
| return self.objectForKeyedSubscript(key) | |
| } | |
| set{ | |
| self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
| } |
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
| /// This module contains useful extensions to the base | |
| /// navigation controllers in respect to managing orientation, | |
| /// as well as adding missing functionality to the sdk types. | |
| import Foundation | |
| func currentOrientation() -> UIInterfaceOrientation { | |
| return UIApplication.shared.statusBarOrientation | |
| } |
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
| import UIKit | |
| class MyTextLabel: UIView { | |
| var textLayer = CATextLayer() | |
| var textStorage: String = "" { | |
| didSet { | |
| textLayer.string = textStorage | |
| } | |
| } |
NewerOlder