Skip to content

Conversation

@jleandroperez
Copy link
Contributor

Description:

In this PR we're adding three new TextView properties:

  • blockquoteBorderColor
  • blockquoteBackgroundColor
  • preBackgroundColor

Details:

Because of the dynamic keyword, the three new properties are compatible with Apple's UIAppearance() mechanism. This allows us to do the following:

  • Customize a specific instance: textView.blockquoteBackgroundColor = .green
  • Customize all of Aztec's instances: TextView.appearance().blockquoteBackgroundColor = .green

Apple's appearance() mechanism also allows for customization when contained in a specific ViewController, or define the UX for a specific set of traits.

Testing:

  1. Open EditorDemoViewController.swift
  2. Paste this snippet in viewDidLoad textView.blockquoteBackgroundColor = .green
  3. Launch Aztec
  4. Insert a Blockquote

Verify that the blockquote is green.

@jleandroperez jleandroperez added this to the Beta 14 (next stable) milestone Oct 30, 2017
@jleandroperez jleandroperez self-assigned this Oct 30, 2017
///
fileprivate var textAttachmentImageProvider = [TextViewAttachmentImageProvider]()

// MARK: - Properties: Formatting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the mark?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: if we want to rename this I'm fine, but it's a good one since all of it's content is related to formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the change few lines above. This is part of the delegates section, so it's a bit of redundant


// MARK: - Properties: Text Storage

// MARK: - TextKit Aztec Subclass'ess
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/s/Subclass'ess/Subclasses

No need for the apostrophe / single-quote.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for 3 lines.

@jleandroperez
Copy link
Contributor Author

Thanks for the review sir!

@jleandroperez jleandroperez merged commit 6e07d6a into develop Oct 30, 2017
@jleandroperez jleandroperez deleted the issue/customizable-blockquote-style branch October 30, 2017 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants