Compare commits

...

7 Commits

Author SHA1 Message Date
Alexander Rutsman 657e0bfbef fix: removed LabeledScrollView, added attributedText 2021-12-15 10:55:35 +03:00
Alexander Rutsman 9c5c626223 fix: changelog text 2021-11-02 00:33:06 +03:00
Alexander Rutsman 22a2f76752 refactor: added properties 2021-11-02 00:16:00 +03:00
Alexander Rutsman 47b2119cfd docs: update docs 2021-11-02 00:12:26 +03:00
Alexander Rutsman f643013760 refactor: added copyrights 2021-11-01 23:16:42 +03:00
Alexander Rutsman a667e3adf2 chore: bump version 1.8.0 2021-11-01 23:12:50 +03:00
Alexander Rutsman 8e1c044abc feat: added TIScrollLabel 2021-11-01 23:05:27 +03:00
14 changed files with 209 additions and 9 deletions

View File

@ -1,5 +1,8 @@
# Changelog # Changelog
### 1.8.0
- **Add**: `TIScrollLabel` - the scroll view with label - TIScrollLabel
### 1.7.0 ### 1.7.0
- **Add**: `TINetworking` - Swagger-frendly networking layer helpers - **Add**: `TINetworking` - Swagger-frendly networking layer helpers

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "LeadKit" s.name = "LeadKit"
s.version = "1.7.0" s.version = "1.8.0"
s.summary = "iOS framework with a bunch of tools for rapid development" s.summary = "iOS framework with a bunch of tools for rapid development"
s.homepage = "https://github.com/TouchInstinct/LeadKit" s.homepage = "https://github.com/TouchInstinct/LeadKit"
s.license = "Apache License, Version 2.0" s.license = "Apache License, Version 2.0"

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TIFoundationUtils' s.name = 'TIFoundationUtils'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Set of helpers for Foundation framework classes.' s.summary = 'Set of helpers for Foundation framework classes.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TIKeychainUtils' s.name = 'TIKeychainUtils'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Set of helpers for Keychain classes.' s.summary = 'Set of helpers for Keychain classes.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TINetworking' s.name = 'TINetworking'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Swagger-frendly networking layer helpers.' s.summary = 'Swagger-frendly networking layer helpers.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TISwiftUtils' s.name = 'TISwiftUtils'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Bunch of useful helpers for Swift development.' s.summary = 'Bunch of useful helpers for Swift development.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TITableKitUtils' s.name = 'TITableKitUtils'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Set of helpers for TableKit classes.' s.summary = 'Set of helpers for TableKit classes.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TITransitions' s.name = 'TITransitions'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Set of custom transitions to present controller. ' s.summary = 'Set of custom transitions to present controller. '
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -3,6 +3,7 @@
Bunch of useful protocols and views: Bunch of useful protocols and views:
- `RefreshControl` - a basic UIRefreshControl with fixed refresh action. - `RefreshControl` - a basic UIRefreshControl with fixed refresh action.
- `TIScrollLabel` - a basic scroll view with label.
# HeaderTransitionDelegate # HeaderTransitionDelegate
Use for transition table header to navigationBar view while scrolling Use for transition table header to navigationBar view while scrolling

View File

@ -0,0 +1,59 @@
//
// Copyright (c) 2021 Touch Instinct
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the Software), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import TIUIKitCore
import UIKit
open class BaseInitializableScrollView: UIScrollView, InitializableViewProtocol {
override public init(frame: CGRect) {
super.init(frame: frame)
initializeView()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initializeView()
}
// MARK: - InitializableView
open func addViews() {
// override in subclass
}
open func configureLayout() {
// override in subclass
}
open func bindViews() {
// override in subclass
}
open func configureAppearance() {
// override in subclass
}
open func localize() {
// override in subclass
}
}

View File

@ -0,0 +1,17 @@
# TIScrollLabel
Позволяет скролить текст, если его размер больше чем размер вью.
### Особенности
- Если размер текста будет меньше, чем размер вью, то текст будет отображаться в центре
### Пример использования
```swift
label = TIScrollLabel()
label.text = // установка текста
label.font = // установка шрифта
label.textColor = // установка цвета текста
label.textAligment = // установка расположения текста
```

View File

@ -0,0 +1,120 @@
//
// Copyright (c) 2021 Touch Instinct
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the Software), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
import TIUIElements
open class TIScrollLabel: BaseInitializableScrollView {
private let textLabel = UILabel()
private let contentView = UIView()
// MARK: - Configurable Properties
public var text: String = "" {
didSet {
textLabel.text = text
}
}
public var attributedText: NSAttributedString? = nil {
didSet {
textLabel.attributedText = attributedText
}
}
public var textColor: UIColor = .black {
didSet {
textLabel.textColor = textColor
}
}
public var font: UIFont = UIFont.systemFont(ofSize: 13) {
didSet {
textLabel.font = font
}
}
public var textAlignment: NSTextAlignment = .center {
didSet {
textLabel.textAlignment = textAlignment
}
}
// MARK: - Initialization
open override func addViews() {
super.addViews()
addSubview(contentView)
contentView.addSubview(textLabel)
}
open override func configureAppearance() {
super.configureAppearance()
showsVerticalScrollIndicator = false
showsHorizontalScrollIndicator = false
backgroundColor = .clear
clipsToBounds = true
textLabel.numberOfLines = 0
textLabel.textAlignment = textAlignment
textLabel.textColor = textColor
textLabel.font = font
}
open override func configureLayout() {
super.configureLayout()
contentView.translatesAutoresizingMaskIntoConstraints = false
textLabel.translatesAutoresizingMaskIntoConstraints = false
let contentViewBottomConstraint = contentView.bottomAnchor.constraint(equalTo: bottomAnchor)
let contentViewCenterYConstraint = contentView.centerYAnchor.constraint(equalTo: centerYAnchor)
let contentViewHeightConstraint = contentView.heightAnchor.constraint(equalTo: heightAnchor)
[
contentViewBottomConstraint,
contentViewCenterYConstraint,
contentViewHeightConstraint
].forEach { $0.priority = .defaultLow }
NSLayoutConstraint.activate([
contentView.leadingAnchor.constraint(equalTo: leadingAnchor),
contentView.trailingAnchor.constraint(equalTo: trailingAnchor),
contentView.topAnchor.constraint(equalTo: topAnchor),
contentView.centerXAnchor.constraint(equalTo: centerXAnchor),
contentViewBottomConstraint,
contentViewCenterYConstraint,
contentViewHeightConstraint
])
NSLayoutConstraint.activate([
textLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
textLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
textLabel.topAnchor.constraint(equalTo: contentView.topAnchor),
textLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
textLabel.heightAnchor.constraint(equalTo: contentView.heightAnchor)
])
}
}

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TIUIElements' s.name = 'TIUIElements'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Bunch of useful protocols and views.' s.summary = 'Bunch of useful protocols and views.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'TIUIKitCore' s.name = 'TIUIKitCore'
s.version = '1.7.0' s.version = '1.8.0'
s.summary = 'Core UI elements: protocols, views and helpers.' s.summary = 'Core UI elements: protocols, views and helpers.'
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
s.license = { :type => 'MIT', :file => 'LICENSE' } s.license = { :type => 'MIT', :file => 'LICENSE' }