Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: k-lpmg/Tagging
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.3.0
Choose a base ref
...
head repository: k-lpmg/Tagging
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 28, 2018

  1. Update README.md

    k-lpmg committed Jul 28, 2018
    Copy the full SHA
    718ddf8 View commit details
  2. Update README.md

    k-lpmg committed Jul 28, 2018
    Copy the full SHA
    966539a View commit details
  3. Remove annotation

    k-lpmg committed Jul 28, 2018
    Copy the full SHA
    ee136f3 View commit details

Commits on Jul 31, 2018

  1. Update README.md

    k-lpmg committed Jul 31, 2018
    Copy the full SHA
    ed9e21d View commit details
  2. Update Info.plist

    k-lpmg committed Jul 31, 2018
    Copy the full SHA
    6b77bd2 View commit details

Commits on Aug 14, 2018

  1. Chore Sources folder

    k-lpmg committed Aug 14, 2018
    Copy the full SHA
    593aec9 View commit details

Commits on Aug 19, 2018

  1. Rename UITests -> Tests

    k-lpmg committed Aug 19, 2018
    Copy the full SHA
    16e1e17 View commit details
  2. Update .podspec

    k-lpmg committed Aug 19, 2018
    Copy the full SHA
    e8bd024 View commit details

Commits on Feb 13, 2019

  1. Update to swift 4.2

    k-lpmg committed Feb 13, 2019
    Copy the full SHA
    73dcf65 View commit details
  2. Fix string count issue (#1)

    k-lpmg committed Feb 13, 2019
    Copy the full SHA
    dc4c969 View commit details
  3. Update .travis.yml

    k-lpmg committed Feb 13, 2019
    Copy the full SHA
    c891401 View commit details
  4. Bump version to 0.4.0

    k-lpmg committed Feb 13, 2019
    Copy the full SHA
    9af3ca3 View commit details

Commits on Apr 9, 2019

  1. Update README.md

    k-lpmg committed Apr 9, 2019
    Copy the full SHA
    bccbf1e View commit details

Commits on Apr 15, 2019

  1. Update README.md

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    b90f76f View commit details
  2. Add support for Swift 5

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    daa4da3 View commit details
  3. Delete .swift-version

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    e241e0d View commit details
  4. Update README.md

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    707853e View commit details
  5. Update .travis.yml

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    e7254ed View commit details
  6. Merge pull request #3 from k-lpmg/swift-5.0

    Support Swift 5.0
    k-lpmg authored Apr 15, 2019
    Copy the full SHA
    61479db View commit details
  7. Add .swift-version

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    3a3c1de View commit details
  8. Bump version to 0.5.0

    k-lpmg committed Apr 15, 2019
    Copy the full SHA
    acf0a0b View commit details

Commits on Apr 23, 2019

  1. Update README.md

    k-lpmg authored Apr 23, 2019
    Copy the full SHA
    4c94f21 View commit details

Commits on May 1, 2019

  1. Update README.md

    k-lpmg committed May 1, 2019
    Copy the full SHA
    fa53818 View commit details
  2. Update README.md

    k-lpmg committed May 1, 2019
    Copy the full SHA
    5428504 View commit details
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
5.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
osx_image: xcode9.4
osx_image: xcode10.2
language: objective-c
env:
global:
- PROJECT="Tagging.xcodeproj"
- SCHEME="TaggingExample"
- IOS_SDK="iphonesimulator"
matrix:
- SDK="$IOS_SDK" DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=11.4"
- SDK="$IOS_SDK" DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=12.2"

install:
- swift --version
10 changes: 1 addition & 9 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
//
// AppDelegate.swift
// TaggingExample
//
// Created by DongHeeKang on 2018. 7. 2..
// Copyright © 2018년 k-lpmg. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

14 changes: 3 additions & 11 deletions Example/Sources/TaggingViewController.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// TaggingViewController.swift
// TaggingExample
//
// Created by DongHeeKang on 2018. 6. 23..
// Copyright © 2018년 k-lpmg. All rights reserved.
//

import UIKit

import Tagging
@@ -43,9 +35,9 @@ class TaggingViewController: UIViewController {
tagging.cornerRadius = 20
tagging.textInset = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16)
tagging.backgroundColor = UIColor.lightGray.withAlphaComponent(0.1)
tagging.defaultAttributes = [NSAttributedStringKey.foregroundColor: UIColor.black, NSAttributedStringKey.font: UIFont.boldSystemFont(ofSize: 20)]
tagging.symbolAttributes = [NSAttributedStringKey.foregroundColor: UIColor.gray]
tagging.taggedAttributes = [NSAttributedStringKey.foregroundColor: UIColor.gray, NSAttributedStringKey.underlineStyle: NSNumber(value: 1)]
tagging.defaultAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black, NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20)]
tagging.symbolAttributes = [NSAttributedString.Key.foregroundColor: UIColor.gray]
tagging.taggedAttributes = [NSAttributedString.Key.foregroundColor: UIColor.gray, NSAttributedString.Key.underlineStyle: NSNumber(value: 1)]
tagging.dataSource = self

