• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    Swift
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An ideal iOS library using swift programming language. Draw a smooth curve through several points you designated. The curve‘s bend level is adjustable.

LxThroughPointsBezier-Swift

An ideal iOS library using swift programming language. Draw a smooth curve through several points you designated. The curve‘s bend level is adjustable. Installation

You only need drag UIBezierPath+LxThroughPointsBezier.swift to your project. Support

Minimum support iOS version: iOS 5.0 Usage

        var _points = [CGPoint]()

        let point1 = CGPoint(x: 30, y: 210)
        let point2 = CGPoint(x: 90, y: 120)
        let point3 = CGPoint(x: 120, y: 200)
        let point4 = CGPoint(x: 160, y: 240)
        let point5 = CGPoint(x: 210, y: 160)
        let point6 = CGPoint(x: 240, y: 300)
        let point7 = CGPoint(x: 290, y: 140)
  
        _points.append(point1)
        _points.append(point2)
        _points.append(point3)
        _points.append(point4)
        _points.append(point5)
        _points.append(point6)
        _points.append(point7)
        
        let _curve = UIBezierPath()
        
        _curve.contractionFactor = CGFloat(0.7)
        _curve.moveToPoint(point1)
        _curve.addBezierThrough(points: _points)
        
        let _shapeLayer = CAShapeLayer()
        
        _shapeLayer.strokeColor = UIColor.blueColor().CGColor
        _shapeLayer.fillColor = nil
        _shapeLayer.lineWidth = 3
        _shapeLayer.path = _curve.CGPath
        _shapeLayer.lineCap = kCALineCapRound
        view.layer.addSublayer(_shapeLayer)

Be careful

The good bend level is about 0.6 ~ 0.8. The default and recommended value is 0.7.
You must give at least 1 point for drawing the curve.

Effect

  • demo

License

LxThroughPointsBezier-Swift is available under the Apache License 2.0. See the LICENSE file for more info.

More Repositories

1

macOS_Development_Tutorials_translation

Translation of macOS development tutorials.
1,280
star
2

LxGridView

Imitation iOS system desktop icon arrangement and interaction by UICollectionView!
Objective-C
972
star
3

LxDBAnything

Automate box any value! Print log without any format control symbol! Change debug habit thoroughly!
Objective-C
431
star
4

LxThroughPointsBezier

A funny iOS library. Draw a smooth bezier through several points you designated. The curve‘s bend level is adjustable.
Objective-C
397
star
5

LxTabBarController

Inherited from UITabBarController. LxTabBarController add a powerful gesture that you can switch view controller by sweeping screen from left to right or right to left.
Objective-C
225
star
6

LxGridView-swift

Imitation iOS system desktop icon arrangement and interaction by UICollectionView!
Swift
162
star
7

Troubles-of-realizing-download-module

实现项目下载需求时遇过的那些坑
152
star
8

LxFTPRequest

A convenient FTP request library for iOS and Mac OS X using Objective-C programming language. Support progress tracking, Breakpoint continuingly etc.
Objective-C
141
star
9

LxTabBadgePoint

Easily custom viewController's tabBar badge view.
Objective-C
117
star
10

LxTabBarController-swift

Inherited from UITabBarController. To change UITabBarController interactive mode, LxTabBarController add a powerful gesture you can switch view controller by sweeping screen from left the right or right to left.
Swift
77
star
11

LxKeychain

Manage your username and password for iOS and OS X platform. Highly encryption and won't be lose even you uninstall your app.
Objective-C
55
star
12

Dreamy_download_manage_solution

续言关于下载管理的探讨
19
star
13

The-strategy-of-building-a-method

论构造方法的方法论
18
star
14

LxKeychain-swift

Swift
18
star
15

LxVolumeManager

Control and observe iOS system volume.
Objective-C
17
star
16

LxPDFParser

A delightful iOS library. Simply parse the PDF file's structure. The foundation to come true more complicated functions.
Objective-C
16
star
17

LxIAPManager

Apple IAP capsulation.
Objective-C
15
star
18

FauxPas_document_translation

10
star
19

LxNavigationController

A convenient navigationController inherited from UINavigationController. LxNavigationController add a powerful gesture you can pop view controller only if you sweep the screen from left the right.
Objective-C
10
star
20

LxGitHubStarCounter

Calculate user's total star.
Python
9
star
21

LxProjectTemplate

As this repo's name.
Objective-C
8
star
22

Android-Development-Tutorials-translation

Translation of Android development tutorials.
7
star
23

LxIAPManager-swift

Apple IAP capsulation.
Swift
7
star
24

LxHTTPManager

适用于项目实践的网络请求管理封装
Objective-C
7
star
25

LxLabel

An evolutional label inherited from UILabel. It can generate a large number of effect, and use simple properties to set.
Objective-C
6
star
26

clang_static_analyzer_document_translation

6
star
27

LxTabBadgePoint-swift

Easily custom viewController's tabBar badge view.
Swift
6
star
28

LxOCCodeCleaner

Clean Objective-C code.
Shell
4
star
29

xctool_document_translation

4
star
30

LxWaveLayer

Easily add wave animation.
Objective-C
3
star
31

LxPropertyDefaultValue

Setup any custom object properties default value easily.
Objective-C
3
star
32

LxDragToDismissBadgeLabel

Objective-C
2
star
33

LxKVO

Objective-C
2
star
34

LxDownloadTask

个人认为理想的下载任务对象的模型,暂尚未具体实现
Objective-C
2
star
35

LxAppleOfficialFontManager-swift

Swift
2
star
36

LxApplication

A feature-rich application help class inherited from UIApplication.
Objective-C
2
star
37

LxSandBoxNavigator

Simply show the directory's structure by tableView tree.
Objective-C
2
star
38

LxProjectTemplate-Swift

As the repo's name.
Swift
2
star
39

LxNavigationController-swift

A convenient navigationController inherited from UINavigationController. LxNavigationController add a powerful gesture you can pop view controller only if you sweep the screen from left the right.
Swift
2
star
40

LxBigFileDigger

Find big files.
Shell
2
star
41

Notes

notes
1
star
42

charles_documentation_translation

Charles documentationtranslation
1
star
43

LxGlobalTimerManager

1
star
44

safety_in_swift_translation

1
star
45

LxWaveLayer-swift

Easily add wave animation.
Swift
1
star
46

LxAppleOfficialFontManager

Objective-C
1
star
47

xed_document_translation

1
star
48

LxGetMacIP

Shell
1
star