Giter Site home page Giter Site logo

ios-wanted-k-keyboard's Introduction

K-Keyboard

Screenshot

테마 정보 페이지 한글 쿼티 키보드


Feature

테마 정보 페이지

다양한 사이즈의 화면에서 레이아웃이 깨지지 않게 표시
다양한 기기에서
스크린샷 2022-10-08 오후 2 38 17 스크린샷 2022-10-08 오후 2 38 26 스크린샷 2022-10-08 오후 2 38 39

다양한 글씨크기
스크린샷 2022-10-08 오후 2 46 40 스크린샷 2022-10-08 오후 2 47 52 스크린샷 2022-10-08 오후 2 47 37


한글 쿼티 키보드

한글 입력 시 낱자의 결합, 이동, 음절 분리 같은 동작을 수행하기위해 조합 중인 텍스트(inputTextBuffer)와 조합이 완료된 텍스트(inputText)를 별도로 저장하고, 조합 중인 텍스트의 상태를 세분화

/// 조합이 완료된 입력 텍스트
private var inputText: String
/// 입력 텍스트 중 현재 조합 중인 텍스트를 처리하기 위한 임시 저장 공간
private var inputTextBuffer: HangulComponents
/// 현재 조합 중인 텍스트의 상태
private var state: State
/// 현재 조합 중인 텍스트와 조합이 완료된 텍스트
private var outputText: String {
  inputText + inputTextBuffer.toSyllabel
}

enum State: String {
  /// 버퍼가 비워진 상태
  case none
  /// 버퍼에 초성이 있는 상태
  case leadingConsonant
  /// 버퍼에 초성과 홑모음 중성이 있는 상태
  case leadingConsonantAndSingleVowel
  /// 버퍼에 초성과 겹모음 중성이 있는 상태
  case leadingConsonantAndDoubleVowel
  /// 버퍼에 초성, 중성과 홑받침이 있는 상태
  case leadingConsonantAndVowelAndSingleTrailingConsonant
  /// 버퍼에 초성, 중성, 겹받침이 있는 상태
  case leadingConsonantAndVowelAndDoubleTrailingConsonant
  /// 버퍼에 홑모음 중성이 있는 상태
  case singleVowel
  /// 버퍼에 겹모음 중성이 있는 상태
  case doubleVowel
}    

조합 단계에서 낱자의 결합이 유효한지 판단

// 버퍼에 초성과 홑모음 중성이 있는 상태
case .leadingConsonantAndSingleVowel:
    if !value.isVowel {
        inputTextBuffer.addComponent(value, for: .trailingConsonant)
        state = .leadingConsonantAndVowelAndSingleTrailingConsonant
    } else {
          // 버퍼의 홑모음 중성과 입력한 홑모음 중성을 결합하여 유효한 겹모음을 만들 수 있는지 확인
        if (inputTextBuffer.vowel.firstCharacterAsString + value).isVowel {
              // 유효한 겹모음일 경우 조합 중인 글자에 추가
            inputTextBuffer.addComponent(value, for: .vowel)
            state = .leadingConsonantAndDoubleVowel
        } else {
              // 유효하지 않은 겹모음인 경우 조합을 끝내고 새로운 조합을 시작
            flush()
            inputTextBuffer.addComponent(value, for: .vowel)
            state = .singleVowel
        }
    }


Development Tool

  • Frameworks: UIKit, Custom Keyboard Extension
  • Tools: Xcode 16
  • Language: Swift 5


Contributors

dahee (홍다희) Sole (진연서)
betterhee 스크린샷_2022-10-08_오후_3 35 44-removebg-preview
- 키보드 기능구현 - UI 구현

ios-wanted-k-keyboard's People

Contributors

betterhee avatar solejin avatar soo941226 avatar

Stargazers

 avatar

ios-wanted-k-keyboard's Issues

키보드 기능구현

어떤 앱에서도 사용할 수 있는 실제 한글 쿼티 키보드

  • Keyboard Extension 추가
  • 한글 음소 버튼을 배치
  • 뒤로가기를 누를 경우, 조합중인 글자 중 한 음소만 제거
  • 쉬프트 키를 눌렀을 때
    • 쉬프트 버튼의 UI 변경
    • 홑자음을 쌍자음으로 변경
    • 쌍자음을 입력하거나 쉬프트 키를 다시 누르면 원래대로 돌아가기

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.