tagging.symbol = "#"
2 changes: 1 addition & 1 deletion Sources/Info.plist → Info.plist
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>0.5.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Tagging
[![Build Status](https://travis-ci.org/k-lpmg/Tagging.svg?branch=master)](https://travis-ci.org/k-lpmg/Tagging)
![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)
[![Cocoapods](https://img.shields.io/cocoapods/v/Tagging.svg?style=flat)](https://cocoapods.org/pods/Tagging)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
![Swift](https://img.shields.io/badge/Swift-4.1-orange.svg)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://raw.githubusercontent.com/k-lpmg/RealmWrapper/master/LICENSE)
[![Build Status](https://travis-ci.org/k-lpmg/Tagging.svg?branch=master)](https://travis-ci.org/k-lpmg/Tagging)

✍️ TextView that provides easy to use tagging feature for Mention or Hashtag.
A TextView that provides easy to use tagging feature for Mention or Hashtag.


## Introduction
[Tagging](https://github.com/k-lpmg/Tagging) is a UIView that encloses a TextView that contains an algorithm for tagging.
If you're worried about implementing `Mention` or `Hashtag` in your app, you can easily implement them using the library.

![taggingtooverwatchhero](https://user-images.githubusercontent.com/15151687/42734216-23087396-887b-11e8-9ad9-16975de922c8.gif)
![tagging](https://user-images.githubusercontent.com/15151687/43359597-9be98a16-92df-11e8-8bda-4719502bd907.gif)


## Getting Started
@@ -68,12 +67,12 @@ func tagging(_ tagging: Tagging, didChangedTaggedList taggedList: [TaggingModel]
platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
pod 'Tagging'
target '<Your Target Name>' do
pod 'Tagging'
end
```

### Carthage (iOS 8+)
#### Carthage (iOS 8+)

```ruby
github "k-lpmg/Tagging"
30 changes: 11 additions & 19 deletions Sources/Tagging.swift → Sources/Tagging/Tagging.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Tagging.swift
// Tagging
//
// Created by DongHeeKang on 2018. 6. 16..
// Copyright © 2018년 k-lpmg. All rights reserved.
//

import UIKit
import Foundation

@@ -42,17 +34,17 @@ open class Tagging: UIView {

open var symbol: String = "@"
open var tagableList: [String]?
open var defaultAttributes: [NSAttributedStringKey: Any] = {
return [NSAttributedStringKey.foregroundColor: UIColor.black,
NSAttributedStringKey.font: UIFont.boldSystemFont(ofSize: 15),
NSAttributedStringKey.underlineStyle: NSNumber(value: 0)]
open var defaultAttributes: [NSAttributedString.Key: Any] = {
return [NSAttributedString.Key.foregroundColor: UIColor.black,
NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15),
NSAttributedString.Key.underlineStyle: NSNumber(value: 0)]
}()
open var symbolAttributes: [NSAttributedStringKey: Any] = {
return [NSAttributedStringKey.foregroundColor: UIColor.black,
NSAttributedStringKey.font: UIFont.boldSystemFont(ofSize: 15),
NSAttributedStringKey.underlineStyle: NSNumber(value: 0)]
open var symbolAttributes: [NSAttributedString.Key: Any] = {
return [NSAttributedString.Key.foregroundColor: UIColor.black,
NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15),
NSAttributedString.Key.underlineStyle: NSNumber(value: 0)]
}()
open var taggedAttributes: [NSAttributedStringKey: Any] = {return [NSAttributedStringKey.underlineStyle: NSNumber(value: 1)]}()
open var taggedAttributes: [NSAttributedString.Key: Any] = {return [NSAttributedString.Key.underlineStyle: NSNumber(value: 1)]}()

public private(set) var taggedList: [TaggingModel] = []
public weak var dataSource: TaggingDataSource?
@@ -71,7 +63,7 @@ open class Tagging: UIView {

// MARK: - UI Components

open let textView: UITextView = {
public let textView: UITextView = {
let textView = UITextView()
textView.translatesAutoresizingMaskIntoConstraints = false
return textView
@@ -100,7 +92,7 @@ open class Tagging: UIView {
let tag = tagFormat(tagText)
let replace = tag.appending(" ")
let changed = (allText as NSString).replacingCharacters(in: range, with: replace)
let tagRange = NSMakeRange(range.location, tag.count)
let tagRange = NSMakeRange(range.location, tag.utf16.count)

taggedList.append(TaggingModel(text: tagText, range: tagRange))
for i in 0..<taggedList.count-1 {
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// TaggingDataSource.swift
// Tagging
//
// Created by DongHeeKang on 2018. 6. 24..
//

public protocol TaggingDataSource: class {
func tagging(_ tagging: Tagging, didChangedTagableList tagableList: [String])
func tagging(_ tagging: Tagging, didChangedTaggedList taggedList: [TaggingModel])
6 changes: 6 additions & 0 deletions Sources/Tagging/TaggingModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation

public struct TaggingModel {
public var text: String
public var range: NSRange
}
14 changes: 0 additions & 14 deletions Sources/TaggingModel.swift

This file was deleted.

8 changes: 0 additions & 8 deletions Sources/Tagging.h → Tagging.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Tagging.h
// Tagging
//
// Created by DongHeeKang on 2018. 7. 2..
// Copyright © 2018년 k-lpmg. All rights reserved.
//

#import <UIKit/UIKit.h>

FOUNDATION_EXPORT double TaggingVersionNumber;
4 changes: 2 additions & 2 deletions Tagging.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "Tagging"
s.version = "0.3.0"
s.version = "0.5.0"
s.summary = "TextView that provides a tagging feature to Mention or Hashtag"
s.homepage = "https://github.com/k-lpmg/Tagging"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "DongHee Kang" => "kanglpmg@gmail.com" }
s.source = { :git => "https://github.com/k-lpmg/Tagging.git", :tag => s.version.to_s }
s.documentation_url = "https://github.com/k-lpmg/Tagging/blob/master/README.md"

s.ios.source_files = "Sources/*.swift"
s.ios.source_files = "Sources/**/*.swift"
s.ios.deployment_target = "8.0"
end
Loading