Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #65 from inloop/bugfix/carret_position_is_invalid_…
Browse files Browse the repository at this point in the history
…while_editing_text

FIX: Carret position is invalid if editing text not at the end
  • Loading branch information
radimhalfar authored Mar 16, 2018
2 parents 917f953 + 5e7760d commit 8249db2
Show file tree
Hide file tree
Showing 41 changed files with 1,714 additions and 1,466 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Styles (0.20.13)
- Styles/Tests (0.20.13)
- Styles (0.21.13)
- Styles/Tests (0.21.13)

DEPENDENCIES:
- Styles (from `../`)
Expand All @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
Styles: fee11706b0fe711ef7fcfbedbacec50d2f8e3eb0
Styles: bec3e866bceb263a0aaa48ae7894bedfa5997343

PODFILE CHECKSUM: f5341d1bc44d76e5ca1e0d50940004053970d8dc

Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/Styles.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/Styles/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Example/Pods/Target Support Files/Styles/Info.plist.orig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Example/Styles.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
CE850FB8205BDFB900C62E35 /* MatchPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE850FB7205BDFB900C62E35 /* MatchPickerViewController.swift */; };
CE850FBA205BDFED00C62E35 /* MatchPicker.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE850FB9205BDFED00C62E35 /* MatchPicker.storyboard */; };
CE850FBC205BFB1C00C62E35 /* UIFont+CodeDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE850FBB205BFB1C00C62E35 /* UIFont+CodeDescription.swift */; };
CE850FBF205C034700C62E35 /* UIElements.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE850FBE205C034700C62E35 /* UIElements.storyboard */; };
CE850FC1205C044000C62E35 /* UIElementsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE850FC0205C044000C62E35 /* UIElementsViewController.swift */; };
E85D480F059FB7239992BE0B /* Pods_Styles_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5E944D2434D454E67C3D05E /* Pods_Styles_Example.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -105,6 +107,8 @@
CE850FB7205BDFB900C62E35 /* MatchPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchPickerViewController.swift; sourceTree = "<group>"; };
CE850FB9205BDFED00C62E35 /* MatchPicker.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MatchPicker.storyboard; sourceTree = "<group>"; };
CE850FBB205BFB1C00C62E35 /* UIFont+CodeDescription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+CodeDescription.swift"; sourceTree = "<group>"; };
CE850FBE205C034700C62E35 /* UIElements.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = UIElements.storyboard; sourceTree = "<group>"; };
CE850FC0205C044000C62E35 /* UIElementsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIElementsViewController.swift; sourceTree = "<group>"; };
F5E944D2434D454E67C3D05E /* Pods_Styles_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Styles_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -243,6 +247,7 @@
CE78DE8C2057EE8B00A5DCFE /* FeaturesTabBarController.swift */,
CE6CD1FD202DC08200DA4491 /* Features.storyboard */,
CE1439CF205815FC00C7EA94 /* CustomStyle */,
CE850FBD205C032000C62E35 /* UIElements */,
CE78DE872057D68200A5DCFE /* Features */,
);
path = Scenes;
Expand Down Expand Up @@ -362,6 +367,15 @@
path = MatchPicker;
sourceTree = "<group>";
};
CE850FBD205C032000C62E35 /* UIElements */ = {
isa = PBXGroup;
children = (
CE850FBE205C034700C62E35 /* UIElements.storyboard */,
CE850FC0205C044000C62E35 /* UIElementsViewController.swift */,
);
path = UIElements;
sourceTree = "<group>";
};
D189273C33F2BBE6BCBA13A5 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -439,6 +453,7 @@
CE850F90205A7F9700C62E35 /* DefineTextStyle.storyboard in Resources */,
CE1439D82058202400C7EA94 /* DefineViewStyle.storyboard in Resources */,
CE1439DE2059308900C7EA94 /* ColorPicker.storyboard in Resources */,
CE850FBF205C034700C62E35 /* UIElements.storyboard in Resources */,
CE850F99205BB61300C62E35 /* TextDecoration.storyboard in Resources */,
CE6CD202202DC08200DA4491 /* LaunchScreen.xib in Resources */,
CE6CD203202DC08200DA4491 /* Features.storyboard in Resources */,
Expand Down Expand Up @@ -517,6 +532,7 @@
CE850FB3205BD52F00C62E35 /* TextEffect+Definition.swift in Sources */,
CE850FAF205BD04300C62E35 /* TextEffectsViewController.swift in Sources */,
CE1439CC20580BD600C7EA94 /* TextEffect+Defaults.swift in Sources */,
CE850FC1205C044000C62E35 /* UIElementsViewController.swift in Sources */,
CE850FA1205BBB4600C62E35 /* NSTextAlignment+CodeDescription.swift in Sources */,
CE6CD201202DC08200DA4491 /* AppDelegate.swift in Sources */,
CE850F93205A921A00C62E35 /* FontPickerViewController.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Example/Styles/Sources/Extensions/Match+Definition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import Styles

struct MatchDefinition {
let match: Match
let matchDescription: String
let match: Match
let matchDescription: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import UIKit

extension NSTextAlignment {
var codeDescription: String {
switch self {
case .center:
return ".center"
case .left:
return ".left"
case .right:
return ".right"
case .justified:
return ".justified"
case .natural:
return ".natural"
}
}
var codeDescription: String {
switch self {
case .center:
return ".center"
case .left:
return ".left"
case .right:
return ".right"
case .justified:
return ".justified"
case .natural:
return ".natural"
}
}
}
38 changes: 19 additions & 19 deletions Example/Styles/Sources/Extensions/Shadow+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
import Styles

extension Shadow {
struct ShadowDefinition {
let shadow: Shadow
let shadowDescription: String
}
struct ShadowDefinition {
let shadow: Shadow
let shadowDescription: String
}

static let magenta = Shadow(
color: .magenta,
offset: UIOffset(horizontal: 1, vertical: 1),
radius: 4
)
static let magenta = Shadow(
color: .magenta,
offset: UIOffset(horizontal: 1, vertical: 1),
radius: 4
)

static let blue = Shadow(
color: .blue,
offset: UIOffset(horizontal: 4, vertical: 4),
radius: 4
)
static let blue = Shadow(
color: .blue,
offset: UIOffset(horizontal: 4, vertical: 4),
radius: 4
)

static let red = Shadow(
color: .red,
offset: UIOffset(horizontal: 0, vertical: 8),
radius: 16
)
static let red = Shadow(
color: .red,
offset: UIOffset(horizontal: 0, vertical: 8),
radius: 16
)
}
38 changes: 19 additions & 19 deletions Example/Styles/Sources/Extensions/TextDecoration+Definition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
import Styles

extension TextDecoration {
struct Definition {
let decoration: TextDecoration
let decorationDescription: String
}
struct Definition {
let decoration: TextDecoration
let decorationDescription: String
}
}

extension TextDecoration.Pattern {
var codeDescription: String {
switch self {
case .dot: return ".dot"
case .dash: return ".dash"
case .dashDot: return ".dashDot"
case .dashDotDot: return ".dashDotDot"
}
}
var codeDescription: String {
switch self {
case .dot: return ".dot"
case .dash: return ".dash"
case .dashDot: return ".dashDot"
case .dashDotDot: return ".dashDotDot"
}
}
}

extension TextDecoration.Style {
var codeDescription: String {
switch self {
case .single: return ".single"
case .thick: return ".thick"
case .double: return ".double"
}
}
var codeDescription: String {
switch self {
case .single: return ".single"
case .thick: return ".thick"
case .double: return ".double"
}
}
}
34 changes: 17 additions & 17 deletions Example/Styles/Sources/Extensions/TextEffect+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
import Styles

extension TextEffect {
static let bigRedFirstWord = TextEffect(
style: .bigRed,
matching: First(occurenceOf: "Styles")
)
static let bigGreenLastWord = TextEffect(
style: .bigGreen,
matching: Block { $0.range(of: "awesome") }
)
static let everyOtherTilda = TextEffect(
style: .cyanTextWithBlueShadow,
matching: Regex("~.*?(~)")
)
static let doge = TextEffect(
image: #imageLiteral(resourceName: "doge"),
style: .cyanTextWithBlueShadow,
matching: First(occurenceOf: " i")
)
static let bigRedFirstWord = TextEffect(
style: .bigRed,
matching: First(occurenceOf: "Styles")
)
static let bigGreenLastWord = TextEffect(
style: .bigGreen,
matching: Block { $0.range(of: "awesome") }
)
static let everyOtherTilda = TextEffect(
style: .cyanTextWithBlueShadow,
matching: Regex("~.*?(~)")
)
static let doge = TextEffect(
image: #imageLiteral(resourceName: "doge"),
style: .cyanTextWithBlueShadow,
matching: First(occurenceOf: " i")
)
}
10 changes: 5 additions & 5 deletions Example/Styles/Sources/Extensions/TextEffect+Definition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import Styles

extension TextEffect {
struct Definition {
let effect: TextEffect
let effectDescription: String
let textStyleDescription: String
}
struct Definition {
let effect: TextEffect
let effectDescription: String
let textStyleDescription: String
}
}
Loading

0 comments on commit 8249db2

Please sign in to comment.