Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Add CPPodfileConsoleTextView to allow auto scrolling #213

Merged
merged 1 commit into from
Jan 19, 2016
Merged

Add CPPodfileConsoleTextView to allow auto scrolling #213

merged 1 commit into from
Jan 19, 2016

Conversation

aaronpearce
Copy link
Contributor

Fixes #188 by adding CPPodfileConsoleTextView to allow the text view to automatically scroll to the bottom if it was previously there.

I attempted to do this scrolling via utilizing NSTextView delegate methods on CPPodfileConsoleViewController but none of them had the right order of completion. We must check current position, then append text and then scroll for this action to function correctly.

To do this, I have added an attributedText property to the CPPodfileConsoleTextView subclass (couldn't override attributedString directly). On didSet we check the current position then swap out the actual attributedString on the text storage and scroll to the previous positioning.

There may be a simpler way to do this than subclassing and adding a property but I couldn't work it out. If anyone has a suggestion on a cleaner way to implement this, I'm happy to give it a shot.

@orta
Copy link
Member

orta commented Jan 18, 2016

AWESOMEEEE

@orta
Copy link
Member

orta commented Jan 18, 2016

I think this looks great, thanks a lot @aaronpearce

orta added a commit that referenced this pull request Jan 19, 2016
Add CPPodfileConsoleTextView to allow auto scrolling
@orta orta merged commit 9481736 into CocoaPods:master Jan 19, 2016
@aaronpearce aaronpearce deleted the console-scroll-to-bottom branch January 20, 2016 04:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants