Skip to content
프로젝트

소개

Path iOS 앱과 같은 타임라인

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
-1
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Timeline

Timeline like the Path iOS app

Usage

The timeline is a UIView subclass, and can be taller than the screen. It is best used within a scrollview.

To initialize the timeline, use this code:

let timeline = TimelineView(bulletType: .Diamond, timeFrames: [/*timeFrames*/])

The bullet type can be changed to any of the following types:

public enum BulletType{
	case Circle
	case Hexagon
	case Diamond
	case DiamondSlash
	case Carrot
	case Arrow
}

The time frames must all be instances of the TimeFrame stuct. An array of TimeFrames may look like this:

let frames = [
	TimeFrame(text: "New Year's Day", date: "January 1", image: UIImage(named: "fireworks.jpeg")),
	TimeFrame(text: "That's right. No image is necessary!", date: "No image?", image: nil),
	TimeFrame(text: "Hope this helps someone!", date: "That's it!", image: nil)
]

After the timeline is initialized, it is ready to go. For more customization, you can edit the following properties:

public var timeFrames: [TimeFrame]
  
public var lineColor: UIColor = UIColor.lightGrayColor()
	
public var titleLabelColor: UIColor = UIColor(red: 0/255, green: 180/255, blue: 160/255, alpha: 1)

public var detailLabelColor: UIColor = UIColor(red: 110/255, green: 110/255, blue: 110/255, alpha: 1)

public var bulletType: BulletType = BulletType.Diamond

public var showBulletOnRight: Bool = false

For more precise detail on what these properties do, look at the inline documentation.

At this point, the timeline is completely ready to use. Add it to a scroll view, add constraints, and you are ready to go!

See the sample project for an example of how to do integrate this view into your project.

Conclusion

That's about all there is to it! Hope you find it useful, and let me know if you use it in any production apps. It's great to see my work used by others.

관련 프로젝트 살펴보기

불러오는 중…