{"id":19179223,"url":"https://github.com/melling/ios_topics","last_synced_at":"2025-08-29T13:04:25.275Z","repository":{"id":136799279,"uuid":"53425871","full_name":"melling/ios_topics","owner":"melling","description":"Small example iOS programs in Swift 5","archived":false,"fork":false,"pushed_at":"2020-04-30T19:24:34.000Z","size":6059,"stargazers_count":73,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T21:46:01.670Z","etag":null,"topics":["autolayout","ios-topics","uitableviewcontroller-subclass","uiview-subclass"],"latest_commit_sha":null,"homepage":"http://www.h4labs.com/dev/ios/swift.html","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-08T16:07:13.000Z","updated_at":"2025-05-06T12:30:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a6d3262-8dfa-456a-9d0e-8c964ca9dcba","html_url":"https://github.com/melling/ios_topics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2Fios_topics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2Fios_topics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2Fios_topics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2Fios_topics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melling","download_url":"https://codeload.github.com/melling/ios_topics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961858,"owners_count":21832192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autolayout","ios-topics","uitableviewcontroller-subclass","uiview-subclass"],"created_at":"2024-11-09T10:42:29.241Z","updated_at":"2025-05-07T21:46:06.202Z","avatar_url":"https://github.com/melling.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS Topics in Swift 5\n\nMiscellaneous iOS 12 Swift 5.0 programs that implement minimal examples for various random topics.\n\nI will blog about each examples as time permits under this section of my website: http://www.h4labs.com/dev/ios/swift_cookbook.html\nFor now, I'll place notes in README.md files with each project.\n\nPlease note that I'm creating most of these application as \"Single View Applications\" then adding views (e.g. UITableView) in code. It's\na personal preference to not use Storyboards.\n\n\n## [AutoLayout Centered Button using iOS9 Anchors](https://github.com/melling/ios_topics/blob/master/ButtonCenteredWithAnchors/ButtonCenteredWithAnchors)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/ButtonCenteredWithAnchors/ButtonCenteredWithAnchors/screenshot-toc.png)\n```swift \nNSLayoutConstraint.activate([\n    centeredButton.centerXAnchor.constraint(equalTo: view.centerXAnchor),\n    centeredButton.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 0)\n    ])\n```\n\n## [AutoLayout Two Button in StackView](https://github.com/melling/ios_topics/blob/master/TwoButtonsInStackView/TwoButtonsInStackView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TwoButtonsInStackView/TwoButtonsInStackView/screenshot-toc.png)\n\n+ Buttons are equal size with 25 points between them\n+ StackView is centered horizontally\n+ StackView 10 points above bottom anchor\n+ Add some extra padding to button width and height\n\n```swift\n// Add some extra button padding\nrightBtn.contentEdgeInsets = UIEdgeInsets.init(top: 5, left: 5, bottom: 5, right: 5)\n\n```\n## [Various UIButtons in a UIStackView](https://github.com/melling/ios_topics/blob/master/ButtonsInStackView/ButtonsInStackView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/ButtonsInStackView/ButtonsInStackView/screenshot-toc.png)\n\n## [UIAlertController Example](https://github.com/melling/ios_topics/blob/master/AlertControllers/AlertControllers)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/AlertControllers/AlertControllers/screenshot-toc.png)\n\n## [Simple UIView Subclass](https://github.com/melling/ios_topics/blob/master/SimpleUIViewSubclass/SimpleUIViewSubclass)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/SimpleUIViewSubclass/SimpleUIViewSubclass/screenshot-toc.png)\n\n## [Gradient Layer](https://github.com/melling/ios_topics/blob/master/GradientView/GradientView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/GradientView/GradientView/screenshot-toc.png)\n\n## [Basic UITableViewController Subclass](https://github.com/melling/ios_topics/blob/master/SimpleTableView/SimpleTableView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/SimpleTableView/SimpleTableView/screenshot-toc.png)\n\n+ Subclass UITableViewController\n+ Custom Header Height\n+ Set Header Cell Color\n+ Fixed Row Height: tableView.rowHeight = 80\n\n## [Basic UITableViewController with Custom UITableViewCell](https://github.com/melling/ios_topics/blob/master/TableViewWithCustomCell/TableViewWithCustomCell)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TableViewWithCustomCell/TableViewWithCustomCell/screenshot-toc.png)\n\n## [UITableViewController Subclass with Sections](https://github.com/melling/ios_topics/blob/master/TableViewWithSections/TableViewWithSections)\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TableViewWithSections/TableViewWithSections/screenshot-toc.png)\n\n## [UITableViewController Subclass with Sections and an Index](https://github.com/melling/ios_topics/blob/master/TableViewWithIndex/TableViewWithIndex)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TableViewWithIndex/TableViewWithIndex/screenshot-toc.png)\n\n## [Custom UITableView Header](https://github.com/melling/ios_topics/blob/master/CustomTableViewHeaderCell/CustomTableViewHeaderCell)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CustomTableViewHeaderCell/CustomTableViewHeaderCell/screenshot-toc.png)\n\n## [UICollectionViewController Subclass](https://github.com/melling/ios_topics/blob/master/CollectionViewBasic/CollectionViewBasic)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CollectionViewBasic/CollectionViewBasic/screenshot-toc.png)\n\n\n## [UICollectionViewController Delegate](https://github.com/melling/ios_topics/blob/master/CollectionViewDelegate/CollectionViewDelegate)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CollectionViewDelegate/CollectionViewDelegate/screenshot-toc.png)\n\n\n## [UICollectionView with Custom Cell](https://github.com/melling/ios_topics/blob/master/CollectionViewWithCustomCell/CollectionViewWithCustomCell)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CollectionViewWithCustomCell/CollectionViewWithCustomCell/screenshot-toc.png)\n\n## [UISwitch](https://github.com/melling/ios_topics/blob/master/SwitchController/SwitchController)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/SwitchController/SwitchController/screenshot-toc.png)\n\n## [UISegmentedControl](https://github.com/melling/ios_topics/blob/master/SegmentController/SegmentController)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/SegmentController/SegmentController/screenshot-toc.png)\n\n## [CAShapeLayer with Basic Shapes](https://github.com/melling/ios_topics/blob/master/ShapeLayer/ShapeLayer)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/ShapeLayer/ShapeLayer/screenshot-toc.png)\n\n+ CAShapeLayer() added to a UIViewController\n+ Use UIBezierPath to draw shapes\n\n## [Animate the Drawing of a Bezier Line](https://github.com/melling/ios_topics/blob/master/LineDrawingAnimation/LineDrawingAnimation)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/LineDrawingAnimation/LineDrawingAnimation/screenshot-toc.png)\n\n\n## [Animate the Drawing of a Bezier Circle](https://github.com/melling/ios_topics/blob/master/CircleDrawingAnimation/CircleDrawingAnimation)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CircleDrawingAnimation/CircleDrawingAnimation/screenshot-toc.png)\n\n\n## [Transition from One View to Another with a Curl Up](https://github.com/melling/ios_topics/blob/master/TransitionWithView/TransitionWithView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TransitionWithView/TransitionWithView/screenshot-toc.png)\n\n\n## [Transition from One View with UILabel to Another with a Curl Up](https://github.com/melling/ios_topics/blob/master/TransitionWithViewAndLabels/TransitionWithViewAndLabels)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TransitionWithViewAndLabels/TransitionWithViewAndLabels/screenshot-toc.png)\n\n\n## [Single Tap Gesture on View](https://github.com/melling/ios_topics/blob/master/TapGesture/TapGesture)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/TapGesture/TapGesture/screenshot-toc.png)\n\n\n## [Simple AVAudioPlayer Example](https://github.com/melling/ios_topics/blob/master/PlayAudio/PlayAudio)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/PlayAudio/PlayAudio/screenshot-toc.png)\n\n## [Size, Rotate, and Fade Transforms](https://github.com/melling/ios_topics/blob/master/ViewTransforms/ViewTransforms)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/ViewTransforms/ViewTransforms/screenshot-toc.png)\n\n```swift \nfunc rotateIt() {\n    UIView.animate(withDuration: 2,\n        delay: 0,\n        options: .curveEaseInOut,\n        animations: {\n\n            let transform = CGAffineTransform.identity.rotated(by: .pi)\n\n            self.label.transform = CGAffineTransform(rotationAngle: .pi)\n\n            self.aView.transform = transform\n        }, completion: {_ in\n\n            self.fadeIt()\n        })\n    }\n```\n\n\n## [Simple UIView Subclass](https://github.com/melling/ios_topics/blob/master/CustomUIView/CustomUIView)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CustomUIView/CustomUIView/screenshot-toc.png)\n\n\n## [A StackView in a StackView](https://github.com/melling/ios_topics/blob/master/StackViewsInStackViews/StackViewsInStackViews)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/StackViewsInStackViews/StackViewsInStackViews/screenshot-toc.png)\n\n## [Programmatically Show/Push ViewController](https://github.com/melling/ios_topics/blob/master/ShowViewController/ShowViewController)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/ShowViewController/ShowViewController/screenshot-toc.png)\n\n```swift \nfunc nextController(_ sender:UIButton) {\n    let secondViewController = SecondViewController()\n\n    self.navigationController?.pushViewController(secondViewController, animated: true)\n}\n```\n\n```swift \nfunc previousController(_ sender:UIButton) {\n\n    _ = self.navigationController?.popViewController(animated: true)\n}\n```\n\n\n## [No Nib Project - All Code](https://github.com/melling/ios_topics/blob/master/NoNibAllCodeSwift/NoNibAllCodeSwift)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/NoNibAllCodeSwift/NoNibAllCodeSwift/screenshot-toc.png)\n\n```swift \nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    \n    self.window = UIWindow(frame: UIScreen.main.bounds)\n    let navController = UINavigationController()\n    self.window?.rootViewController = navController\n    let topLevelController = ViewController()\n    navController.addChildViewController(topLevelController)\n    \n    self.window?.makeKeyAndVisible()\n    \n    return true\n}\n```\n\n## [UIPickerView](https://github.com/melling/ios_topics/blob/master/PickerViewDemo/PickerViewDemo)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/PickerViewDemo/PickerViewDemo/screenshot-toc.png)\n\n## [Countdown Timer](https://github.com/melling/ios_topics/blob/master/CountDownTimer/CountDownTimer)\n\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CountDownTimer/CountDownTimer/screenshot-toc.png)\n\n```swift\n timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)\n```\n\n## [Core Data](https://github.com/melling/ios_topics/blob/master/CoreDataHighScores/CoreDataHighScores)\n\n## [Game Clock](https://github.com/melling/ios_topics/blob/master/GameClock/GameClock)\n\n## [WebView](https://github.com/melling/ios_topics/blob/master/WebView/WebView)\n\n## [AppRotation](https://github.com/melling/ios_topics/blob/master/AppRotation/AppRotation/)\n\n* Misc Notes\n\n## ImageMagick\n+ Fix Mac OS installation error\n - http://stackoverflow.com/questions/22715738/imagemagick-error\n```\nconvert ./screenshot.png -resize 25% screenshot-small.png; # Smaller screenshot\nconvert ./screenshot.png -resize 20% screenshot-toc.png; # Table of Contents screenshot\n```\n\n#### Ideas and In-Progress\n\n- [Handle Device Rotation](https://github.com/melling/ios_topics/blob/master/AppRotation/AppRotation)\n- [Pan Gesture](AppRotation://github.com/melling/ios_topics/blob/master/PanGesture/PanGesture/screenshot-toc.png)|https://github.com/melling/ios_topics/blob/master/PanGesture/PanGesture\n- PDF Creation\n- Save Image to Photos\n- Dispatch Async\n- Core Data\n- sqlite|\n- Read plist\n\n### Old\n\n## [AutoLayout Centered Button](https://github.com/melling/ios_topics/blob/master/CenteredAutoLayoutButton/CenteredAutoLayoutButton)\n![Screenshot](https://github.com/melling/ios_topics/blob/master/CenteredAutoLayoutButton/CenteredAutoLayoutButton/screenshot-toc.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelling%2Fios_topics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelling%2Fios_topics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelling%2Fios_topics/lists"}