Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

Category: Swift

Swift, a new development language released by Apple at WWDC (Apple Developer Conference) in 2014, can run on Mac OS and iOS platforms together with Objective-C* to build applications based on the Apple platform. Swift is an easy-to-learn and easy-to-use programming language, and it is also the first system programming language with the same expressiveness and fun as a scripting language. Swift is designed with safety as the starting point to avoid various common programming error categories.

Quick – Waiting for Alamofire in unit test

I am trying to write a method where the data object (Realm) refreshes its properties using Alamofire. But I can’t figure out how to unit test it.

import Alamofire
import RealmSwift
import Swi

October 10, 2021By Simo Swift Alamofire, SalamoFire, waitingLeave a Comment

swift – Subclass a Struct或Similar

I understand how structures and classes (and protocols) work at a basic level. I have a fairly common situation:

I need to use operators They must be copied during assignment.
These types hav

October 10, 2021By Simo Swift similar, struct, Subclass, SWIFTLeave a Comment

Swift – The beginning of the week and end day last week

Today is Friday, March 6. How to find that February 16 is the start date, and February 22 is the end date of the week before the previous week.
16 is my country Bulgaria will be 15 and 21 in the U

October 10, 2021By Simo Swift 1 week, Day, end, front, last week, Mi, one week, Start, That, WeLeave a Comment

SWIFT – NSFONTATTRIBUTEDSTRING Work before Xcode 6.1

let timeFont = [NSFontAttributeName:UIFont(name: “Voyage”, size: 20.0)]
var attrString3 = NSAttributedString(“(Time)”, attributes: timeFont); // <--- compiler error "Extra argument in call" This co

October 10, 2021By Simo Swift 6.1, Before, NSFONTATTRIBUTEDSTRING, SWIFT, XcodeLeave a Comment

Swift error: ‘Sequence’ Requirements Type ‘T’ and ‘ArraysLice’ is equivalent

I am trying to update the math library to be compatible with Swift 3, but I encountered an error:

‘Sequence’ requires types’T’ and’ ArraySlice’ is equivalent to

The Apple documentation

October 10, 2021By Simo Swift Arrayslice, error, Isometric, requirements, Sequence, SWIFT, TypesLeave a Comment

How to get the current time of SWIFT?

I want to get the current time, so far I have completed this:

let date = NSDate()
let calender = NSCalendar.currentCalendar()
let components = calender.component([.Hour, .Minute], fromDate

October 10, 2021By Simo Swift Current, how to get, SWIFT, timeLeave a Comment

SWIFT: How to set anyobject to nil or equivalent

I have a very general function that needs to return AnyObject:

func backgroundFunction(dm: DataManager) -> AnyObject {
…
} But in some cases I want to return an empty/null value

I th

October 10, 2021By Simo Swift AnyObject, equivalent, How, NIL, setting, SWIFTLeave a Comment

Swift 4 JSONSerialization.jsonObject

I am using Xcode 9.2 and Swift 4. How to check whether the returned json data is empty?
Now it gives me error if json [0] [“data”] type’Any’ has no subscript member in the line

var json: NSM

October 10, 2021By Simo Swift jsonobject, jsonserialization, jsonserialization.jsonobject, SWIFTLeave a Comment

SWIFT – Using the Alamofire and ObjectMapper, the integer value is always zero

I am using Alamofire and ObjectMapper, my model class is like this

class Category: Object, Mappable {
dynamic var id: Int = 0
dynamic var name = “”
dynamic var thumbnail = “”
var children = L

October 10, 2021By Simo Swift Alamofire, Always, Objectmapper, SWIFT, use, value, wholeLeave a Comment

How do I decode the JWT (JSON Web token) token in SWIFT?

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ How do I decode this so that I can get the payload like this

{ “sub”: “1234567890”, “name”: “John Doe ”, “admin”: true }

October 10, 2021By Simo Swift Decoding, How to, JSON, JWT, Label, letter, Medium, SWIFT, WEBLeave a Comment

Posts navigation

Page 1 Page 2 Page 3 … Page 9
Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress