Skip to main content

Questions tagged [uikit]

UIKit is the infrastructure framework on which all iOS user interface is built

Filter by
Sorted by
Tagged with
3 votes
2 answers
99 views

Building a UITableView with fixed number of cells progammatically

I am building this pet project with UIKit. The App's main goal is to keep track of my daily expenses. The AddExpenseViewController is responsible for capturing user ...
1 vote
1 answer
695 views

Best way to do Input Validation on Swift/iOS/UIKit

I have the following form that creates a new "activity": For which I want to enforce the following requirements: Name => minimum # of chars: 1; maximum # of chars: 50 Description => ...
4 votes
2 answers
1k views

Better way to provide data to UIKit component from Combine pipeline

Today I'm researching how to provide data to UIKit component when using Combine pipeline. I could see tons of tutorials about how to use SwiftUI + Combine from internet, but not found anyone helpful ...
1 vote
1 answer
154 views

iOS: prettify random color for debugging

iOS: prettify random color for debugging I used to use random color to debug, from colors I like ...
2 votes
1 answer
143 views

UITableView, auto locate back at indexPath when user drags it

I have a tableView, which auto locates back at indexPath after user has dragged it. In other words, bouncing the tableView back into its bounds, after user dragged it out. Here is the code: ...
3 votes
1 answer
708 views

Adding dragging ability to a UIView using UIKitDynamics

I recently published an iOS control/component called BJDraggable which basically, with a call of a method, enables us to drag a view within its superview boundary. ...
3 votes
1 answer
891 views

Core Data Wrapper

I built a wrapper in Swift to practice CoreData. My question is more general, I hope this is acceptable. I wanted to know whether my implementation of this wrapper is correct or poorly implemented ...
3 votes
2 answers
3k views

Extending UITableViewCell to preserve UIView background color when selecting the cell

When a UITableViewCell has subviews with background color set, when setSelected(_: animated:) gets called, all the views are ...
0 votes
1 answer
68 views

Change level button's image

There are 12 buttons, and each of them has 3 options for selecting pictures, depending on the data. It works but I think need a shorter and more intelligent decision. ...
4 votes
1 answer
148 views

"What To Do" App

I am starting to build up my portfolio, so I am starting to build projects whenever an idea pops up in my head. So, I decided to build an app that helps you decide what to do. Basically how it works ...
4 votes
1 answer
912 views

A helper class for creating icons from a PNG image and colour in Swift

I have made a helper struct in Swift that creates circular icons from a PNG image (a white icon on transparent background) and a background ...
1 vote
1 answer
2k views

Draw grid programatically with borders

I need to draw a grid with some special requirements. My current solution is working but is far away from ideal I guess. Attached you can find the current working solution: Some of my thoughts which ...
1 vote
1 answer
2k views

UIViewController without interfacebuilder

I have a template I've been using with Swift for UIViewController and UIView subclasses without a ...
1 vote
1 answer
9k views

Proper cellForRowAtIndexPath cell return in Swift

So I have started creating a UITableView with multiple prototype cells. I currently have the below code setup, which works fine ...
1 vote
1 answer
141 views

Factory pattern for image or shape marker [closed]

I'm making a photo marker application and need to make a factory pattern for marker. I think it is not very flexible and overall not good. Would you check my code and suggest what could be improved? ...
8 votes
2 answers
2k views

iOS Utility methods for UIView

Lately, I've been part of a team working on a utility library for iOS called Thundercats (on Github). We're about to start working on some changes and upgrades in preparation for a 2.0 release, so we ...
10 votes
1 answer
1k views

Blurring an Image

Lately, I've been part of a team working on a utility library for iOS called Thundercats (on Github). We're about to start working on some changes and upgrades in preparation for a 2.0 release, so we ...
3 votes
1 answer
3k views

Set a font for a UITextView if the font is nil or not equal to desired font

Main question I am setting a font for a UITextView that is a subview in a custom view. I only set it if the user didn't specify the font size in the Interface Builder. I have the following working ...
4 votes
2 answers
7k views

Removing a subview with a subview from a UIView without memory leaks

I made a custom UITextView for vertical Mongolian writing. It is made by subclassing UIView, which has a subview called ...
3 votes
1 answer
5k views

Draw an arc based on a given percentage

I wanted to create a class that would allow me to draw an arc representing a percentage of progress, similar to the activity view on the Apple watch. There are various examples which I found helpful ...
5 votes
1 answer
372 views

Sierpinski Triangle

I am a Java programmer who recently started learning some Swift. I made an app that displays the Sierpinski triangle and adds triangles if the user pans up, and zooms in and out using the pinch ...
10 votes
1 answer
699 views

Finger painting code

I have a very simple view that handles touch events and draws accordingly. It's nothing significant, but it does use a bit more CPU than I would like (35%). Again, it is the bare minimum (<90 lines)...
15 votes
1 answer
7k views

IBDesignable UICheckbox

A more up-to-date version of this control can be found on GitHub. One UI control that has always been mysteriously missing from Xcode's interface builder is some sort of checkbox. ...