Skip to content

Instantly share code, notes, and snippets.

View Coder-ACJHP's full-sized avatar
🐞
Creating buggy programs

Onur Işık Coder-ACJHP

🐞
Creating buggy programs
View GitHub Profile
@Coder-ACJHP
Coder-ACJHP / AnimationView.swift
Created April 1, 2020 00:41
UIView includes floating hearts like facebook live streams animation
//
// AnimationView.swift
// autofix
//
// Created by Onur Işık on 31.03.2020.
// Copyright © 2020 Coder ACJHP. All rights reserved.
//
import UIKit
@Coder-ACJHP
Coder-ACJHP / DrawFaceRect.swift
Created November 29, 2019 07:47
Draw face rectangle on UIView by converting and transforming from UIGraphics coordinate to UIView coordinates with sample buffer in Swift 4.2
private func drawFaceRectangle(sampleBuffer: CMSampleBuffer, detectedFaceRect: CGRect) {
let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
let cameraImage = CIImage(cvPixelBuffer: pixelBuffer!)
// For converting the Core Image Coordinates to UIView Coordinates
let ciImageSize = cameraImage.extent.size
var transform = CGAffineTransform(scaleX: 1, y: -1)
transform = transform.translatedBy(x: 0, y: -ciImageSize.height)
@Coder-ACJHP
Coder-ACJHP / DrawFaceRectFromSampleBuffer.swift
Created November 20, 2019 07:34
This method gets sample buffer and converts it to image than draws face rect on shape layer on UIKit
fileprivate func drawFaceFrame(sampleBuffer: CMSampleBuffer) {
let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
let cameraImage = CIImage(cvPixelBuffer: pixelBuffer!)
let faces = faceDetector?.features(in: cameraImage)
// For converting the Core Image Coordinates to UIView Coordinates
let ciImageSize = cameraImage.extent.size
var transform = CGAffineTransform(scaleX: 1, y: -1)
@Coder-ACJHP
Coder-ACJHP / MultipleTapableAttributedStringTextView.swift
Created September 18, 2019 17:09
TextView that allows to tap on attributed strings, it returns location of tapped word as CGPoint and shows popupView.
//
// MultipleTapableAttributedStringTextView.swift
// TapOnAttributedText
//
// Created by Onur Işık on 18.09.2019.
// Copyright © 2019 Onur Işık. All rights reserved.
//
import UIKit
@Coder-ACJHP
Coder-ACJHP / ChallengeViewController.swift
Created June 27, 2019 12:20
Handle view component events inside UICollectionView Cell
//
// ChallengeViewController.swift
// Challenge
//
// Created by Coder ACJHP on 27.06.2019.
// Copyright © 2019 Fitbest Bilgi Teknolojileri. All rights reserved.
//
import UIKit
@Coder-ACJHP
Coder-ACJHP / LinePulsator.swift
Created May 3, 2019 12:19
Lined circles shrinks and grows with glowing (changing alpha) in order around any view that you specialize.
import UIKit
class TestViewController: UIViewController {
private var timer: Timer?
private var circleShapeCount: Int = 0
private var scaleAnimation: CABasicAnimation? = {
let animation = CABasicAnimation(keyPath: "transform.scale")
animation.fromValue = 0.80
@Coder-ACJHP
Coder-ACJHP / CarouselViewController.swift
Created May 2, 2019 19:30
Build 3D carousel for image cards with Swift 4+
//
// CarouselViewController.swift
//
// Created by Onur Işık on 2.05.2019.
// Copyright © 2019 Fitbest Bilgi Teknolojileri A.Ş. All rights reserved.
//
import UIKit
class CarouselViewController: UIViewController {
@Coder-ACJHP
Coder-ACJHP / TinderLikeAnimation.swift
Created May 2, 2019 18:49
Build Tinder app like card animation with swift 4+
//
// TinderLikeAnimation.swift
//
// Created by Coder ACJHP on 2.05.2019.
// Copyright © 2019 Onur Işık All rights reserved.
//
import UIKit
class TinderLikeAnimation: UIViewController {
@Coder-ACJHP
Coder-ACJHP / DownloadManager.swift
Created April 29, 2019 19:22
This class is download manager that download files from given url with caching data in disk of device for iOS
//
// DownloadManager.swift
// UrlCacheExample
//
// Created by Coder ACJHP on 12.04.2019.
// Copyright © 2019 Onur Işık. All rights reserved.
//
import UIKit
@Coder-ACJHP
Coder-ACJHP / UICContextMenu.swift
Created April 23, 2019 12:51
Custom contextual menu appears from bottom to top like `UIAlertControllerStyleActionSheet`
//
// ContextMenu.swift
//
// Created by Onur Işık on 23.04.2019.
// Copyright © 2019 Coder ACJHP. All rights reserved.
//
import UIKit
protocol UIContextMenuDelegate: AnyObject {
func contextMenu(_ contextMenu: UICContextMenu?, didSelectAspectRatio ratio: CGFloat)