This file contains hidden or 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
| // | |
| // UserDefaultsManager.swift | |
| // Www.ADKATech.com | |
| // | |
| // Created by AmrAngry on 7/30/19. | |
| // Modifyed by AmrAngry on 5/5/20. | |
| // Copyright © 2019 Www.ADKATech.com. All rights reserved. | |
| // Generic use original mestion by (FB)محمود زكى and hamada147(Github) | |
| import Foundation |
This file contains hidden or 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
| // assign table view controller custom class to: | |
| // DonMagSampleTableViewController | |
| // no cell Prototypesneeded | |
| // no @IBOutlet or @IBAction connections needed | |
| struct DonMagSampleDataStruct { | |
| var color: UIColor = .white | |
| var strings: [String] = [] | |
| } |
This file contains hidden or 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
| // assign table view controller custom class to: | |
| // DonMagSampleTableViewController | |
| // no cell Prototypesneeded | |
| // no @IBOutlet or @IBAction connections needed | |
| struct DonMagSampleDataStruct { | |
| var color: UIColor = .white | |
| var strings: [String] = [] | |
| } |
This file contains hidden or 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
| import UIKit | |
| protocol DropDownButtonDelegate: AnyObject { | |
| func didSelect(_ index: Int) | |
| } | |
| class DropDownButton: UIView { | |
| let button: UIButton = { | |
| let button = UIButton() |
This file contains hidden or 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
| import UIKit | |
| protocol DropDownButtonDelegate: AnyObject { | |
| func didSelect(_ index: Int) | |
| } | |
| class DropDownButton: UIView { | |
| let button: UIButton = { | |
| let button = UIButton() |
This file contains hidden or 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
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.500) { | |
| self.tableView.setNeedsLayout() | |
| self.tableView.layoutIfNeeded() | |
| self.tableView.reloadData() | |
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.500) { | |
| UIView.performWithoutAnimation { | |
| let firstIndexPath = IndexPath(row: 0, section: 0) | |
| self.tableView.reloadRows(at: [firstIndexPath], with: .none) | |
| self.tableView.setContentOffset(CGPoint.zero, animated: true) | |
| } |
This file contains hidden or 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
| import Foundation | |
| class ViewWithDynamicWidthScrollingView: UIView { | |
| convenience init() { | |
| self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height)) | |
| } | |
| override init(frame: CGRect) { | |
| super.init(frame: frame) |
This file contains hidden or 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
| // | |
| // ViewController.swift | |
| // ConstantArea | |
| // | |
| // Created by Gleb Tarasov on 24.05.2020. | |
| // Copyright © 2020 Gleb Tarasov. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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
| // | |
| // ViewController.swift | |
| // ConstantArea | |
| // | |
| // Created by Gleb Tarasov on 24.05.2020. | |
| // Copyright © 2020 Gleb Tarasov. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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 is a collection view of vertically scrolling cells 1/3 high as wide and left hand image 1/3 width of screen with text label 2/3 screen width to the right of the image. This is completely created in code. I created a View Controller on the storyboard as I needed to attach a navgation controller. All you ever ever need to adjust is the imageAspectRatio and te image will always be 1/3 of the width of the cell row. | |
| ViewController code. | |
| import UIKit | |
| let imageAspectRatio : CGFloat = 1.2 |
NewerOlder