added files via upload

This commit is contained in:
Balackburn
2023-06-27 09:54:41 +02:00
commit 2ff6aac218
1420 changed files with 88898 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,35 @@
//
// AppDelegate.swift
// Alderis Demo
//
// Created by Adam Demasi on 12/3/20.
// Copyright © 2020 HASHBANG Productions. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// swiftlint:disable:next line_length
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window!.tintColor = UIColor(hue: 0.939614, saturation: 0.811765, brightness: 0.333333, alpha: 1)
let tabBarController = UITabBarController()
let viewController = UINavigationController(rootViewController: FirstViewController())
if #available(iOS 13, *) {
let tabIcon = UIImage(systemName: "paintbrush.fill")?.withBaselineOffset(fromBottom: 2)
viewController.tabBarItem = UITabBarItem(title: "Alderis Demo", image: tabIcon, tag: 0)
}
tabBarController.viewControllers = [viewController]
window!.rootViewController = tabBarController
window!.makeKeyAndVisible()
return true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,102 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "AppIcon120x120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "AppIcon180x180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "AppIcon152x152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "AppIcon167x167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,321 @@
//
// FirstViewController.swift
// Alderis Demo
//
// Created by Adam Demasi on 15/4/20.
// Copyright © 2020 HASHBANG Productions. All rights reserved.
//
import UIKit
import Alderis
class FirstViewController: UIViewController {
private var color = UIColor(hue: 0.939614, saturation: 0.811765, brightness: 0.333333, alpha: 1)
private var colorWell: ColorWell!
private var uikitWell: UIView?
// swiftlint:disable:next function_body_length
override func viewDidLoad() {
super.viewDidLoad()
title = "Alderis Demo"
if #available(iOS 13, *) {
view.backgroundColor = .systemBackground
} else {
view.backgroundColor = .white
}
#if targetEnvironment(macCatalyst)
navigationController?.isNavigationBarHidden = true
#endif
let stackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.alignment = .center
stackView.spacing = 10
view.addSubview(stackView)
let mainButton = UIButton(type: .system)
if #available(iOS 15, *) {
var config = UIButton.Configuration.filled()
config.buttonSize = .large
mainButton.configuration = config
} else {
mainButton.titleLabel!.font = UIFont.systemFont(ofSize: 34, weight: .semibold)
}
mainButton.setTitle("Present", for: .normal)
mainButton.addTarget(self, action: #selector(self.presentColorPicker), for: .touchUpInside)
stackView.addArrangedSubview(mainButton)
// swiftlint:disable comma
let buttons: [(title: String, action: Selector)] = [
("Present with customised title", #selector(presentColorPickerCustomisedTitle)),
("Present with customised initial tab", #selector(presentColorPickerCustomisedInitialTab)),
("Present with customised tabs", #selector(presentColorPickerCustomisedTabs)),
("Present with tabs hidden", #selector(presentColorPickerNoTabs)),
("Present with customised title, tabs hidden", #selector(presentColorPickerCustomisedTitleNoTabs)),
("Present without alpha", #selector(presentColorPickerNoAlpha)),
("Present without overriding Smart Invert", #selector(presentColorPickerNoOverrideSmartInvert)),
("Present using deprecated API", #selector(presentColorPickerDeprecatedAPI)),
("Present UIKit Color Picker", #selector(presentUIKitColorPicker))
]
// swiftlint:enable comma
for item in buttons {
let button = UIButton(type: .system)
if #available(iOS 15, *) {
var config = UIButton.Configuration.plain()
config.buttonSize = .mini
config.macIdiomStyle = .borderlessTinted
button.configuration = config
}
button.setTitle(item.title, for: .normal)
button.addTarget(self, action: item.action, for: .touchUpInside)
stackView.addArrangedSubview(button)
}
let spacerView = UIView()
stackView.addArrangedSubview(spacerView)
let wellsLabel = UILabel()
wellsLabel.font = UIFont.preferredFont(forTextStyle: .headline)
wellsLabel.textAlignment = .center
wellsLabel.text = "Color wells (try out drag and drop!)"
stackView.addArrangedSubview(wellsLabel)
colorWell = ColorWell()
colorWell.isDragInteractionEnabled = true
colorWell.isDropInteractionEnabled = true
colorWell.addTarget(self, action: #selector(self.colorWellValueChanged(_:)), for: .valueChanged)
colorWell.addTarget(self, action: #selector(self.presentColorPicker), for: .touchUpInside)
let dragOrDropColorWell = ColorWell()
dragOrDropColorWell.isDragInteractionEnabled = true
dragOrDropColorWell.isDropInteractionEnabled = true
dragOrDropColorWell.color = .systemPurple
let nonDraggableWell = ColorWell()
nonDraggableWell.isDragInteractionEnabled = false
nonDraggableWell.isDropInteractionEnabled = true
nonDraggableWell.color = .systemOrange
let nonDroppableWell = ColorWell()
nonDroppableWell.isDragInteractionEnabled = true
nonDroppableWell.isDropInteractionEnabled = false
nonDroppableWell.color = .systemTeal
let nonDragOrDropWell = ColorWell()
nonDragOrDropWell.isDragInteractionEnabled = false
nonDragOrDropWell.isDropInteractionEnabled = false
nonDragOrDropWell.color = .systemGreen
let wellsStackView = UIStackView(arrangedSubviews: [colorWell,
dragOrDropColorWell,
nonDraggableWell,
nonDroppableWell,
nonDragOrDropWell])
wellsStackView.translatesAutoresizingMaskIntoConstraints = false
wellsStackView.axis = .horizontal
wellsStackView.alignment = .center
wellsStackView.spacing = 10
if #available(iOS 14, *) {
let uikitWell = UIColorWell()
uikitWell.addTarget(self, action: #selector(self.uikitColorWellValueChanged(_:)), for: .valueChanged)
wellsStackView.addArrangedSubview(uikitWell)
self.uikitWell = uikitWell
}
stackView.addArrangedSubview(wellsStackView)
NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 15),
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -15),
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
spacerView.heightAnchor.constraint(equalToConstant: 0)
])
var isMac = false
if #available(iOS 14, *) {
isMac = UIDevice.current.userInterfaceIdiom == .mac
}
NSLayoutConstraint.activate(wellsStackView.arrangedSubviews.flatMap { view in
[
view.widthAnchor.constraint(equalToConstant: isMac ? 24 : 32),
view.heightAnchor.constraint(equalTo: view.widthAnchor)
]
})
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
view.window!.tintColor = color
colorWell.color = color
if #available(iOS 14, *),
let uikitWell = uikitWell as? UIColorWell {
uikitWell.selectedColor = color
}
}
@objc func colorWellValueChanged(_ sender: ColorWell) {
NSLog("Color well value changed with value %@", String(describing: sender.color))
view.window!.tintColor = sender.color
if #available(iOS 14, *),
let uikitWell = uikitWell as? UIColorWell {
uikitWell.selectedColor = sender.color
}
}
@available(iOS 14, *)
@objc func uikitColorWellValueChanged(_ sender: UIColorWell) {
NSLog("UIKit color well value changed with value %@", String(describing: sender.selectedColor))
view.window!.tintColor = sender.selectedColor
colorWell.color = sender.selectedColor
}
@objc func presentColorPicker(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerCustomisedTitle(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.title = "Select an Awesome Color"
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerCustomisedInitialTab(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.initialTab = .map
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerCustomisedTabs(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.visibleTabs = [.map, .sliders]
configuration.initialTab = .sliders
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerNoAlpha(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color.withAlphaComponent(0.5))
configuration.supportsAlpha = false
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerNoTabs(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.showTabs = false
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerCustomisedTitleNoTabs(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.title = "Select an Awesome Color"
configuration.showTabs = false
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerNoOverrideSmartInvert(_ sender: UIView) {
let configuration = ColorPickerConfiguration(color: color)
configuration.overrideSmartInvert = false
let colorPickerViewController = ColorPickerViewController(configuration: configuration)
colorPickerViewController.delegate = self
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentColorPickerDeprecatedAPI(_ sender: UIView) {
let colorPickerViewController = ColorPickerViewController()
colorPickerViewController.delegate = self
colorPickerViewController.color = color
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
}
@objc func presentUIKitColorPicker(_ sender: UIView) {
if #available(iOS 14, *) {
let colorPickerViewController = UIColorPickerViewController()
colorPickerViewController.delegate = self
colorPickerViewController.selectedColor = color
colorPickerViewController.popoverPresentationController?.sourceView = sender
tabBarController!.present(colorPickerViewController, animated: true)
} else {
fatalError("UIColorPickerViewController is only available as of iOS 14")
}
}
}
extension FirstViewController: ColorPickerDelegate {
func colorPicker(_ colorPicker: ColorPickerViewController, didSelect color: UIColor) {
NSLog("User selected color %@ (%@)", color.propertyListValue, String(describing: color))
self.color = color
view.window!.tintColor = color
colorWell.color = color
}
func colorPicker(_ colorPicker: ColorPickerViewController, didAccept color: UIColor) {
NSLog("User accepted color %@ (%@)", color.propertyListValue, String(describing: color))
}
func colorPickerDidCancel(_ colorPicker: ColorPickerViewController) {
NSLog("Color picker cancelled")
}
}
@available(iOS 14, *)
extension FirstViewController: UIColorPickerViewControllerDelegate {
func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) {
NSLog("UIKit color picker value changed with color %@ (%@)",
viewController.selectedColor.propertyListValue,
String(describing: viewController.selectedColor))
color = viewController.selectedColor
view.window!.tintColor = viewController.selectedColor
if let uikitWell = uikitWell as? UIColorWell {
uikitWell.selectedColor = viewController.selectedColor
}
}
func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) {
NSLog("UIKit color picker finished")
}
}

View File

@@ -0,0 +1,19 @@
//
// HBColorPickerSectionHeaderView.h
// Alderis Demo
//
// Created by Adam Demasi on 31/3/19.
// Copyright © 2019 HASHBANG Productions. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface HBColorPickerSectionHeaderView : UICollectionReusableView
@property (nonatomic, strong) UILabel *titleLabel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,43 @@
//
// HBColorPickerSectionHeaderView.m
// Alderis Demo
//
// Created by Adam Demasi on 31/3/19.
// Copyright © 2019 HASHBANG Productions. All rights reserved.
//
#import "HBColorPickerSectionHeaderView.h"
#import "CompactConstraint.h"
@implementation HBColorPickerSectionHeaderView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont boldSystemFontOfSize:18.f];
[self addSubview:_titleLabel];
[self hb_addCompactConstraints:@[
@"titleLabel.left = self.left + horizontalMargin",
@"titleLabel.right = self.right - horizontalMargin",
@"titleLabel.top = self.top + topMargin",
@"titleLabel.bottom = self.bottom - bottomMargin"
]
metrics:@{
@"horizontalMargin": @15.f,
@"topMargin": @10.f,
@"bottomMargin": @0.f
}
views:@{
@"self": self,
@"titleLabel": _titleLabel
}];
}
return self;
}
@end

View File

@@ -0,0 +1,17 @@
//
// HBColorPickerSwatchCell.h
// Alderis Demo
//
// Created by Adam Demasi on 4/3/19.
// Copyright © 2019 HASHBANG Productions. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface HBColorPickerSwatchCell : UICollectionViewCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,32 @@
//
// HBColorPickerSwatchCell.m
// Alderis Demo
//
// Created by Adam Demasi on 4/3/19.
// Copyright © 2019 HASHBANG Productions. All rights reserved.
//
#import "HBColorPickerSwatchCell.h"
@implementation HBColorPickerSwatchCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.clipsToBounds = YES;
// self.layer.cornerRadius = 22.f;
// self.layer.borderColor = [UIColor grayColor].CGColor;
}
return self;
}
- (void)didMoveToWindow {
[super didMoveToWindow];
// CGFloat scale = self.window.screen.scale ?: 1.f;
// self.layer.borderWidth = scale > 2.f ? 2.f / scale : 1.f / scale;
}
@end

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Alderis Demo</string>
<key>CFBundleDisplayName</key>
<string>Alderis Demo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>