Compare commits
7 Commits
master
...
feature/ad
| Author | SHA1 | Date |
|---|---|---|
|
|
657e0bfbef | |
|
|
9c5c626223 | |
|
|
22a2f76752 | |
|
|
47b2119cfd | |
|
|
f643013760 | |
|
|
a667e3adf2 | |
|
|
8e1c044abc |
|
|
@ -1,5 +1,8 @@
|
|||
# Changelog
|
||||
|
||||
### 1.8.0
|
||||
- **Add**: `TIScrollLabel` - the scroll view with label - TIScrollLabel
|
||||
|
||||
### 1.7.0
|
||||
- **Add**: `TINetworking` - Swagger-frendly networking layer helpers
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
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.homepage = "https://github.com/TouchInstinct/LeadKit"
|
||||
s.license = "Apache License, Version 2.0"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TIFoundationUtils'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Set of helpers for Foundation framework classes.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TIKeychainUtils'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Set of helpers for Keychain classes.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TINetworking'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Swagger-frendly networking layer helpers.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TISwiftUtils'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Bunch of useful helpers for Swift development.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TITableKitUtils'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Set of helpers for TableKit classes.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TITransitions'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Set of custom transitions to present controller. '
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
Bunch of useful protocols and views:
|
||||
|
||||
- `RefreshControl` - a basic UIRefreshControl with fixed refresh action.
|
||||
- `TIScrollLabel` - a basic scroll view with label.
|
||||
|
||||
# HeaderTransitionDelegate
|
||||
Use for transition table header to navigationBar view while scrolling
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# TIScrollLabel
|
||||
|
||||
Позволяет скролить текст, если его размер больше чем размер вью.
|
||||
|
||||
### Особенности
|
||||
|
||||
- Если размер текста будет меньше, чем размер вью, то текст будет отображаться в центре
|
||||
|
||||
### Пример использования
|
||||
|
||||
```swift
|
||||
label = TIScrollLabel()
|
||||
label.text = // установка текста
|
||||
label.font = // установка шрифта
|
||||
label.textColor = // установка цвета текста
|
||||
label.textAligment = // установка расположения текста
|
||||
```
|
||||
|
|
@ -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)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TIUIElements'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Bunch of useful protocols and views.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'TIUIKitCore'
|
||||
s.version = '1.7.0'
|
||||
s.version = '1.8.0'
|
||||
s.summary = 'Core UI elements: protocols, views and helpers.'
|
||||
s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
|
|
|
|||
Loading…
Reference in New Issue