Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
helje5 committed Oct 24, 2021
2 parents 281e065 + 0926aeb commit 43f9373
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Legal

By submitting a pull request, you represent that you have the right to license
your contribution to ZeeZide and the community, and agree by submitting the patch
that your contributions are licensed under the MIT license.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2018 ZeeZide GmbH
Copyright (c) 2017-2021 ZeeZide GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 3 additions & 2 deletions Sources/UXKit/AppKit/UXFont-AppKit.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//
// UXKit
//
// Copyright © 2016-2017 ZeeZide GmbH. All rights reserved.
// Copyright © 2016-2021 ZeeZide GmbH. All rights reserved.
//
#if os(macOS)
import Cocoa

public typealias UXFont = NSFont
public typealias UXFont = NSFont
public typealias NSUnderlineStyle = AppKit.NSUnderlineStyle
#endif
36 changes: 29 additions & 7 deletions Sources/UXKit/Common/UXTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,45 @@
// UXKit
//
// Created by Helge Heß on 16.05.20.
// Copyright © 2020 ZeeZide GmbH. All rights reserved.
// Copyright © 2020-2021 ZeeZide GmbH. All rights reserved.
//

#if !os(macOS)
import class UIKit.NSTextStorage
import class UIKit.NSLayoutManager
import class UIKit.NSTextContainer
import class UIKit.NSTextStorage
import class UIKit.NSLayoutManager
import class UIKit.NSTextContainer
import struct UIKit.NSTextStorageEditActions
import class UIKit.UITextView

public typealias NSTextStorage = UIKit.NSTextStorage
public typealias NSLayoutManager = UIKit.NSLayoutManager
public typealias NSTextContainer = UIKit.NSTextContainer

public typealias NSTextStorageEditActions = UIKit.NSTextStorage.EditActions

public extension UITextView {

@inlinable
var string : String { // NeXTstep was right!
set { text = newValue}
get { return text }
}
}
#else // macOS
import class AppKit.NSTextStorage
import class AppKit.NSLayoutManager
import class AppKit.NSTextContainer
import class AppKit.NSTextStorage
import class AppKit.NSLayoutManager
import class AppKit.NSTextContainer
import struct AppKit.NSTextStorageEditActions

public typealias NSTextStorage = AppKit.NSTextStorage
public typealias NSLayoutManager = AppKit.NSLayoutManager
public typealias NSTextContainer = AppKit.NSTextContainer

@available(macOS 10.11, *)
public typealias NSTextStorageEditActions = AppKit.NSTextStorageEditActions

@available(macOS 10.11, *)
public extension NSTextStorage {
typealias EditActions = NSTextStorageEditActions
}
#endif // macOS
24 changes: 21 additions & 3 deletions Sources/UXKit/UIKit/UXFont-UIKit.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
//
// UXKit
//
// Copyright © 2016-2017 ZeeZide GmbH. All rights reserved.
// Copyright © 2016-2021 ZeeZide GmbH. All rights reserved.
//
#if !os(macOS)
import UIKit

public typealias UXFont = UIFont
#endif
public typealias UXFont = UIFont
public typealias NSUnderlineStyle = UIKit.NSUnderlineStyle

public extension UXFont {

/**
* macOS compat. Only works on iOS 13+ (otherwise returns nil).
*
* Calls into `UIFont.monospacedSystemFont()`.
*/
static func userFixedPitchFont(ofSize size: CGFloat) -> UXFont? {
if #available(iOS 13.0, *) {
return UIFont.monospacedSystemFont(ofSize: size, weight: .regular)
}
else {
return nil
}
}
}
#endif // !os(macOS)
2 changes: 1 addition & 1 deletion UXKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
E8A9B22E1FBB318700C1063B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = "ZeeZide GmbH";
TargetAttributes = {
E85CBD30233F736A0065D1DB = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 43f9373

Please sign in to comment.