This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PhotoCell.swift | |
// TestApp | |
// | |
// Created by Coder ACJHP on 20.10.2023. | |
// | |
import UIKit | |
class PhotoCell: UICollectionViewCell { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate var circleIcon: UIImageView! | |
fileprivate var circlePathaAnimation: CAKeyframeAnimation! | |
// Drawing func that takes x position as an argument | |
// Call this funtion inside 'drawRect' or 'onTouchMoves' | |
fileprivate func drawHighlightCircleFromLeftPosition(_ posiX: CGFloat) { | |
// If imageView and animation already created and existing change percentage | |
if let circleIcon = self.circleIcon, | |
let animation = circlePathaAnimation { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save into keychain | |
let nameData = Data(weparents_auth.utf8) | |
let passwordData = Data(weparents_PI.utf8) | |
KeychainHelper.shared.save(nameData, service: .userName, account: .account) | |
KeychainHelper.shared.save(passwordData, service: .password, account: .account) | |
// Read from keychain | |
if let nameData = KeychainHelper.shared.read(service: .userName, account: .account), | |
let passwordData = KeychainHelper.shared.read(service: .password, account: .account), | |
let nameString = String(data: nameData, encoding: .utf8), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SplitMirror filter.swift | |
// Image Editor | |
// | |
// Created by Coder ACJHP on 25.02.2022. | |
// | |
// SnapChat & Tiktok & Motion App like image filter | |
// Inspired from 'https://support.apple.com/tr-tr/guide/motion/motn169f94ea/mac' | |
// Splits an image in half vertically and reverses the left remaining half to create a reflection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func onApply(_ sender: Any) { | |
if selectedAssetInfo.isEmpty { | |
return | |
} | |
var tempVideoURLs: Array<URL> = [] | |
waiting.startAnimating() | |
waiting.isHidden = false | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original code in obj-c = https://stackoverflow.com/questions/13766268/3d-text-effect-in-ios | |
private func draw3D(text: NSString, usingfont font: UIFont, depthValue depth: CGFloat, foregroundColor: UIColor, shadowColor: UIColor, outlineColor: UIColor) -> UIImage? { | |
let attributes: [NSAttributedString.Key: Any] = [ | |
.font : font, | |
.foregroundColor : foregroundColor | |
] | |
var textSize = view.bounds.size | |
textSize.width += depth + 5 | |
textSize.height += depth + 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// This function drawing text around circle path and its percentage depends on 'bendFactor' | |
/// - Parameters: | |
/// - text: String for drawing | |
/// - bend: value of circle percentage it should be between -2.0 and 2.0 | |
/// - size: Your container view size that you want to draw on it | |
/// - clockWise: Text should start from where clockWise or anticlockwise | |
private func drawCurved(text: String, bendFactor bend: CGFloat, fitToSize size: CGSize, clockWise: Bool = true) { | |
var tempTextRef: String = text | |
if text.count > maximumCharacterLimit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Connectivity.swift | |
// Test App | |
// | |
// Created by Onur Işık on 14.05.2020. | |
// Copyright © 2020 Onur Işık. All rights reserved. | |
// | |
// NOTE: This struct needs to Alomafire pod to work (Alomafire includes NetworkReachabilityManager) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Update image RGB colors with sliders | |
public func updateImageColorsWith(multiplier: [CGFloat], of: UIImage) -> UIImage { | |
guard let inputCGImage = of.cgImage else { | |
print("Unable to get cgImage") | |
return of | |
} | |
let colorSpace = CGColorSpaceCreateDeviceRGB() | |
let width = inputCGImage.width |
NewerOlder