Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richzertuche/InceptionTouch
Who needs 3DTouch when you can have InceptionTouch
https://github.com/richzertuche/InceptionTouch
Last synced: 3 months ago
JSON representation
Who needs 3DTouch when you can have InceptionTouch
- Host: GitHub
- URL: https://github.com/richzertuche/InceptionTouch
- Owner: richzertuche
- Created: 2015-09-12T15:33:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-22T22:17:23.000Z (over 9 years ago)
- Last Synced: 2024-08-03T14:10:19.183Z (6 months ago)
- Language: Swift
- Size: 252 KB
- Stars: 197
- Watchers: 8
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InceptionTouch
Swift / 3DTouch for Every Device
![alt tag](inception.png)
**Create your InceptionTouch TextView**
Swift
```swift
var it_be: InceptionTouch?it_be = InceptionTouch(frame: CGRectMake(0, 100, self.view.frame.size.width, 300))
it_be!.inceptionTouchDelegate = self
it_be!.textAlignment = .Center
it_be!.text = "Who needs 3D Touch when we have InceptionTouch \n\nhttp://www.github.com/richzertuche \nPhone number: (408) 996-1010 \n1 November 2015! \n1 Infinite Loop Cupertino, CA 95014"
self.view .addSubview(it_be!)
```**Add the delegate function**
Type 0 - Date
Type 1 - Phone Numer
Type 2 - URL
Type 3 - Optional[Address]Swift
```swift
func typeOfLink(type: Int, link: String) {
println("\(type) - \(link)")
if type == 2{
self.showPreview(it_be!, link: link)
} else {
let alert = UIAlertView(title: "A dream inside a dream", message: "Handle me! I am \(link)", delegate: self, cancelButtonTitle: "OK")
alert.show()
}
}
```**The popover was added at the bottom, custom made to show the webview, but you can do whatever you like with the type returned by the delegate.**
Hope you find it useful.
Follow me on Twitter @richzertuche