Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 138dc8bf82 | |||
| 0b308f5ef5 | |||
| af94b7e30b | |||
| 14c138ec3e | |||
| 2691572392 | |||
| 1b9586e2d7 | |||
| a819e69cee | |||
| 88cd082d8e |
@@ -1,7 +1,7 @@
|
||||
name: CD
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
branches: [main]
|
||||
types: [closed]
|
||||
|
||||
@@ -61,4 +61,4 @@ jobs:
|
||||
🎉 New release ${{ steps.publish_release.outputs.tag_name }} is out 🚀
|
||||
|
||||
Check out all the changes here:
|
||||
${{ steps.publish_release.outputs.html_url }}
|
||||
${{ steps.publish_release.outputs.html_url }}
|
||||
|
||||
@@ -35,4 +35,16 @@ jobs:
|
||||
run: |
|
||||
set -eo pipefail
|
||||
pod lib lint --allow-warnings
|
||||
pod trunk push --allow-warnings
|
||||
pod trunk push --allow-warnings
|
||||
|
||||
- name: Tweet the release
|
||||
uses: ethomson/send-tweet-action@v1
|
||||
with:
|
||||
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
|
||||
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
|
||||
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
|
||||
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
|
||||
status: |
|
||||
🎉 New release ${{ steps.publish_release.outputs.tag_name }} is out 🚀
|
||||
Check out all the changes here:
|
||||
${{ steps.publish_release.outputs.html_url }}
|
||||
|
||||
@@ -268,7 +268,7 @@ You can set some properties for multilines elements.
|
||||
|
||||
| Property | Values | Default | Preview
|
||||
| ------- | ------- |------- | -------
|
||||
| **Filling percent** of the last line. | `0...100` | `70%` | 
|
||||
| **Filling percent** of the last line.<br/>Please note that for views without multiple lines, the single line will be considered as the last line and **lastLineFillPercent** will be applied to that single line. | `0...100` | `70%`| 
|
||||
| **Corner radius** of lines. (**NEW**) | `0...10` | `0` | 
|
||||
|
||||
|
||||
@@ -295,6 +295,8 @@ Default values:
|
||||
- *default: `SkeletonGradient(baseColor: .skeletonDefault)`*
|
||||
- **multilineHeight**: CGFloat
|
||||
- *default: 15*
|
||||
- **useFontLineHeight**: Bool
|
||||
- *default: true*
|
||||
- **multilineSpacing**: CGFloat
|
||||
- *default: 10*
|
||||
- **multilineLastLineFillPercent**: Int
|
||||
@@ -315,6 +317,7 @@ You can also specifiy these line appearance properties on a per-label basis:
|
||||
- **linesCornerRadius**: Int
|
||||
- **skeletonLineSpacing**: CGFloat
|
||||
- **skeletonPaddingInsets**: UIEdgeInsets
|
||||
- **useFontLineHeight**: Bool
|
||||
|
||||
|
||||
### 🎨 Custom colors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SkeletonView"
|
||||
s.version = "1.24.2"
|
||||
s.version = "1.25.0"
|
||||
s.summary = "An elegant way to show users that something is happening and also prepare them to which contents he is waiting"
|
||||
s.description = <<-DESC
|
||||
Today almost all apps have async processes, as API requests, long runing processes, etc. And while the processes are working, usually developers place a loading view to show users that something is going on.
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
F53D731B26D3A35100249D46 /* SkeletonExtended.swift in Sources */ = {isa = PBXBuildFile; fileRef = F53D731A26D3A35100249D46 /* SkeletonExtended.swift */; };
|
||||
F53D731C26D3A35100249D46 /* SkeletonExtended.swift in Sources */ = {isa = PBXBuildFile; fileRef = F53D731A26D3A35100249D46 /* SkeletonExtended.swift */; };
|
||||
F53D731F26D3AC4000249D46 /* SkeletonTreeNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F70726D38F3100A80B83 /* SkeletonTreeNode.swift */; };
|
||||
F53D732326D3C3A800249D46 /* UILabel+SKExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F53D732226D3C3A800249D46 /* UILabel+SKExtensions.swift */; };
|
||||
F53D732426D3C3A800249D46 /* UILabel+SKExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F53D732226D3C3A800249D46 /* UILabel+SKExtensions.swift */; };
|
||||
F556F56626CD1F3900A80B83 /* SkeletonAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* SkeletonAppearance.swift */; };
|
||||
F556F56726CD1F3900A80B83 /* SkeletonLayerBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_11 /* SkeletonLayerBuilder.swift */; };
|
||||
F556F56826CD1F3900A80B83 /* SkeletonMultilineLayerBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_12 /* SkeletonMultilineLayerBuilder.swift */; };
|
||||
@@ -86,8 +88,8 @@
|
||||
F556F6C726CE2A2100A80B83 /* UILabel+IBInspectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6C526CE2A2100A80B83 /* UILabel+IBInspectable.swift */; };
|
||||
F556F6C926CE2A4A00A80B83 /* UITextView+IBInspectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6C826CE2A4A00A80B83 /* UITextView+IBInspectable.swift */; };
|
||||
F556F6CA26CE2A4A00A80B83 /* UITextView+IBInspectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6C826CE2A4A00A80B83 /* UITextView+IBInspectable.swift */; };
|
||||
F556F6CC26CE2A7400A80B83 /* UITextView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CB26CE2A7400A80B83 /* UITextView+Extensions.swift */; };
|
||||
F556F6CD26CE2A7400A80B83 /* UITextView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CB26CE2A7400A80B83 /* UITextView+Extensions.swift */; };
|
||||
F556F6CC26CE2A7400A80B83 /* UITextView+SKExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CB26CE2A7400A80B83 /* UITextView+SKExtensions.swift */; };
|
||||
F556F6CD26CE2A7400A80B83 /* UITextView+SKExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CB26CE2A7400A80B83 /* UITextView+SKExtensions.swift */; };
|
||||
F556F6CF26CE2AB800A80B83 /* SkeletonTextNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CE26CE2AB800A80B83 /* SkeletonTextNode.swift */; };
|
||||
F556F6D026CE2AB800A80B83 /* SkeletonTextNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6CE26CE2AB800A80B83 /* SkeletonTextNode.swift */; };
|
||||
F556F6D926CE315A00A80B83 /* UICollectionView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F556F6D826CE315A00A80B83 /* UICollectionView+Extensions.swift */; };
|
||||
@@ -149,6 +151,7 @@
|
||||
/* Begin PBXFileReference section */
|
||||
F53D731726D399E100249D46 /* SkeletonTreeNode+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SkeletonTreeNode+Extensions.swift"; sourceTree = "<group>"; };
|
||||
F53D731A26D3A35100249D46 /* SkeletonExtended.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonExtended.swift; sourceTree = "<group>"; };
|
||||
F53D732226D3C3A800249D46 /* UILabel+SKExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+SKExtensions.swift"; sourceTree = "<group>"; };
|
||||
F556F51026CD1B7900A80B83 /* SkeletonView.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SkeletonView.podspec; sourceTree = "<group>"; };
|
||||
F556F51126CD1B8000A80B83 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
F556F51426CD1BFF00A80B83 /* README_zh.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README_zh.md; path = Translations/README_zh.md; sourceTree = "<group>"; };
|
||||
@@ -199,7 +202,7 @@
|
||||
F556F6C126CE27FD00A80B83 /* SkeletonType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonType.swift; sourceTree = "<group>"; };
|
||||
F556F6C526CE2A2100A80B83 /* UILabel+IBInspectable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+IBInspectable.swift"; sourceTree = "<group>"; };
|
||||
F556F6C826CE2A4A00A80B83 /* UITextView+IBInspectable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+IBInspectable.swift"; sourceTree = "<group>"; };
|
||||
F556F6CB26CE2A7400A80B83 /* UITextView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+Extensions.swift"; sourceTree = "<group>"; };
|
||||
F556F6CB26CE2A7400A80B83 /* UITextView+SKExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+SKExtensions.swift"; sourceTree = "<group>"; };
|
||||
F556F6CE26CE2AB800A80B83 /* SkeletonTextNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonTextNode.swift; sourceTree = "<group>"; };
|
||||
F556F6D826CE315A00A80B83 /* UICollectionView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Extensions.swift"; sourceTree = "<group>"; };
|
||||
F556F6DC26CE33CE00A80B83 /* UIView+Swizzling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Swizzling.swift"; sourceTree = "<group>"; };
|
||||
@@ -411,7 +414,6 @@
|
||||
F556F6BB26CE272600A80B83 /* UILabel+Extensions.swift */,
|
||||
OBJ_25 /* UITableView+CollectionSkeleton.swift */,
|
||||
OBJ_34 /* UITableView+Extensions.swift */,
|
||||
F556F6CB26CE2A7400A80B83 /* UITextView+Extensions.swift */,
|
||||
OBJ_39 /* UIView+AppLifecycleNotifications.swift */,
|
||||
F556F68226CD48F700A80B83 /* UIView+AssociatedObjects.swift */,
|
||||
OBJ_26 /* UIView+CollectionSkeleton.swift */,
|
||||
@@ -442,8 +444,10 @@
|
||||
F556F68626CD49F900A80B83 /* UIView+IBInspectable.swift */,
|
||||
F556F6A026CD566C00A80B83 /* UIView+SKExtensions.swift */,
|
||||
F556F6C526CE2A2100A80B83 /* UILabel+IBInspectable.swift */,
|
||||
F53D732226D3C3A800249D46 /* UILabel+SKExtensions.swift */,
|
||||
F556F6C826CE2A4A00A80B83 /* UITextView+IBInspectable.swift */,
|
||||
F556F6D826CE315A00A80B83 /* UICollectionView+Extensions.swift */,
|
||||
F556F6CB26CE2A7400A80B83 /* UITextView+SKExtensions.swift */,
|
||||
);
|
||||
path = UIKitExtensions;
|
||||
sourceTree = "<group>";
|
||||
@@ -797,7 +801,7 @@
|
||||
F556F56E26CD1F3900A80B83 /* SkeletonCollectionDataSource.swift in Sources */,
|
||||
F556F56F26CD1F3900A80B83 /* SkeletonCollectionDelegate.swift in Sources */,
|
||||
F556F68426CD48F700A80B83 /* UIView+AssociatedObjects.swift in Sources */,
|
||||
F556F6CD26CE2A7400A80B83 /* UITextView+Extensions.swift in Sources */,
|
||||
F556F6CD26CE2A7400A80B83 /* UITextView+SKExtensions.swift in Sources */,
|
||||
F556F57026CD1F3900A80B83 /* SkeletonTableViewProtocols.swift in Sources */,
|
||||
F556F57126CD1F3900A80B83 /* UITableView+CollectionSkeleton.swift in Sources */,
|
||||
F556F57226CD1F3900A80B83 /* UIView+CollectionSkeleton.swift in Sources */,
|
||||
@@ -814,6 +818,7 @@
|
||||
F53D731C26D3A35100249D46 /* SkeletonExtended.swift in Sources */,
|
||||
F556F6F626CE876300A80B83 /* UIView+Swizzling.swift in Sources */,
|
||||
F556F58126CD1F3900A80B83 /* Swizzling.swift in Sources */,
|
||||
F53D732426D3C3A800249D46 /* UILabel+SKExtensions.swift in Sources */,
|
||||
F556F6B626CE258300A80B83 /* GradientDirection+Animations.swift in Sources */,
|
||||
F556F69F26CD553B00A80B83 /* UIView+Extensions.swift in Sources */,
|
||||
F556F58526CD1F3900A80B83 /* Recoverable.swift in Sources */,
|
||||
@@ -877,7 +882,7 @@
|
||||
OBJ_94 /* SkeletonCollectionDataSource.swift in Sources */,
|
||||
OBJ_95 /* SkeletonCollectionDelegate.swift in Sources */,
|
||||
F556F68326CD48F700A80B83 /* UIView+AssociatedObjects.swift in Sources */,
|
||||
F556F6CC26CE2A7400A80B83 /* UITextView+Extensions.swift in Sources */,
|
||||
F556F6CC26CE2A7400A80B83 /* UITextView+SKExtensions.swift in Sources */,
|
||||
OBJ_96 /* SkeletonTableViewProtocols.swift in Sources */,
|
||||
OBJ_97 /* UITableView+CollectionSkeleton.swift in Sources */,
|
||||
OBJ_98 /* UIView+CollectionSkeleton.swift in Sources */,
|
||||
@@ -895,6 +900,7 @@
|
||||
F556F70826D38F3100A80B83 /* SkeletonTreeNode.swift in Sources */,
|
||||
OBJ_113 /* Swizzling.swift in Sources */,
|
||||
F556F6B526CE258300A80B83 /* GradientDirection+Animations.swift in Sources */,
|
||||
F53D732326D3C3A800249D46 /* UILabel+SKExtensions.swift in Sources */,
|
||||
F556F69E26CD553B00A80B83 /* UIView+Extensions.swift in Sources */,
|
||||
OBJ_117 /* Recoverable.swift in Sources */,
|
||||
OBJ_118 /* RecoverableViewState.swift in Sources */,
|
||||
|
||||
@@ -27,6 +27,8 @@ public class SkeletonViewAppearance {
|
||||
|
||||
public var multilineHeight: CGFloat = 15
|
||||
|
||||
public var useFontLineHeight: Bool = true
|
||||
|
||||
public var multilineSpacing: CGFloat = 10
|
||||
|
||||
public var multilineLastLineFillPercent: Int = 70
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright SkeletonView. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the MIT License (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://opensource.org/licenses/MIT
|
||||
//
|
||||
// UILabel+SKExtensions.swift
|
||||
//
|
||||
// Created by Juanpe Catalán on 23/8/21.
|
||||
|
||||
import UIKit
|
||||
|
||||
public extension UILabel {
|
||||
|
||||
var skeletonPaddingInsets: UIEdgeInsets {
|
||||
get { return paddingInsets }
|
||||
set { paddingInsets = newValue }
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -7,13 +7,13 @@
|
||||
//
|
||||
// https://opensource.org/licenses/MIT
|
||||
//
|
||||
// UITextView+Extensions.swift
|
||||
// UITextView+SKExtensions.swift
|
||||
//
|
||||
// Created by Juanpe Catalán on 19/8/21.
|
||||
|
||||
import UIKit
|
||||
|
||||
extension UITextView {
|
||||
public extension UITextView {
|
||||
|
||||
var skeletonPaddingInsets: UIEdgeInsets {
|
||||
get { return paddingInsets }
|
||||
@@ -50,7 +50,7 @@ extension UILabel: SkeletonTextNode {
|
||||
}
|
||||
|
||||
var usesTextHeightForLines: Bool {
|
||||
get { return ao_get(pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) as? Bool ?? true }
|
||||
get { return ao_get(pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) as? Bool ?? SkeletonAppearance.default.useFontLineHeight }
|
||||
set { ao_set(newValue, pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) }
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ extension UITextView: SkeletonTextNode {
|
||||
}
|
||||
|
||||
var usesTextHeightForLines: Bool {
|
||||
get { return ao_get(pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) as? Bool ?? true }
|
||||
get { return ao_get(pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) as? Bool ?? SkeletonAppearance.default.useFontLineHeight }
|
||||
set { ao_set(newValue, pkey: &SkeletonTextNodeAssociatedKeys.usesTextHeightForLines) }
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ private extension CALayer {
|
||||
|
||||
func calculatedWidthForLine(at index: Int, totalLines: Int, lastLineFillPercent: Int, paddingInsets: UIEdgeInsets) -> CGFloat {
|
||||
var width = bounds.width - paddingInsets.left - paddingInsets.right
|
||||
if index == totalLines - 1 && totalLines != 1 {
|
||||
if index == totalLines - 1 {
|
||||
width = width * CGFloat(lastLineFillPercent) / 100
|
||||
}
|
||||
return width
|
||||
@@ -197,7 +197,7 @@ extension CALayer {
|
||||
width: size.width,
|
||||
height: size.height)
|
||||
|
||||
if index == totalLines - 1 && totalLines != 1 {
|
||||
if index == totalLines - 1 {
|
||||
frame = alignLayerFrame(newFrame, alignment: alignment, isRTL: isRTL)
|
||||
} else {
|
||||
frame = newFrame
|
||||
|
||||
@@ -15,11 +15,6 @@ import UIKit
|
||||
|
||||
extension UILabel {
|
||||
|
||||
var skeletonPaddingInsets: UIEdgeInsets {
|
||||
get { return paddingInsets }
|
||||
set { paddingInsets = newValue }
|
||||
}
|
||||
|
||||
var desiredHeightBasedOnNumberOfLines: CGFloat {
|
||||
let spaceNeededForEachLine = lineHeight * CGFloat(numberOfLines)
|
||||
let spaceNeededForSpaces = skeletonLineSpacing * CGFloat(numberOfLines - 1)
|
||||
|
||||
Reference in New Issue
Block a user